[GH-ISSUE #124] [QST]Some questions about unit testing #72

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

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

I'm reading the unit test code. I have two doubts.

  1. What is the role of clamp here? github.com/deepseek-ai/DeepGEMM@03d0be3d2d/tests/test_core.py (L21)
  2. Why is calc_diff used here? Why not Allclose? And what is the principle of calc_diff? github.com/deepseek-ai/DeepGEMM@03d0be3d2d/tests/test_core.py (L176)
    Looking forward to your reply.
Originally created by @HydraQYH on GitHub (Jul 7, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/124 I'm reading the unit test code. I have two doubts. 1. What is the role of clamp here? https://github.com/deepseek-ai/DeepGEMM/blob/03d0be3d2d03b6eed3c99d683c0620949a13a826/tests/test_core.py#L21 2. Why is calc_diff used here? Why not Allclose? And what is the principle of calc_diff? https://github.com/deepseek-ai/DeepGEMM/blob/03d0be3d2d03b6eed3c99d683c0620949a13a826/tests/test_core.py#L176 Looking forward to your reply.
Author
Owner

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

Sorry for my late reply. This is an internal quant error metric at DeepSeek. The best part of the metric is that the similarity is consistent for any scale of values. You can also use other methods, e.g. MSE.

<!-- gh-comment-id:3094996525 --> @LyricZhao commented on GitHub (Jul 21, 2025): Sorry for my late reply. This is an internal quant error metric at DeepSeek. The best part of the metric is that the similarity is consistent for any scale of values. You can also use other methods, e.g. MSE.
Author
Owner

@HydraQYH commented on GitHub (Jul 22, 2025):

Thanks a lot.

<!-- gh-comment-id:3103048194 --> @HydraQYH commented on GitHub (Jul 22, 2025): Thanks a lot.
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#72
No description provided.