[Feature] Avoid gathering full vocabulary logits for plain greedy TP decoding
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 49/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- machine-learning, performance
Línea de trabajo
Start by reading ParallelLMHead and the decode sampling path to find where the model agent passes sampling decisions to the LM head. Check how tensor-parallel ranks coordinate selection and how existing tests cover greedy decoding, logits, and processors. Done means the fast path is limited to eligible plain greedy decode requests, produces the same token IDs across the TP group, and has serving latency measurements against the current path.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Motivation
On a four-GPU PCIe machine I noticed that DeepSeek's ParallelLMHead gathers the entire vocabulary on every rank even when the request only needs a greedy token ID. With DeepSeek-V2-Lite and 32 decoding rows, that materializes 6.25 MiB of BF16 logits per rank before sampling. Each rank already has enough information to choose its best local token.
I tried a small prototype on LMDeploy main at 4a8bdbc0. Each rank finds its local max, exchanges one (score, global token ID) pair per row, and picks the winning rank. Rank order breaks ties the same way as argmax on the concatenated vocabulary. I kept the existing broadcast of the leader's token in both measurements.
What I measured
Four RTX 5090s on one host, no CUDA peer access between these four devices, PyTorch 2.8.0+cu128, NCCL. I loaded the published BF16 lm_head.weight from deepseek-ai/DeepSeek-V2-Lite (102400 × 2048) into LMDeploy's actual ParallelLMHead. Inputs were seeded hidden states. Two fresh four-rank launches gave these median times for projection, selection and broadcast:
| Decode rows | Current path | Local max + gather pairs |
|---|---|---|
| 2 | 0.512–0.517 ms | 0.325–0.512 ms |
| 8 | 1.186–1.273 ms | 0.389–0.520 ms |
| 32 | 2.169–2.801 ms | 0.504–0.518 ms |
Each launch checked 504 selected IDs across batch sizes 1, 2, 4, 8, 16 and 32. All matched. The machine had other workloads, and small batches were noisy. In an earlier collective-only measurement with a 152064-token vocabulary, the prototype was slower at batch 1. These are output-layer measurements. I haven't measured serving throughput or TPOT yet.
Proposed scope
Would you be open to a decode-only fast path for larger batches using ParallelLMHead and plain greedy selection? I'd start with ordinary autoregressive decoding, leaving requests that need logits, logprobs, constraints, token masking or custom processors on the current path. The choice would need to be identical across the TP group. Models with a replicated output head wouldn't use it.
I can work on the integration and compare generated IDs and serving latency. Is there a preferred place for the model agent to pass that sampling decision to the LM head? I found #4915, which improves the full gather on supported hardware; this proposal reduces the amount gathered for this specific sampling case.
- Lenguaje dominante
- Python
- Estrellas
- 8.2k
- Forks
- 797
- Merge medio
- 3 d 15 h
- PR fusionados (30 d)
- 52
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una 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 InternLM/lmdeploy
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 2 días
-
[Bug] apply_rotary_pos_emb: leaves output tails unwritten with partial rotationPosiblemente ocupada @shotsan la tomó hace 15 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
[Bug] PyTorch engine ignores use_rslora, so rsLoRA adapters run sqrt(r) times too weakPosiblemente ocupada @Andreas-Hum la tomó hace 25 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
[Feature] Expose `max_model_len` (session_len) in `/v1/models` model cardPosiblemente ocupada @FOWEPJF255 la tomó hace 37 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 2 días
Todos los issues de InternLM/lmdeploy
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Techiebutler/freeframe#687 ·
Los mantenedores suelen responder en 1 día
-
bug verbose GC
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
IBM/javacore-analyser#677 ·
Los mantenedores suelen responder en 1 día
-
area/config comp/plugins P1 platform/qqbot tool/file type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
NousResearch/hermes-agent#163932 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
plugins/dsh: todayStr() computes UTC but is documented as local — journal entries written 00:00–08:00 local land in the previous day's filePosiblemente ocupada @Beehtrix la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
zilliztech/memsearch#907 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[integration]: SynapCoresAbiertoexternal
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
langchain-ai/docs#8386 ·
Los mantenedores suelen responder en 1 día