enable inline asm for mxfp8+rceil+compile+cuda+sm100 - #4282
Merged
Conversation
Contributor
Author
|
Stack from ghstack (oldest at bottom): |
vkuzo
requested review from
danielvegamyhre,
drisspg and
svekars
as code owners
April 15, 2026 13:58
vkuzo
added a commit
that referenced
this pull request
Apr 15, 2026
Summary: PyTorch Core support for compile fusing `inline_asm_elementwise` into surrounding ops landed in pytorch/pytorch#177922 This PR modifies the mxfp8 RCEIL cast to use the `cvt.rp.satfinite.ue8m0x2.f32` instruction when the hardware supports it. Cast mem bw 3.7 TB/s -> 4.1 TB/s Test Plan: ``` // correctness pytest test/prototype/mx_formats -s // cast perf TORCHINDUCTOR_FORCE_DISABLE_CACHES=1 python benchmarks/mx_formats/cast_bench.py --mode dim0_mxfp8_rceil ... // before mem_bw_gbps 3676.9529733517074 // after mem_bw_gbps 4116.556410292409 // microbenchmark perf - see PR doc update, we see small speedups across // the board on relu->linear benchmark ``` ghstack-source-id: be9a5e2 ghstack-comment-id: 4252680990 Pull-Request: #4282
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4282
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit f11cf9d with merge base 00ef369 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
vkuzo
commented
Apr 15, 2026
| # `torch.compiler.is_compiling()` returns False. | ||
| # Note that we need both checks, as neither of them work in both benchmark | ||
| # and e2e use cases by themselves. | ||
| (torch.compiler.is_compiling() or is_fake(descale)) |
Contributor
Author
There was a problem hiding this comment.
this is not super intuitive, but it works
vkuzo
added a commit
that referenced
this pull request
Apr 15, 2026
Summary: PyTorch Core support for compile fusing `inline_asm_elementwise` into surrounding ops landed in pytorch/pytorch#177922 This PR modifies the mxfp8 RCEIL cast to use the `cvt.rp.satfinite.ue8m0x2.f32` instruction when the hardware supports it. Cast mem bw 3.7 TB/s -> 4.1 TB/s Test Plan: ``` // correctness pytest test/prototype/mx_formats -s // cast perf TORCHINDUCTOR_FORCE_DISABLE_CACHES=1 python benchmarks/mx_formats/cast_bench.py --mode dim0_mxfp8_rceil ... // before mem_bw_gbps 3676.9529733517074 // after mem_bw_gbps 4116.556410292409 // microbenchmark perf - see PR doc update, we see small speedups across // the board on relu->linear benchmark ``` ghstack-source-id: e220999 ghstack-comment-id: 4252680990 Pull-Request: #4282
drisspg
approved these changes
Apr 15, 2026
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.
Summary:
PyTorch Core support for compile fusing
inline_asm_elementwiseintosurrounding ops landed in pytorch/pytorch#177922
This PR modifies the mxfp8 RCEIL cast to use the
cvt.rp.satfinite.ue8m0x2.f32instruction when the hardware supportsit.
Cast mem bw 3.7 TB/s -> 4.1 TB/s
Test Plan: