mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepGEMM#432
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepGEMM/pull/420
Author: @XFDG
Created: 8/26/2026
Status: ❌ Closed
Base:
main← Head:fix-issue-414-capture-safe📝 Commits (1)
d1945e0fix: make pack_ue8m0_to_int CUDA-graph capture safe (#414)📊 Changes
1 file changed (+11 additions, -1 deletions)
View changed files
📝
deep_gemm/utils/math.py(+11 -1)📄 Description
Fix DeepGEMM #414: pack_ue8m0_to_int CUDA Graph capture safe
PR URL
https://github.com/XFDG/DeepGEMM/pull/new/fix-issue-414-capture-safe
Branch
fix-issue-414-capture-safeonXFDG/DeepGEMM(fork ofdeepseek-ai/DeepGEMM)PR Title
fix: make pack_ue8m0_to_int CUDA-graph capture safe (#414)PR Body
Summary
pack_ue8m0_to_intcalls.all()on device tensors to validate scale-factorinvariants at runtime. Each
.all()forces a device→host synchronisation,which is illegal inside a CUDA Graph capture region and raises
cudaErrorStreamCaptureUnsupported.Downstream projects (e.g. SGLang) already hit this when capturing their decode
graphs that call the MegaMoE FP8 staging path, and currently work around it by
monkey-patching the helper. This fix removes the need for that workaround.
Root cause
The two
.all()calls are redundant invariants guaranteed byceil_to_ue8m0, the only function that produces these scale factors:Change
Remove the two runtime
.all()assertions; document the invariant in aNOTEcomment so callers know it is the producer's responsibility.Testing
ceil_to_ue8m0output always satisfies bothremoved invariants (
nonneg=True,zero-mantissa=True) across random inputs..all()call remains inpack_ue8m0_to_int.py_compilesyntax check passes.Compatibility
per_token_cast_to_fp8callers) behaviour isidentical.
Related issue
deepseek-ai/DeepGEMM#414
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.