Skip to content

Fix stale nsa.* imports in dsv4 compressor#29526

Open
a-m-n-s wants to merge 1 commit into
sgl-project:mainfrom
a-m-n-s:fix-dsv4-stale-nsa-imports
Open

Fix stale nsa.* imports in dsv4 compressor#29526
a-m-n-s wants to merge 1 commit into
sgl-project:mainfrom
a-m-n-s:fix-dsv4-stale-nsa-imports

Conversation

@a-m-n-s

@a-m-n-s a-m-n-s commented Jun 27, 2026

Copy link
Copy Markdown

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 left nsa/ as deprecation shims. #26208 landed afterwards (likely rebased over the rename) and brought back a few old attention.nsa.* imports in the dsv4 compressor. They still work via the shims but emit a DeprecationWarning on every import, so this points them at dsa.* directly.

Modifications

  • compressor_v2.py: nsa.nsa_indexerdsa.dsa_indexer, nsa.triton_kerneldsa.triton_kernel
  • compress_hip.py: dropped the nsa.nsa_indexer line — it was a duplicate, rotate_activation is already imported from dsa right above it.

No behavior change — the shims re-export the same symbols. Left hip_flash_mla.py alone since its nsa.triton_decode import points at real code that hasn't been moved to dsa/ 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

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@a-m-n-s a-m-n-s marked this pull request as ready for review June 27, 2026 18:09
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