mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[PR #453] Fix SM120 BF16 GEMM shared-memory reuse ordering #458
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#458
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/453
Author: @Sunt-ing
Created: 9/21/2026
Status: 🔄 Open
Base:
nv_dev← Head:fix/sm120-bf16-stage-reuse📝 Commits (2)
6092535Fix SM120 BF16 GEMM shared-memory reuse ordering7516924Clarify the BF16 repeatability test limitation📊 Changes
2 files changed (+23 additions, -0 deletions)
View changed files
📝
deep_gemm/include/deep_gemm/impls/sm120_bf16_gemm.cuh(+2 -0)📝
tests/test_bf16.py(+21 -0)📄 Description
Summary
Fixes intermittent silent data corruption in SM120 BF16 GEMM caused by a generic-to-async proxy WAR (Write-After-Read) hazard.
Problem
Consumer warps read smem tiles via the generic proxy and signal the empty barrier without an async proxy fence. Producer TMA loads (async proxy) can subsequently overwrite the smem stage before generic reads complete across all consumer threads.
Fix
Add
cutlass::arch::fence_view_async_shared()before the empty-barrier arrival. Placed outside the lane-0 check so all consumer threads issue the fence for their own smem reads.Targets
nv_dev(based on572557e7ae9ad5331b81a1c250f141fba2c57962).Reproduction and validation
Environment: RTX 5090 (SM120), Driver 590.48.01, PyTorch 2.13.0+cu130.
Added
test_bf16_repeatabilityintests/test_bf16.py([4096, 1024] × [1024, 896], seed 233, 6,000 iterations against initial output).To run the standalone regression:
Note: The corruption is an intermittent race condition; a single baseline run passing does not guarantee correctness.
Repeatability (A/B/A Test)
Performance Overhead
CUDA graph timing on
[4096, 1024] × [1024, 896](median per-call time across 9 batches of 200 calls):Adds ~2.6% latency overhead on this shape from the fence.
Supplemental End-to-End Inference Validation
Internal TP2 inference test (weights/prompts omitted; public verification relies on the standalone GEMM test above).
Related work
1f78b85a1fb974cc69ea63e864d817c603688cab) does not yet include this fence.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.