Skip to content

Fix duplicate macro definition and incorrect error message#163

Open
hobostay wants to merge 1 commit intodeepseek-ai:mainfrom
hobostay:fix/duplicate-macro-and-error-message
Open

Fix duplicate macro definition and incorrect error message#163
hobostay wants to merge 1 commit intodeepseek-ai:mainfrom
hobostay:fix/duplicate-macro-and-error-message

Conversation

@hobostay
Copy link

@hobostay hobostay commented Feb 9, 2026

Summary

This PR fixes two code quality issues in the FlashMLA codebase:

  1. Remove duplicate TRAP_ONLY_DEVICE_ASSERT macro definition in csrc/utils.h

    • The macro was defined twice with identical content (lines 41-47 and 49-55)
    • While the second definition was effectively skipped due to the #ifndef guard, this is redundant code that should be cleaned up
  2. Fix incorrect error message in csrc/api/dense_decode.h (line 61)

    • The error message incorrectly stated "Only head_size_v == 576 is supported"
    • The actual condition checks for head_size_v == 512
    • This caused misleading error output when the check failed

Changes

  • csrc/utils.h: Removed the duplicate TRAP_ONLY_DEVICE_ASSERT macro definition
  • csrc/api/dense_decode.h: Fixed error message to correctly reflect the validated value

Test plan

  • These are straightforward code quality fixes with no behavioral changes
  • The duplicate macro removal does not affect functionality (both definitions were identical)
  • The error message fix improves user experience by providing accurate information

🤖 Generated with Claude Code

- Remove duplicate TRAP_ONLY_DEVICE_ASSERT macro definition in csrc/utils.h
  The macro was defined twice with identical content (lines 41-47 and 49-55)

- Fix incorrect error message in csrc/api/dense_decode.h (line 61)
  The error message said "Only head_size_v == 576 is supported" but the
  condition checks for head_size_v == 512, causing misleading error output

Co-Authored-By: Claude Sonnet 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.

1 participant