[GH-ISSUE #23] how to deal with shapes like 7, 9 ? and how to deal with linears with bias ? #18

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

Originally created by @artetaout on GitHub (Feb 27, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/23

when input_len is 7, how to do ?
when forward a linear with bias, how to deal with it ?

Originally created by @artetaout on GitHub (Feb 27, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/23 when input_len is 7, how to do ? when forward a linear with bias, how to deal with it ?
Author
Owner

@LyricZhao commented on GitHub (Feb 28, 2025):

when input_len is 7, how to do ?

The normal GEMM natively supports M == 7, there is an issue in the test and now has been fixed in github.com/deepseek-ai/DeepGEMM@b69f630b91.

For grouped GEMM kernels, only masked layout supports such shapes.

when forward a linear with bias, how to deal with it ?

No bias support currently.

<!-- gh-comment-id:2689516379 --> @LyricZhao commented on GitHub (Feb 28, 2025): > when input_len is 7, how to do ? The normal GEMM natively supports `M == 7`, there is an issue in the test and now has been fixed in https://github.com/deepseek-ai/DeepGEMM/commit/b69f630b914c5c98f28f5ed8741d14e1952f2404. For grouped GEMM kernels, only masked layout supports such shapes. > when forward a linear with bias, how to deal with it ? No bias support currently.
Author
Owner

@Li-dongyang commented on GitHub (Feb 28, 2025):

Could you explain the rationale behind the bug fix @LyricZhao ? Is this related to the copy operations in the code? Thanks!

<!-- gh-comment-id:2689530389 --> @Li-dongyang commented on GitHub (Feb 28, 2025): Could you explain the rationale behind the bug fix @LyricZhao ? Is this related to the copy operations in the code? Thanks!
Author
Owner

@LyricZhao commented on GitHub (Feb 28, 2025):

Could you explain the rationale behind the bug fix @LyricZhao ? Is this related to the copy operations in the code? Thanks!

This is just related to an assertion assert lhs_scales.shape == (m, (k + 127) // 128). The previous utillity PyTorch function get_col_major_tma_aligned_tensor failed to make a proper shape after transposing for TMA alignment.

You can run the test using the commit before/after for comparison.

<!-- gh-comment-id:2689546155 --> @LyricZhao commented on GitHub (Feb 28, 2025): > Could you explain the rationale behind the bug fix @LyricZhao ? Is this related to the copy operations in the code? Thanks! This is just related to an assertion `assert lhs_scales.shape == (m, (k + 127) // 128)`. The previous utillity PyTorch function `get_col_major_tma_aligned_tensor` failed to make a proper shape after transposing for TMA alignment. You can run the test using the commit before/after for comparison.
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#18
No description provided.