Repository navigation
Add CuTeDSL MXFP8 pad/unpad kernels - #4594
Closed
alexsamardzic wants to merge 5 commits into
Closed
alexsamardzic wants to merge 5 commits into
alexsamardzic wants to merge 5 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4594
Note: Links to docs will display an error until the docs builds have been completed. ❌ 5 New Failures, 3 Unrelated FailuresAs of commit 3db0406 with merge base 3818749 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Jul 23, 2026
Collaborator
Author
|
PR contains CuTeDSL implementations of the MXFP8 pad/unpad kernels and correspondign tests and validate/benchmark script comparing them against the existing CUDA and PyTorch paths. The kernels performance is on par with CUDA kernels performance, see below. To test: Benchmarking results, for input dims derived from some realistic models
Benchmarking command to produce the table above{
for s in 131072,2048 131072,4096 131072,5120 131072,7168 131072,8192 131072,10240 131072,12288 131072,16384; do
IFS=, read -r t d <<< "$s"
PYTHONPATH=$PWD python scripts/validate_pad_unpad_cutedsl.py \
--tokens "$t" --dim "$d" --groups 8 --multiple-of 1 \
--alignment-size 32 --mode both \
--cuda-graph-bench --graph-iters 1000 2>&1
done
} | perl -ne '
BEGIN {
print "| Tokens x dim | Pad CUDA us | Pad CuTeDSL us | Pad CuTeDSL speedup | Unpad CUDA us | Unpad CuTeDSL us | Unpad CuTeDSL speedup |\n";
print "|---:|---:|---:|---:|---:|---:|---:|\n";
}
if (/=False/) { die "correctness failure: $_"; }
if (/shape=\((\d+),\s*(\d+)\)/) { $shape = "$1x$2"; }
elsif (/^pad_cuda_us=([\d.]+)/) { $pad_cuda = $1; }
elsif (/^pad_cutedsl_us=([\d.]+)/) { $pad_cutedsl = $1; }
elsif (/^unpad_cuda_us=([\d.]+)/) { $unpad_cuda = $1; }
elsif (/^unpad_cutedsl_us=([\d.]+)/) {
$unpad_cutedsl = $1;
printf "| %s | %.2f | %.2f | %.2f | %.2f | %.2f | %.2f |\n",
$shape,
$pad_cuda, $pad_cutedsl, $pad_cuda / $pad_cutedsl,
$unpad_cuda, $unpad_cutedsl, $unpad_cuda / $unpad_cutedsl;
}
'Benchmarking results, for input dims being powers of two
|
Collaborator
Author
|
Replaced by #4703. |
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.
Stack from ghstack (oldest at bottom):