[GH-ISSUE #145] Question about restriction on BLK_N on SM100 when type is 1d2d #82

Closed
opened 2026-10-26 21:12:06 +00:00 by bsakaguchi · 3 comments
Owner

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

        // 1D2D kernels' maximum block N is 128
        // 1D2D kernels require more friendly block Ns
        if (kernel_type == KernelType::Kernel1D2D and (block_n > 128 or 128 % block_n != 0))
            return false;

Based on the above functions, the restriction on block_n is more strict on sm100 when type is 1d2d, where BLK_N cannot span across two 128x128 blocks, but there's no such restriction on sm90. Since sm90 has already been optimized to allow the compiler to statically deduce predicates, reducing register usage and corresponding sel instructions, why is this restriction added on sm100? Thanks!
2. Another question is why BLK_N does not use 192 in the sm90 kernel. This shape also meets the requirement of 'At most 2 scales in the N direction'.

Originally created by @pengwubj on GitHub (Jul 30, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/145 1. ```c++ // 1D2D kernels' maximum block N is 128 // 1D2D kernels require more friendly block Ns if (kernel_type == KernelType::Kernel1D2D and (block_n > 128 or 128 % block_n != 0)) return false; ``` Based on the above functions, the restriction on block_n is more strict on sm100 when type is 1d2d, where BLK_N cannot span across two 128x128 blocks, but there's no such restriction on sm90. Since sm90 has already been optimized to allow the compiler to statically deduce predicates, reducing register usage and corresponding sel instructions, why is this restriction added on sm100? Thanks! 2. Another question is why BLK_N does not use 192 in the sm90 kernel. This shape also meets the requirement of 'At most 2 scales in the N direction'.
Author
Owner

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

  1. cc @RayWang96
  2. 192 may lead to insufficient registers (maybe sufficient but requires BLOCK_M <= 128). We have already implemented another way of larger block sizes (supporting BLOCK_M == 256).
<!-- gh-comment-id:3135271097 --> @LyricZhao commented on GitHub (Jul 30, 2025): 1. cc @RayWang96 2. 192 may lead to insufficient registers (maybe sufficient but requires `BLOCK_M <= 128`). We have already implemented another way of larger block sizes (supporting `BLOCK_M == 256`).
Author
Owner

@RayWang96 commented on GitHub (Jul 30, 2025):

First of all, the Blackwell 1D2D kernel was implemented as a workaround to maintain compatibility with the old recipe, so it hasn’t been deeply optimized. These constraints were chosen because our tests showed the best performance under the above limits. If you remove the assert, the code should still run.

<!-- gh-comment-id:3135308609 --> @RayWang96 commented on GitHub (Jul 30, 2025): First of all, the Blackwell 1D2D kernel was implemented as a workaround to maintain compatibility with the old recipe, so it hasn’t been deeply optimized. These constraints were chosen because our tests showed the best performance under the above limits. If you remove the assert, the code should still run.
Author
Owner

@pengwubj commented on GitHub (Jul 31, 2025):

Thanks for quick reply.

<!-- gh-comment-id:3138790380 --> @pengwubj commented on GitHub (Jul 31, 2025): Thanks for quick reply.
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#82
No description provided.