[GH-ISSUE #161] Suspicious condition in is_block_size_legal #93

Closed
opened 2026-10-26 21:12:17 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @ankutalev on GitHub (Aug 14, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/161

Hello! Got this error trying to build DeepGEMM manually.

overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare]
   42 | if (((block_n > 128) && (kernel_type == KernelType::Kernel1D2D)) && ((block_n != 144) || (block_n != 160))) { 
      |                                                                      ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
heuristics/sm90.hpp:40:87: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare]
   40 | if (((block_n > 128) && (kernel_type == KernelType::Kernel1D1D)) && ((block_n != 136) || (block_n != 152))) 

The error valid - this part of condition always evaluates to True.
Perhaps it should be and, not or :

if (((block_n > 128) && (kernel_type == KernelType::Kernel1D1D)) && ((block_n != 136) && (block_n != 152))) 

The issue reproducible on current main https://github.com/deepseek-ai/DeepGEMM/blob/main/csrc/jit_kernels/heuristics/sm90.hpp#L39

I can make PR with fix if you wish

Originally created by @ankutalev on GitHub (Aug 14, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/161 Hello! Got this error trying to build DeepGEMM manually. ``` overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare] 42 | if (((block_n > 128) && (kernel_type == KernelType::Kernel1D2D)) && ((block_n != 144) || (block_n != 160))) { | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ heuristics/sm90.hpp:40:87: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare] 40 | if (((block_n > 128) && (kernel_type == KernelType::Kernel1D1D)) && ((block_n != 136) || (block_n != 152))) ``` The error valid - this part of condition always evaluates to True. Perhaps it should be and, not or : ``` if (((block_n > 128) && (kernel_type == KernelType::Kernel1D1D)) && ((block_n != 136) && (block_n != 152))) ``` The issue reproducible on current main https://github.com/deepseek-ai/DeepGEMM/blob/main/csrc/jit_kernels/heuristics/sm90.hpp#L39 I can make PR with fix if you wish
Author
Owner

@LyricZhao commented on GitHub (Aug 22, 2025):

Fixed in #164, thanks!

<!-- gh-comment-id:3213732844 --> @LyricZhao commented on GitHub (Aug 22, 2025): Fixed in #164, thanks!
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#93
No description provided.