Optimize W8A8 Triton backward matmul#1611
Open
zzlol63 wants to merge 1 commit into
Open
Conversation
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
Performance
Measured on an NVIDIA RTX PRO 6000 Blackwell with the repository-root venv (
torch 2.12.0+cu130, Triton 3.7.0), using the benchmark shapeM=2098, K=3072, N=3088.Baseline and final implementations ran in the same process against identical resident tensors. Both were precompiled/autotuned, measurement order alternated over 7 rounds, and each sample contained 1,000 launches timed with CUDA events. Values below are medians.
complete backwardincludes activation quantization, matmul, scale/dequantization, and output conversion undertorch.compile(fullgraph=True).A CUDA profiler check confirmed that the previous compiled path launches
_mm_kernelfollowed by an Inductor pointwise scale/cast kernel. The fused path launches only_mm_kernel.Validation
ruff checkon all three changed Python files73 x 96 @ 96 x 80) covering masked edge tilesDisclaimer
AI assistance was used to author the code (both Claude Code and Codex).