fix: update FP8 syntax for custom torch._scaled_mm on CPU#201
Merged
chichun-charlie-liu merged 7 commits intomainfrom Mar 30, 2026
Merged
fix: update FP8 syntax for custom torch._scaled_mm on CPU#201chichun-charlie-liu merged 7 commits intomainfrom
chichun-charlie-liu merged 7 commits intomainfrom
Conversation
Signed-off-by: Andrea Fasoli <andrea.fasoli@ibm.com>
Signed-off-by: Andrea Fasoli <andrea.fasoli@ibm.com>
f5003e0 to
01d0cfe
Compare
Signed-off-by: Andrea Fasoli <andrea.fasoli@ibm.com>
Signed-off-by: Andrea Fasoli <andrea.fasoli@ibm.com>
Signed-off-by: Andrea Fasoli <andrea.fasoli@ibm.com>
Signed-off-by: Andrea Fasoli <andrea.fasoli@ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the change
This PR supersedes an earlier fix to the handling of FP8 operations on CPU (#200). This earlier fix resulted in an error when the model was compiled (fms-mo tests did not pick up on this problem).
In PyTorch 2.10,
torch._scaled_mmdoes not support FP8 matmul on CPU with per-channel or per-token quantization (only per-tensor is supported). A fallback to a custom operation already existed atfms_mo/aiu_addons/fp8/fp8_spyre_op.py, but the registration of this fallback operation did not work in PyTorch 2.10, most likely due to an update to allowed signatures for op override.This PR updates the registration signature to a modern syntax.
Related issues or PRs
[internal issue]
How to verify the PR
Example of a test that should pass, ran on a pod with 4 AIUs, in PF mode, in PyTorch 2.10 env (set up env vars according to your case; AFTU = aiu-fms-testing-utils repo):
Was the PR tested
Checklist for passing CI/CD:
git commit -signoffor equivalenttox -e fixtox -e linttox -e spellchecktox -e unit