-
Notifications
You must be signed in to change notification settings - Fork 48
perf(fp8): Remove redundant clone calls from FP8 Linear Kernel #841
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -204,9 +204,13 @@ def _run_spyre_apply(self, kernel, layer, x): | |
| assert actual.device.type == "spyre", actual.device | ||
| return actual | ||
|
|
||
| @pytest.mark.parametrize("num_tokens", [1, 4, 128]) | ||
| @pytest.mark.parametrize("num_tokens", [1, 4, 5, 128, 130]) | ||
| def test_scaled_mm_apply(self, num_tokens): | ||
| """apply_weights runs aten._scaled_mm on Spyre.""" | ||
| """apply_weights runs aten._scaled_mm on Spyre. | ||
|
|
||
| num_tokens=5 and 130 exercise M-padding (not in _SMALL_M, not aligned | ||
| to _M_ALIGN=128), verifying the trim-before-reshape path. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two cases (5, 130) do add M-padding, but the test still only asserts
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @R3hankhan123 looks like this might need one more pass then we should be good to go |
||
| """ | ||
| if not spyre_available(): | ||
| pytest.skip("Spyre device not available") | ||
| if SpyreFp8LinearKernel is None: | ||
|
|
@@ -228,7 +232,7 @@ def test_scaled_mm_apply(self, num_tokens): | |
| assert actual.dtype == torch.float16 | ||
| assert actual.shape == (num_tokens, out_features) | ||
|
|
||
| @pytest.mark.parametrize("num_tokens", [1, 4, 128]) | ||
| @pytest.mark.parametrize("num_tokens", [1, 4, 5, 128, 130]) | ||
| def test_scaled_mm_apply_per_channel(self, num_tokens): | ||
| """apply_weights with Granite per-channel weight scales + per-token acts.""" | ||
| if not spyre_available(): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.