-
Notifications
You must be signed in to change notification settings - Fork 363
Enable PerRow(axis) to support axes other than -1
#3303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Stack from ghstack (oldest at bottom): |
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/3303
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit b0d38ad with merge base 6259e98 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
PerRow(axis) to support axes other than -1
torchao/quantization/quantize_/workflows/float8/float8_tensor.py
Outdated
Show resolved
Hide resolved
jerryzh168
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
| param_data = param.data | ||
| param_data = param_data.narrow(output_dim, start_idx, shard_size) | ||
| orig_value = param_data.qdata[0][0] | ||
| orig_values = param_data.qdata[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the original check failed by chance, the two tensors had the same value at [0][0]. Checking the first row is more resistant to chance.
Summary:
Enables per-row float8 quantization of tensors with shape (B, K, N) across the K dimension.
TODO before land:
PerRowcallsites across the codebase and see if anything else needs changingTest Plan:
Reviewers:
Subscribers:
Tasks:
Tags: