Use transpose_result=True for fp8_sparse_mm (#4433) - #4433
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4433
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 14b126c with merge base c81eb79 ( 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 D105060886. |
|
@claude review this PR |
|
Claude finished @vkuzo's task in 2m 17s —— View job Review of PR #4433: Use transpose_result=True for fp8_sparse_mm
Overall: This PR looks good. The core change is clean and correct — using Changes SummaryThis PR contains two commits:
Detailed ReviewThe transpose_result change ( # Before:
result = torch._cslt_sparse_mm(packed, dense.t(), bias=bias, alpha=alpha, out_dtype=torch.float32, alg_id=alg_id)
result = result.t()
if to_pad:
result = result.narrow(0, 0, batch)
return result.contiguous()
# After:
result = torch._cslt_sparse_mm(packed, dense.t(), bias=bias, alpha=alpha, out_dtype=torch.float32, alg_id=alg_id, transpose_result=True)
if to_pad:
result = result.narrow(0, 0, batch)
return resultThis is correct because:
The alg_id threading — properly plumbed through all layers:
Minor Observations
LGTM — the changes are correct, well-structured, and improve performance by using the native transpose path. |
|
looks like there are rebase conflicts, please resolve and we can review again |
Summary: What: Replace `result.t() + result.contiguous()` with `transpose_result=True` in `fp8_sparse_mm`. Why: Use native transpose through hipSPARSELt + `torch._cslt_sparse_mm`. Reviewed By: ZihaoLiu0927 Differential Revision: D105060886 Pulled By: gyllstromk
488a884 to
14b126c
Compare
Summary:
What: Replace
result.t() + result.contiguous()withtranspose_result=Trueinfp8_sparse_mm.Why: Use native transpose through hipSPARSELt +
torch._cslt_sparse_mm.Reviewed By: ZihaoLiu0927
Differential Revision: D105060886
Pulled By: gyllstromk