[GH-ISSUE #126] TMA selection of get_best_configs in gemm.py #73

Open
opened 2026-10-26 21:11:56 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @joyeamd on GitHub (Jul 10, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/126

for i in ('A', 'B') if best_block_m > best_block_n else ('B', 'A'):
        if m >= 512 and is_multicast_legal[i]:
            best_tma_multicast_config = (2, i == 'A')
            break

when best_block_m <= best_block_n, I think need to use n instead of m to choose. Need to change to below:

    for i in ('A', 'B') if best_block_m > best_block_n else ('B', 'A'):
        dim_size = m if best_block_m > best_block_n else n
        if dim_size >= 512 and is_multicast_legal[i]:
            best_tma_multicast_config = (2, i == 'A')
            break

Originally created by @joyeamd on GitHub (Jul 10, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/126 ``` for i in ('A', 'B') if best_block_m > best_block_n else ('B', 'A'): if m >= 512 and is_multicast_legal[i]: best_tma_multicast_config = (2, i == 'A') break ``` when best_block_m <= best_block_n, I think need to use n instead of m to choose. Need to change to below: ``` for i in ('A', 'B') if best_block_m > best_block_n else ('B', 'A'): dim_size = m if best_block_m > best_block_n else n if dim_size >= 512 and is_multicast_legal[i]: best_tma_multicast_config = (2, i == 'A') break ```
Author
Owner

@LyricZhao commented on GitHub (Jul 21, 2025):

Sorry for my later reply. m >= 512 is just a heuristic (tested but not theoretical). For now, I am not sure whether your change can bring a speedup. If you test and verify its better performance, a PR is welcome!

<!-- gh-comment-id:3095016401 --> @LyricZhao commented on GitHub (Jul 21, 2025): Sorry for my later reply. `m >= 512` is just a heuristic (tested but not theoretical). For now, I am not sure whether your change can bring a speedup. If you test and verify its better performance, a PR is welcome!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepGEMM#73
No description provided.