🚀 The feature, motivation and pitch
Environment
- UCM Version: v0.5.0rc2 (develop branch)
- vLLM Version: Tested with 0.11.0 and 0.18.1
- GPU: 1× NVIDIA RTX A6000 (48GB)
- Model: Qwen/Qwen2.5-14B-Instruct-1M
- OS: Ubuntu (Docker container)
Background
We are deploying Qwen2.5-14B-Instruct-1M with UCM for production use. The model ships with a sparse_attention_config.json that enables Qwen's Dual Chunk Attention (DCA) for extended context windows.
Currently, we have the model working at 32K context with UCM prefix caching enabled, which works well. However, we would like to leverage the model's designed 1M context capability.
What We Tried
1. vLLM 0.18.1 + UCM v0.5.0rc2
- UCM patches load successfully (
pc_patch only, no sparse_patch for v0180)
- With
sparse_attention_config.json present: FlashAttentionImpl.__init__() got an unexpected keyword argument 'layer_idx'
- Without
sparse_attention_config.json: works at 32K, but no sparse attention → limited by GPU memory
2. vLLM 0.11.0 + UCM v0.5.0rc2 (ENABLE_SPARSE=1)
- UCM patches load successfully (
pc_patch + sparse_patch both applied ✅)
- Same error:
FlashAttentionImpl.__init__() got an unexpected keyword argument 'layer_idx'
- The
layer_idx parameter is passed by vLLM's Qwen2Attention code regardless of sparse config
- UCM's
sparse_patch does not patch FlashAttentionImpl.__init__ to accept layer_idx
3. Qwen's custom vLLM branch
- Supports DCA natively but is incompatible with UCM's KVConnector interface
Questions
-
Does UCM's GSA (Generalized Sparse Attention) work with Qwen2.5-14B-Instruct-1M? The sparse_patch loads but FlashAttentionImpl rejects the layer_idx kwarg.
-
Is there a recommended way to use UCM with long-context models (>32K)? We understand that KV cache memory is the bottleneck on single-GPU setups, but even with multi-GPU, what's the recommended configuration?
-
Will UCM v0.18.0 patches include sparse attention support? Currently v0180/ only has pc_patch, while v0110/ has both pc_patch and sparse_patch.
-
Is there a compatibility matrix for UCM sparse + specific models? We'd like to know which models have been validated with UCM's GSA.
Relevant Code References
UCM apply_patch.py (v0.5.0rc2)
# v0180 only has pc_patch, no sparse_patch
case "0.18.0":
import ucm.integration.vllm.patch.v0180.vllm.pc_patch
# No sparse_patch available
# v0110 has both
case "0.11.0":
import ucm.integration.vllm.patch.v0110.vllm.pc_patch
if ENABLE_SPARSE:
import ucm.integration.vllm.patch.v0110.vllm.sparse_patch
Error Stack Trace (both vLLM 0.11.0 and 0.18.1)
File ".../vllm/model_executor/models/qwen2.py", line 165, in __init__
self.attn = attn_cls(
File ".../vllm/attention/layer.py", line 198, in __init__
self.impl = impl_cls(num_heads, head_size, scale, num_kv_heads, ...
TypeError: FlashAttentionImpl.__init__() got an unexpected keyword argument 'layer_idx'
Current Workaround
- Remove/rename
sparse_attention_config.json from model directory
- Add
**kwargs to FlashAttentionImpl.__init__() (monkey-patch)
- Use
--max-model-len 32768 (limited by single A6000 48GB)
- UCM prefix caching works well at 32K
Expected Behavior
UCM's sparse attention patches should either:
- Handle the
layer_idx parameter in FlashAttentionImpl, or
- Provide documentation on compatible models/configurations for extended context
Thank you for your work on UCM! Happy to provide more details or test patches.
Alternatives
No response
Additional context
No response
🚀 The feature, motivation and pitch
Environment
Background
We are deploying Qwen2.5-14B-Instruct-1M with UCM for production use. The model ships with a
sparse_attention_config.jsonthat enables Qwen's Dual Chunk Attention (DCA) for extended context windows.Currently, we have the model working at 32K context with UCM prefix caching enabled, which works well. However, we would like to leverage the model's designed 1M context capability.
What We Tried
1. vLLM 0.18.1 + UCM v0.5.0rc2
pc_patchonly, nosparse_patchfor v0180)sparse_attention_config.jsonpresent:FlashAttentionImpl.__init__() got an unexpected keyword argument 'layer_idx'sparse_attention_config.json: works at 32K, but no sparse attention → limited by GPU memory2. vLLM 0.11.0 + UCM v0.5.0rc2 (ENABLE_SPARSE=1)
pc_patch+sparse_patchboth applied ✅)FlashAttentionImpl.__init__() got an unexpected keyword argument 'layer_idx'layer_idxparameter is passed by vLLM's Qwen2Attention code regardless of sparse configsparse_patchdoes not patchFlashAttentionImpl.__init__to acceptlayer_idx3. Qwen's custom vLLM branch
Questions
Does UCM's GSA (Generalized Sparse Attention) work with Qwen2.5-14B-Instruct-1M? The
sparse_patchloads butFlashAttentionImplrejects thelayer_idxkwarg.Is there a recommended way to use UCM with long-context models (>32K)? We understand that KV cache memory is the bottleneck on single-GPU setups, but even with multi-GPU, what's the recommended configuration?
Will UCM v0.18.0 patches include sparse attention support? Currently
v0180/only haspc_patch, whilev0110/has bothpc_patchandsparse_patch.Is there a compatibility matrix for UCM sparse + specific models? We'd like to know which models have been validated with UCM's GSA.
Relevant Code References
UCM apply_patch.py (v0.5.0rc2)
Error Stack Trace (both vLLM 0.11.0 and 0.18.1)
Current Workaround
sparse_attention_config.jsonfrom model directory**kwargstoFlashAttentionImpl.__init__()(monkey-patch)--max-model-len 32768(limited by single A6000 48GB)Expected Behavior
UCM's sparse attention patches should either:
layer_idxparameter inFlashAttentionImpl, orThank you for your work on UCM! Happy to provide more details or test patches.
Alternatives
No response
Additional context
No response