+
Skip to content

Conversation

jcaip
Copy link
Contributor

@jcaip jcaip commented Jun 4, 2025

Summary:

This PR updates sparse-marlin to not use CPU tensors and updates it to be compatible with Int4WeightOnl.

Test Plan:

pytest test/sparsity/test_marlin.py

Reviewers:

Subscribers:

Tasks:

Tags:

Summary:

This PR updates sparse-marlin to not use CPU tensors and updates it to
be compatible with Int4WeightOnl.

Test Plan:
```
pytest test/sparsity/test_marlin.py
```

Reviewers:

Subscribers:

Tasks:

Tags:
Copy link

pytorch-bot bot commented Jun 4, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2305

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 1 Pending

As of commit 1d4e73a with merge base 152a8e3 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 4, 2025
@jcaip jcaip added the topic: bug fix Use this tag for PRs that fix bugs label Jun 4, 2025
Comment on lines +162 to +164
self.scale_and_zero = None
self.scale = scale
self.zero_point = zero_point
self.zero = zero
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have both scale_and_zero and zero?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's to maintain compatibility with https://github.com/pytorch/ao/blob/main/torchao/dtypes/uintx/int4_xpu_layout.py, otherwise the checks fail because the TensorImpl doesn't have this attribute.

@jcaip jcaip merged commit 801af03 into main Jun 4, 2025
19 checks passed
liangel-02 pushed a commit that referenced this pull request Aug 25, 2025
* [sparse] marlin fixes

Summary:

This PR updates sparse-marlin to not use CPU tensors and updates it to
be compatible with Int4WeightOnl.

Test Plan:
```
pytest test/sparsity/test_marlin.py
```

Reviewers:

Subscribers:

Tasks:

Tags:

* ruff check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: bug fix Use this tag for PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载