[TorchToTosa] Lower static FP8 aten._scaled_mm to TOSA#4559
Open
[TorchToTosa] Lower static FP8 aten._scaled_mm to TOSA#4559
Conversation
cbcf84d to
466d3fd
Compare
Add Torch op definitions, abstract interpretation support, and FX importer handling for aten._scaled_mm, including float8_e8m0fnu blocked-scale tensors. Keep this change independent of TOSA legalization. Include frontend export/import coverage for per-tensor and blocked-scale FP8 shapes, plus out_dtype=None dtype inference. Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: I102732ad725f89477b7f8fb2339d4fe920fa647b
Add TorchToTosa legalization for static FP8 aten._scaled_mm with real-valued scale tensors. Lower FP8 inputs to TOSA FP8 matmul, then apply the combined scale product to the f32 accumulator before optional bias and final output cast. Support scalar/[1] per-tensor scales and simple 1-D lhs/rhs channel scales, with lit and Python coverage for e4m3, e5m2, mixed FP8 inputs, bias, and rejection cases. Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: Ie14b7f1a662820951ffb174285c9b5b15a9467b0
466d3fd to
db1f73e
Compare
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.
Adds TorchToTosa legalization for static FP8 aten._scaled_mm with real-valued scale tensors.
Stacked on #4558. Until #4558 lands and this branch is rebased, the GitHub diff will include the foundational Torch op commit as well. The review focus for this PR is the second commit: static FP8 TorchToTosa lowering.