[GH-ISSUE #33] No need to add epsilon 1e-20 in topk norm? #32

Closed
opened 2026-10-26 21:01:54 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @MARD1NO on GitHub (Mar 22, 2024).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-MoE/issues/33

I found deepseek MoE add a very small epsilon when normalize topk result: https://huggingface.co/deepseek-ai/deepseek-moe-16b-chat/blob/main/modeling_deepseek.py#L316

But in FP16/BF16 datatype, it cannot express the 1e-20, it will return as 0, so there is no need to add this epsilon?

Originally created by @MARD1NO on GitHub (Mar 22, 2024). Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-MoE/issues/33 I found deepseek MoE add a very small epsilon when normalize topk result: https://huggingface.co/deepseek-ai/deepseek-moe-16b-chat/blob/main/modeling_deepseek.py#L316 But in FP16/BF16 datatype, it cannot express the 1e-20, it will return as 0, so there is no need to add this epsilon?
Sign in to join this conversation.
No labels
pull-request
WIP
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/DeepSeek-MoE#32
No description provided.