Fix stale nsa.* imports in dsv4 compressor#29526
Open
a-m-n-s wants to merge 1 commit into
Open
Conversation
These came back via sgl-project#26208 after the NSA→DSA rename and only resolve through the deprecation shims. Point them at dsa.* directly. No behavior change.
Contributor
There was a problem hiding this comment.
Code Review
This pull request cleans up and updates imports in the DeepSeek-V4 attention layers. Specifically, it removes an unused import of rotate_activation from the nsa module in compress_hip.py, and updates compressor_v2.py to import rotate_activation and act_quant from the dsa module instead of the nsa module. There are no review comments, and we have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
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.
Hi, I'm a new contributor looking for small things to get familiar with the codebase, and found this while going through the DeepSeek V4 roadmap (#23602) — most of it is already implemented, so I picked up a small cleanup.
Motivation
The NSA→DSA rename (#25821) moved
layers/attention/nsa/→dsa/and leftnsa/as deprecation shims. #26208 landed afterwards (likely rebased over the rename) and brought back a few oldattention.nsa.*imports in the dsv4 compressor. They still work via the shims but emit aDeprecationWarningon every import, so this points them atdsa.*directly.Modifications
compressor_v2.py:nsa.nsa_indexer→dsa.dsa_indexer,nsa.triton_kernel→dsa.triton_kernelcompress_hip.py: dropped thensa.nsa_indexerline — it was a duplicate,rotate_activationis already imported fromdsaright above it.No behavior change — the shims re-export the same symbols. Left
hip_flash_mla.pyalone since itsnsa.triton_decodeimport points at real code that hasn't been moved todsa/yet (separate PR).cc @ch-wan
Accuracy Tests
N/A — pure import-path change, no kernel or model forward code touched.
Speed Tests and Profiling
N/A — no impact on inference speed.
Checklist