[GH-ISSUE #210] [Feature] Support Bias #123

Open
opened 2026-10-26 21:13:03 +00:00 by bsakaguchi · 5 comments
Owner

Originally created by @complexfilter on GitHub (Oct 8, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/210

I was wondering if deepgemm can support bias computation. I think bias term is widely existing in linear layers.

Without bias support, we need to write dedicated kernels to perform sum operator. Compared with fused operator, extra time is needed to read and write the matrix.

Originally created by @complexfilter on GitHub (Oct 8, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/210 I was wondering if deepgemm can support bias computation. I think bias term is widely existing in linear layers. Without bias support, we need to write dedicated kernels to perform sum operator. Compared with fused operator, extra time is needed to read and write the matrix.
Author
Owner

@scuchenxiang commented on GitHub (Oct 19, 2025):

hi, @LyricZhao , I was wondering if deepgemm can support C = A*B+C in gemm, like the impl in wgemm.

<!-- gh-comment-id:3419506577 --> @scuchenxiang commented on GitHub (Oct 19, 2025): hi, @LyricZhao , I was wondering if deepgemm can support C = A*B+C in gemm, like the impl in wgemm.
Author
Owner

@LyricZhao commented on GitHub (Oct 20, 2025):

I was wondering if deepgemm can support C = A*B+C in gemm

Yes, we can do D = C + A @ B. But C should have the same shape with the output matrix (D). And inplace version is the fastest (C's ptr == D's ptr).

<!-- gh-comment-id:3420238614 --> @LyricZhao commented on GitHub (Oct 20, 2025): > I was wondering if deepgemm can support C = A*B+C in gemm Yes, we can do `D = C + A @ B`. But C should have the same shape with the output matrix (D). And inplace version is the fastest (C's ptr == D's ptr).
Author
Owner

@LyricZhao commented on GitHub (Oct 20, 2025):

For bias support, we don't have some plans, as we don't have such demand internally. Adding support may cost extra maintainence efforts. Maybe later.

<!-- gh-comment-id:3420239906 --> @LyricZhao commented on GitHub (Oct 20, 2025): For bias support, we don't have some plans, as we don't have such demand internally. Adding support may cost extra maintainence efforts. Maybe later.
Author
Owner

@scuchenxiang commented on GitHub (Oct 20, 2025):

I was wondering if deepgemm can support C = A*B+C in gemm

Yes, we can do D = C + A @ B. But C should have the same shape with the output matrix (D). And inplace version is the fastest (C's ptr == D's ptr).

Hi, @LyricZhao , I was also wondering is this feature likely to be released?

<!-- gh-comment-id:3420388254 --> @scuchenxiang commented on GitHub (Oct 20, 2025): > > I was wondering if deepgemm can support C = A*B+C in gemm > > Yes, we can do `D = C + A @ B`. But C should have the same shape with the output matrix (D). And inplace version is the fastest (C's ptr == D's ptr). Hi, @LyricZhao , I was also wondering is this feature likely to be released?
Author
Owner

@LyricZhao commented on GitHub (Oct 20, 2025):

D = C + A @ B is already included in main.

<!-- gh-comment-id:3420398092 --> @LyricZhao commented on GitHub (Oct 20, 2025): `D = C + A @ B` is already included in main.
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#123
No description provided.