perf(custom_ops): compute FP8 per-token scale via quantscalepertokenfp8 - #814
Open
prashantgupta24 wants to merge 7 commits into
Open
perf(custom_ops): compute FP8 per-token scale via quantscalepertokenfp8#814prashantgupta24 wants to merge 7 commits into
prashantgupta24 wants to merge 7 commits into
Conversation
Signed-off-by: Prashant Gupta <prashantgupta24@gmail.com>
Contributor
|
👋 Hi! Thank you for contributing. We also recommend installing prek and configuring it to check your code before every local commit. |
Signed-off-by: Prashant Gupta <prashantgupta24@gmail.com>
5 tasks
prashantgupta24
marked this pull request as ready for review
September 9, 2026 17:50
prashantgupta24
requested review from
a team,
dilipgb and
yannicks1
as code owners
September 9, 2026 17:50
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
Replace the eager per-token FP8 activation scale computation in
SpyreFp8LinearKernelwithtorch.ops.spyre.quantscalepertokenfp8. The op performs the amax reduction, scale division, and hardware clip inside its own compiled Inductor graph, avoiding an eageramax/division boundary and matching the deeptools operator contract. It is kept separate from the FP8 matmul graph because fusing it with_scaled_mm,quantize_fp8_with_scale, andquantize_weight_fp8_with_scalecauses the SDSC compiler to fail on the combined kernel. Per-tensor activations keep the existing eager scalar scale path becausequantscalepertokenfp8always reduces over the hidden dimension.Related Issues
Relates to the torch-spyre
quantscalepertokenfp8op introduced in torch-spyre/torch-spyre#3457.Test Plan
bash format.sh— passeduv run pytest tests/test_fp8_linear.py -m "not upstream"— 17 passedChecklist
bash format.sh)Signed-off-by:line (DCO compliance)