[PR #327] fix: replace numeric_limits::infinity() with literal to fix CUDA 12.8 NVRTC compilation #368

Open
opened 2026-10-26 21:16:56 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/DeepGEMM/pull/327
Author: @kuishou68
Created: 5/5/2026
Status: 🔄 Open

Base: main ← Head: fix-cuda128-nvrtc-constexpr


📝 Commits (1)

  • f523804 fix: replace numeric_limits::infinity() with literal to fix CUDA 12.8 NVRTC compilation

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 deep_gemm/include/deep_gemm/impls/smxx_clean_logits.cuh (+2 -1)

📄 Description

Problem

On CUDA 12.8, NVRTC fails to compile smxx_clean_logits.cuh with:

error: expression must have a constant value
constexpr float neg_inf = -cute::numeric_limits<float>::infinity();

cuda::std::numeric_limits<T>::infinity() is not constexpr in CUDA 12.8 NVRTC environment.

Solution

Replace with raw float literal -1e38f, which is a true compile-time constant and mathematically equivalent to negative infinity for softmax masking purposes.

Testing

  • Fixes JIT compilation on CUDA 12.8 (H100)
  • Preserves numerical correctness for attention score masking
  • Compatible with both float32 and bfloat16 logits types

Closes #295


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/DeepGEMM/pull/327 **Author:** [@kuishou68](https://github.com/kuishou68) **Created:** 5/5/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-cuda128-nvrtc-constexpr` --- ### 📝 Commits (1) - [`f523804`](https://github.com/deepseek-ai/DeepGEMM/commit/f5238042ece0be7e14fd43d6a789775ea7b9a6ef) fix: replace numeric_limits::infinity() with literal to fix CUDA 12.8 NVRTC compilation ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `deep_gemm/include/deep_gemm/impls/smxx_clean_logits.cuh` (+2 -1) </details> ### 📄 Description ## Problem On CUDA 12.8, NVRTC fails to compile `smxx_clean_logits.cuh` with: ``` error: expression must have a constant value constexpr float neg_inf = -cute::numeric_limits<float>::infinity(); ``` `cuda::std::numeric_limits<T>::infinity()` is not `constexpr` in CUDA 12.8 NVRTC environment. ## Solution Replace with raw float literal `-1e38f`, which is a true compile-time constant and mathematically equivalent to negative infinity for softmax masking purposes. ## Testing - Fixes JIT compilation on CUDA 12.8 (H100) - Preserves numerical correctness for attention score masking - Compatible with both float32 and bfloat16 logits types Closes #295 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#368
No description provided.