Add algorithm search to FP8 sparse linear benchmark (#4432) - #4432
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4432
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 8f60b68 with merge base 918b32d ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@gyllstromk has exported this pull request. If you are a Meta employee, you can view the originating Diff in D102683062. |
|
@gyllstromk has imported this pull request. If you are a Meta employee, you can view this in D102683062. |
Summary: What: Adds algorithm search support (--search-alg) to the FP8 sparse linear benchmark. Threads a new alg_id parameter through the quantization config (Float8DynamicActivationFloat8WeightConfig), the sparse tensor class, and down into the _cslt_sparse_mm kernel call. When --search-alg is passed, the benchmark calls _cslt_sparse_mm_search to find the best algorithm for each shape and benchmarks with that algorithm to report the speedup. Why: hipSPARSELt supports multiple algorithms for sparse matmul, and the default (alg_id=0) isn't always the fastest. This lets us find the best algorithm for a given shape and measure the performance benefit. Differential Revision: D102683062 Pulled By: gyllstromk
a7848a2 to
8f60b68
Compare
|
@claude review this PR |
|
Claude finished @vkuzo's task in 2m 0s —— View job Review of PR #4432
SummaryClean, well-structured change that threads an Issues1. Backward-compatibility risk with
This is likely low-risk since this is a new ROCm-only feature and no production checkpoints would have been saved with this tensor type yet, but worth being aware of. 2. The Looks Good
VerdictLGTM with the minor comments above. The implementation is correct and follows the existing patterns well. |
|
Claude finished @vkuzo's task in 1m 23s —— View job Review of PR #4432
SummaryClean change that threads an Issues1. Deserialization of old checkpoints sets
This is likely low risk since this tensor type is new and ROCm-only, but if you want to be defensive, consider defaulting to alg_id=weight_tensor.alg_id or 0,2. The Looks Good
VerdictLGTM with the minor comments above. The implementation is correct and follows existing patterns well. |
Summary:
What: Adds algorithm search support (--search-alg) to the FP8 sparse linear benchmark. Threads a new alg_id parameter through the quantization config (Float8DynamicActivationFloat8WeightConfig), the sparse tensor class, and down into the _cslt_sparse_mm kernel call. When --search-alg is passed, the benchmark calls _cslt_sparse_mm_search to find the best algorithm for each shape and benchmarks with that algorithm to report the speedup.
Why: hipSPARSELt supports multiple algorithms for sparse matmul, and the default (alg_id=0) isn't always the fastest. This lets us find the best algorithm for a given shape and measure the performance benefit.
Differential Revision: D102683062
Pulled By: gyllstromk