Repository navigation
Conversation
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. 🤖 How to trigger CI
Note Until the CI gate has run on a commit, the required Tip 💡 Consider Linking a Related Issue or RFCYour PR title contains the [Feature] tag, indicating a bug fix or new feature. Linking a related issue or RFC in the PR description is strongly encouraged — it gives reviewers helpful context and speeds up the review. You can use any of these keywords:
🙏 Thanks for helping us keep the project well-organized! |
There was a problem hiding this comment.
Code Review
This pull request introduces support for native hybrid SFA HiSparse layout planning and recurrent state grouping on Ascend NPUs, including documentation for Kimi K3.1 on 950DT, platform checks requiring Model Runner V2, and extensive unit tests. The review feedback suggests defensively accessing attention_config and mamba_page_size_padded via getattr in vllm_ascend/worker/v2/attn_utils.py to prevent potential AttributeError exceptions across different vLLM versions.
| kv_cache_spec: dict[str, KVCacheSpec] = {} | ||
| attention_layer_names: list[str] = [] | ||
| mamba_specs: dict[str, MambaSpec] = {} | ||
| hisparse_enabled = vllm_config.attention_config.hisparse_config is not None |
There was a problem hiding this comment.
Directly accessing vllm_config.attention_config.hisparse_config can raise an AttributeError if attention_config is None or if hisparse_config is not defined on the AttentionConfig class (which can happen depending on the vLLM version or configuration).
Using getattr defensively is safer and aligns with how hisparse_config is accessed in other parts of the codebase (e.g., in vllm_ascend/platform.py and vllm_ascend/hisparse/layout.py).
| hisparse_enabled = vllm_config.attention_config.hisparse_config is not None | |
| attention_config = getattr(vllm_config, "attention_config", None) | |
| hisparse_enabled = getattr(attention_config, "hisparse_config", None) is not None |
| page_size_padded=None, | ||
| ) | ||
| specs = resolve_hisparse_specs(vllm_config, kv_cache_spec, attn_layers) | ||
| state_padding = vllm_config.cache_config.mamba_page_size_padded |
There was a problem hiding this comment.
Directly accessing vllm_config.cache_config.mamba_page_size_padded can raise an AttributeError if mamba_page_size_padded is not defined on the CacheConfig class in the current vLLM version.
Using getattr defensively is safer and prevents potential runtime crashes.
| state_padding = vllm_config.cache_config.mamba_page_size_padded | |
| state_padding = getattr(vllm_config.cache_config, "mamba_page_size_padded", None) |
Coverage
More info see: Summary |
Recipe previewCurrent PR commit: This PR no longer has the |
58ee63c to
4211e85
Compare
Plan native Indexer and KDA state groups for the HiSparse layout and bind raw KDA pages in Model Runner V2. Preserve paired SFA planning with HiSparse disabled and cover missing Worker configuration fields. Validated with 32 focused CPU cases on each pinned upstream vLLM revision. Signed-off-by: TheWang <91782251+wang6788@users.noreply.github.com>
4211e85 to
146b0a5
Compare
What this PR does / why we need it?
Enable HiSparse for Kimi K3.1's hybrid DSA and KDA cache layout with
Model Runner V2 on Ascend A3 and A5.
Ascend Indexer page. Keep the paired SFA path for HiSparse OFF.
device memory estimate. Reuse upstream vLLM's HiSparse allocation and
request lifecycle.
existing MRV2 layer binder. Apply the C8 page alignment required by the
shared Resident and Hot allocation.
Ascend HiSparse foundation · Upstream Kimi K3.1 HiSparse planning
How was this patch tested?
Checklist
A3 INT8 C8 serving and Host refill verified on the PR revision.
A5 FP8 C8 serving and Host refill verified on the PR revision.
Matched ON/OFF accuracy and capacity results recorded.
Supported combinations of HiSparse with other features verified.
Full CI passed on the PR revision.
vLLM main: vllm-project/vllm@c410543