Skip to content

Add TMA optimization hint for large FFMA segments - #48

Closed
A-transformer wants to merge 1 commit into
deepseek-ai:mainfrom
A-transformer:add_TMA_optimization_hint
Closed

A-transformer wants to merge 1 commit into
deepseek-ai:mainfrom
A-transformer:add_TMA_optimization_hint

Conversation

@A-transformer

Copy link
Copy Markdown
Contributor

This check is added to identify segments with a high number of FFMA (Fused Multiply-Add) instructions, which may benefit from Tensor Memory Accelerator (TMA) optimizations on NVIDIA Hopper architecture. TMA enables asynchronous data transfers from global memory to shared memory, reducing register pressure and improving data access efficiency. Segments with a large number of FFMA instructions often involve significant data movement, making them prime candidates for TMA to accelerate memory operations and enhance overall GEMM performance.

This check is added to identify segments with a high number of FFMA (Fused Multiply-Add) instructions, which may benefit from Tensor Memory Accelerator (TMA) optimizations on NVIDIA Hopper architecture. TMA enables asynchronous data transfers from global memory to shared memory, reducing register pressure and improving data access efficiency. Segments with a large number of FFMA instructions often involve significant data movement, making them prime candidates for TMA to accelerate memory operations and enhance overall GEMM performance.
LyricZhao added a commit that referenced this pull request Apr 16, 2026
* add CUDA implementation for get_mn_major_tma_aligned_tensor

* add transpose test

* Refactor for the CPP part

* Fix shared memory size

* Fix all tests

* Minor fix

---------

Co-authored-by: Chenggang Zhao <[email protected]>
qiushixiaoyu pushed a commit to qiushixiaoyu/DeepGEMM that referenced this pull request Jun 30, 2026
leavelet pushed a commit to leavelet/DeepGEMM that referenced this pull request Jul 14, 2026
qiushixiaoyu added a commit to qiushixiaoyu/DeepGEMM that referenced this pull request Sep 4, 2026
SystemPanic pushed a commit to SystemPanic/DeepGEMM-windows that referenced this pull request Nov 18, 2026
…deepseek-ai#48)

A CUDA graph kernel node keeps the same %gridid on every replay. The
mega_mhc split barriers tag each execution with %gridid, so after a replay
a barrier line still holds encode_state(grid_idx, kNumSplits), which is
exactly the state the next replay waits for. A Mix or Norm waiter whose
m-block init CTA has not started yet proceeds immediately and reads the
previous replay's split partials.

Tag executions with an epoch instead. The epoch and an exit count live in
the unused tail of the first barrier line, so the host-side buffer is
unchanged. Every CTA reads the epoch after cudaGridDependencySynchronize,
and the last CTA to retire resets the exit count and advances the epoch.


(cherry picked from commit 5081f85)

Co-authored-by: LightSeek Foundation <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants