segKI: `install_decode_attention` patches non-gated q/k-norm attention (dense Qwen3)
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 18/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- machine-learning
Línea de trabajo
Start in install_decode_attention, where the gated [q|gate] check compares q_proj.out_features against head_dim, and compare it with find_glu_segments. The failing test is TestArenaWeightViews::test_glu_only_model_refresh_clears_backend_cat_cache, and _decode_attn_forward assumes Qwen3.5 semantics. Linked PR #9165 is already open against this issue, so check it before starting.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
TestArenaWeightViews::test_glu_only_model_refresh_clears_backend_cat_cache fails on master (039bfc9f3) with AttributeError: 'Qwen3RMSNorm' object has no attribute 'eps'. Earlier PR comments (#9077, #9079, #9127) attributed this to a Transformers API change. That is not the cause: it fails the same way on Transformers 5.17.0.
Root cause
install_decode_attention treats a layer as the gated [q|gate] layout when q_proj.out_features is divisible by 2 * head_dim. Dense Qwen3-0.6B has 16 heads × 128 = 2048 = 2 × 8 × 128, so it passes and is patched as 8 gated heads with a (1+w) q/k norm. It then reaches self.q_norm.eps, but Qwen3RMSNorm stores variance_epsilon. Without that crash the output would be wrong anyway, because the head count, the gate split and the norm scale all differ.
In Transformers 5.17, about 40 attention classes have per-head q_norm/k_norm: Qwen3/MoE/VL, Gemma3/4, GLM4-MoE, OLMo2/3, MiniMax-M2, Exaone4, and others. Any of them with an even head count passes the current check. Only qwen3_5, qwen3_5_moe, qwen3_next and qwen4_exp actually use the gated layout.
Proposed fix
Also require q_proj.out_features == 2 * o_proj.in_features. In the gated layout, o_proj consumes only the attention half; in plain attention the two are equal. Both are per-rank under AutoTP, so the ratio holds there too. With Transformers 5.17 this selects exactly the four gated families above. The check only excludes layers, so currently supported models are unaffected. Locally the segKI kernel suite passes (28/28 on L20), and a CPU test covers both the gated and the dense case.
Question
This is still a structural check. A future model with a 2×-wide q_proj but different semantics (plain w norm, a different gate split) would pass it, while _decode_attn_forward already assumes Qwen3.5 semantics (it imports apply_rotary_pos_emb from qwen3_5). Would you prefer:
- the structural check above, consistent with
find_glu_segments; or - additionally an explicit allowlist (attention class or
config.model_type)?
@delock happy to send the PR either way.
- Lenguaje dominante
- Python
- Estrellas
- 43.3k
- Forks
- 5.1k
- Merge medio
- 5 d 10 h
- PR fusionados (30 d)
- 85
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de deepspeedai/DeepSpeed
-
[Bug] DeepSpeedEngine.step leaves _running_engine_step=True permanently on exception, corrupting is_gradient_accumulation_boundary()Posiblemente ocupada @its-amann la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
deepspeedai/DeepSpeed#9190 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
[Bug] PipelineEngine._exec_reduce_grads and _exec_optimizer_step leave _force_grad_boundary=True permanently after any exceptionPosiblemente ocupada @bantianyue la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
deepspeedai/DeepSpeed#9183 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
deepspeedai/DeepSpeed#9019 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
fp16 `hysteresis: 0` (or negative) makes DynamicLossScaler never lower the loss scale, so every overflowing step is skipped foreverPosiblemente ocupada @damienen la tomó hace 26 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
deepspeedai/DeepSpeed#8982 ·
Los mantenedores suelen responder en 2 días
-
[BUG] OneCycle applies the minimum momentum to the first Adam updatePosiblemente ocupada @ai-yang la tomó hace 30 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
deepspeedai/DeepSpeed#8951 ·
Los mantenedores suelen responder en 2 días
Todos los issues de deepspeedai/DeepSpeed
Issues similares
-
area/auth comp/agent P3 type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
NousResearch/hermes-agent#161417 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Dao-AILab/flash-attention#3251 ·
Los mantenedores suelen responder en 2 días
-
[New Check]: sqlserver_public_network_access_disabledPosiblemente ocupada @pouria-l la tomó hoy. Abiertofeature-request status/needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
prowler-cloud/prowler#13607 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
external langchain
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
langchain-ai/docs#8184 ·
Los mantenedores suelen responder en 1 día