[GH-ISSUE #101] About optimizations to the Cast operator #57

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

Originally created by @NiuMa-1234 on GitHub (May 16, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/101

Thank you for your marvelous work! I've found that the fp8 cast operator for inputmats and weights takes much longer time than GEMM and has become the major time-consuming block in Linear compared with original bf16 linear. And I'm wondering if you have a similar observation and have leveraged some skills (e.g. operator fusion) to mitigate this. Many thanks for your reply!

Originally created by @NiuMa-1234 on GitHub (May 16, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/101 Thank you for your marvelous work! I've found that the fp8 cast operator for inputmats and weights takes much longer time than GEMM and has become the major time-consuming block in Linear compared with original bf16 linear. And I'm wondering if you have a similar observation and have leveraged some skills (e.g. operator fusion) to mitigate this. Many thanks for your reply!
Author
Owner

@LyricZhao commented on GitHub (May 16, 2025):

We have a kernel library at DeepSeek, which fuses all the staff. We plan to open-source it months later.

<!-- gh-comment-id:2886035078 --> @LyricZhao commented on GitHub (May 16, 2025): We have a kernel library at DeepSeek, which fuses all the staff. We plan to open-source it months later.
Author
Owner

@NiuMa-1234 commented on GitHub (May 16, 2025):

So, the operator fusion strategy could work, right? Could you please disclose more hints about the library?

<!-- gh-comment-id:2886059557 --> @NiuMa-1234 commented on GitHub (May 16, 2025): So, the operator fusion strategy could work, right? Could you please disclose more hints about the library?
Author
Owner

@LyricZhao commented on GitHub (May 16, 2025):

the operator fusion strategy could work, right?

Yes, the overhead is small, most of the time are running GEMMs.

Could you please disclose more hints about the library?

For a certain workflow, you just fuse everything before the GEMM, and that is our library.

<!-- gh-comment-id:2886230842 --> @LyricZhao commented on GitHub (May 16, 2025): > the operator fusion strategy could work, right? Yes, the overhead is small, most of the time are running GEMMs. > Could you please disclose more hints about the library? For a certain workflow, you just fuse everything before the GEMM, and that is our library.
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#57
No description provided.