Skip to content

[TorchToTosa] Lower static FP8 aten._scaled_mm to TOSA#4559

Open
catcor01 wants to merge 2 commits intollvm:mainfrom
catcor01:cc/scaled-mm-static-fp8-tosa
Open

[TorchToTosa] Lower static FP8 aten._scaled_mm to TOSA#4559
catcor01 wants to merge 2 commits intollvm:mainfrom
catcor01:cc/scaled-mm-static-fp8-tosa

Conversation

@catcor01
Copy link
Copy Markdown
Contributor

@catcor01 catcor01 commented May 6, 2026

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.

@catcor01 catcor01 force-pushed the cc/scaled-mm-static-fp8-tosa branch 4 times, most recently from cbcf84d to 466d3fd Compare May 6, 2026 08:14
catcor01 added 2 commits May 6, 2026 10:15
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
@catcor01 catcor01 force-pushed the cc/scaled-mm-static-fp8-tosa branch from 466d3fd to db1f73e Compare May 6, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant