Skip to content

fix: use c10::DeviceIndex instead of char for CUDAGuard on aarch64#127

Open
yurekami wants to merge 2 commits intodeepseek-ai:mainfrom
yurekami:fix/char-datatype-aarch64
Open

fix: use c10::DeviceIndex instead of char for CUDAGuard on aarch64#127
yurekami wants to merge 2 commits intodeepseek-ai:mainfrom
yurekami:fix/char-datatype-aarch64

Conversation

@yurekami
Copy link

Summary

  • Replace (char) casts with static_cast<c10::DeviceIndex>() in CUDAGuard calls
  • Fixes narrowing conversion warning on aarch64 where char is unsigned by default
  • c10::DeviceIndex is signed char, causing -Wnarrowing warnings when using char on ARM

Changes

  • csrc/pybind.cpp lines 153, 263, 422: Use static_cast<c10::DeviceIndex>() instead of (char)

Test plan

  • Build on aarch64 platform to verify no more narrowing conversion warnings
  • Existing tests should continue to pass on x86 and aarch64

Fixes #93

🤖 Generated with Claude Code

yurekami and others added 2 commits December 25, 2025 22:06
On aarch64, char is unsigned by default, while c10::DeviceIndex is
defined as signed char. This causes narrowing conversion warnings
when building on ARM platforms (e.g., during vllm build).

Replace (char) casts with static_cast<c10::DeviceIndex>() for proper
cross-platform compatibility.

Fixes deepseek-ai#93

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix spelling error in SM100 Dense MLA error messages.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Char datatype assumption

1 participant