Repository navigation
Restore SM89 FP8 NT path and fix Pi0.5 autotune scratch selection - #93
Merged
LiangSu8899 merged 2 commits intoJun 19, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR restores the SM89 (Ada) FP8 nk (transpose-B) GEMM path and fixes Pi0.5 FP8 autotune scratch selection by switching from the old K == *_H heuristic to the existing size-based scratch pickers, for both base and batched RTX pipelines. It also adds regression tests covering scratch selection, nk dispatch, the batched B=2 one-shot autotune guard, and the pybind symbol surface.
Changes:
- Reintroduce
fp8_nt_dev/autotune_fp8_nt_devinGemmRunner(cuBLASLt cached descriptor path) and expose them via pybind. - Update Pi0.5 RTX autotune to choose FP8 scratch buffers via
_pick_fp8_scratch/_pick_fp8_scratch_b2(size-based), and add a B=2 autotune one-shot guard for the batched path. - Add tests for scratch selection, layout dispatch behavior, the batched autotune guard, and the existence of the new
GemmRunnerbindings.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tests/test_pi05_rtx_autotune_scratch.py |
Adds regression tests for scratch selection, nk dispatch, batched one-shot autotune behavior, and pybind symbol presence. |
flash_rt/models/pi05/pipeline_rtx.py |
Switches FP8 autotune scratch selection from K==*_H to _pick_fp8_scratch(..., M*K) and passes pointers directly. |
flash_rt/models/pi05/pipeline_rtx_batched.py |
Applies the same size-based scratch selection for B=2 autotune and adds a _gemms_autotuned_b2 guard. |
csrc/gemm/gemm_runner.h |
Declares fp8_nt_dev and autotune_fp8_nt_dev and introduces a cached GEMM type for FP8 transpose-B. |
csrc/gemm/gemm_runner.cu |
Implements FP8 transpose-B cached descriptors + runtime/autotune entrypoints using cuBLASLt. |
csrc/bindings.cpp |
Exposes fp8_nt_dev and autotune_fp8_nt_dev on the pybind GemmRunner. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LiangSu8899
approved these changes
Jun 19, 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
This PR fixes the current SM89 Pi0.5 FP8 regression and keeps the scope tight:
nk -> fp8_nt_dev/autotune_fp8_nt_devbinding and cuBLASLt path inGemmRunnerK == *_Hheuristicnkdispatch, the B=2 one-shot guard, and the pybind symbol surfaceCloses #91.
Scope
pipeline_rtx_fp16.py, because the public FP16 path explicitly rejectsuse_fp8=Trueand that dormant branch is outside the supported runtime contract for this PReval_libero.pyfollow-up workValidation Environment
8.9)550.54.1412.4(nvcc 12.4.99)2.6.0+cu124torchValidation
Kernel binding / import check
Confirmed the locally built extension imports from the source tree and exposes the restored symbols:
Observed result:
flash_rt/flash_rt_kernels.cpython-310-x86_64-linux-gnu.sohas_fp8_nt_dev == Truehas_autotune_fp8_nt_dev == TrueFocused regression test
Observed result:
5 passed in 0.17sPrecision comparison
Base path: FP8 vs FP16 baseline on the same fixed noise
Ran two isolated subprocesses through the public API on the same checkpoint,
same observation, same prompt, and the same injected
(10, 32)diffusion noise.Compared the final
(10, 7)action outputs.Observed result:
fp8vsfp16baseline):0.9987420.0647430.013287Batched path: B=2 slot-0 vs serial B=1
Observed result:
1 passed in 38.75s>= 0.99Runtime quickstart: FP8
Observed result:
PASSOKP50 41.3 ms (24 Hz)37.5 / 42.2 / 49.5 msRuntime quickstart: FP16 baseline
Observed result:
PASSOKP50 51.1 ms (20 Hz)46.4 / 49.4 / 51.4 msLimitations / Not Covered Here
GPU_ARCHfamilies in this environment.pipeline_rtx_fp16.pycontains a dormant internal FP8 branch with similar old heuristic logic, but the public FP16 path explicitly rejectsuse_fp8=True; that branch is intentionally left out of scope for this PR.