fix: remove unnecessary char casts for aarch64 compatibility#130
Open
yurekami wants to merge 2 commits intodeepseek-ai:mainfrom
Open
fix: remove unnecessary char casts for aarch64 compatibility#130yurekami wants to merge 2 commits intodeepseek-ai:mainfrom
yurekami wants to merge 2 commits intodeepseek-ai:mainfrom
Conversation
Add support for the old parameter name `num_heads_per_head_k` as a deprecated alias for `num_q_tokens_per_head_k` in `get_mla_metadata()`. This maintains backwards compatibility for existing code that uses the old parameter name, while emitting a deprecation warning to encourage migration to the new name. Changes: - Add `num_heads_per_head_k` as keyword-only deprecated parameter - Emit DeprecationWarning when deprecated name is used - Raise clear error if both old and new names are specified - Use sentinel value to properly detect unset required parameters - Preserve positional argument compatibility Fixes deepseek-ai#108 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove explicit (char) casts from CUDAGuard device index parameters. These casts caused narrowing conversion warnings on aarch64 where char is unsigned by default, conflicting with the signed c10::DeviceIndex return type of get_device(). The casts were unnecessary since at::cuda::CUDAGuard accepts c10::DeviceIndex directly, which is the return type of get_device(). Fixes deepseek-ai#93 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes Issue #93 by removing unnecessary
(char)casts fromCUDAGuarddevice index parameters that caused compilation warnings on aarch64 architecture.Problem
On aarch64,
charis unsigned by default, whilec10::DeviceIndex(the return type ofget_device()) isint8_t(signed). This mismatch caused narrowing conversion warnings:Solution
Remove the explicit
(char)casts since they were unnecessary -at::cuda::CUDAGuardacceptsc10::DeviceIndexdirectly, which is exactly whatget_device()returns.Changes
(char)seqlens_k.get_device()seqlens_k.get_device()(char)q.get_device()q.get_device()(char)q.get_device()q.get_device()Benefits
Test plan
Fixes #93
🤖 Generated with Claude Code