Per-I/O-thread OpenMP teams: thread count grows with requests, requests rotate across cold teams
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- cpp, linux
- Ambito
- backend, performance
Direzione di ricerca
Start by reading server/server.hpp for io_threads_ and main.cpp for the I/O thread setting, then reproduce the reported thread-count growth by checking /proc/<pid>/task after requests. Compare affected models and builds, including Windows behavior, and inspect related issue #882. Done means the cause is reproduced and a bounded threading fix is established; the issue lists several possible directions but does not choose one.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Each server I/O thread that runs an OpenMP region (prefill/decode CPU work) becomes its own libgomp master and builds its own team of workers. libgomp keeps these teams for the life of the process, so the thread count grows as requests land on I/O threads that haven't run OpenMP work yet, until every I/O thread has its own team. Requests then rotate across teams.
This is a bounded one-time cost, not an unbounded leak, but it costs memory, cold-start latency and CPU.
Observations
- Observed in a prefill profiling run (not yet re-verified in a clean setup): threads went 46 -> 79 after 4 requests (+33, about 3 teams of 11 workers).
- FLM does not start a thread per request. The server has a fixed I/O pool (
server/server.hppio_threads_;main.cppcallsset_io_threads(10), server default is 5). The growth tracks distinct I/O threads that have run OpenMP work. - Earlier measurement on d3 (see #882): ~122 threads with 10 I/O threads, requests rotating across cold teams cost +10-16% latency. With one I/O thread (a single team) latency was 86 ms vs 92-100 ms.
OMP_PROC_BIND=true OMP_PLACES=coressaved about 20 ms at 1k tokens in the profiling run (single measurement, not repeated).
Possible directions
- Run all OpenMP work from one master thread (or
set_io_threads(1)for the compute path). - Process-wide worker pool with bounded spin then sleep, instead of per-master OpenMP teams. A prototype for d3 exists (
d3_par.hpp, spin 30 us then sleep): single-master 11.6 -> 4.6 busy cores at the same latency. - Set a sane default for bind/places and
GOMP_SPINCOUNT/ wait policy.
The fix belongs on the FLM side (server threading / CPU worker pool), not in an individual model engine.
To do
- Reproduce cleanly:
ls /proc/<pid>/task | wc -lafter each of N requests, plateau expected near io_threads x (workers+1). - Confirm which models/builds are affected, and check Windows (vcomp behaves differently).
Related: #882
- Lingua principale
- C++
- Stelle
- 2.1k
- Fork
- 184
- Merge medio
- 12h 22m
- PR unite (30g)
- 239
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ROCm/FastFlowLM
-
Update Gemma tokenizer.json after Google's recent fixForse già presa @four1er l’ha presa 6 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ROCm/FastFlowLM#1057 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ROCm/FastFlowLM#757 ·
I maintainer di solito rispondono entro 1 giorno
-
No valid checkpoint to restore + Max length reached on multi-turn tool calls (Qwen3.6-MoE, NPU)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
ROCm/FastFlowLM#744 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Truncated tool call is emitted as a complete one (unterminated heredoc reaches the client)Forse già presa @Javinator9889 l’ha presa 72 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ROCm/FastFlowLM#741 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Download timeoutForse già presa @stdevPavelmc l’ha presa 200 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
ROCm/FastFlowLM#520 · 7 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ROCm/FastFlowLM
Issue simili
-
bug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
difficulty:easy func:gui prio:normal type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NatronGitHub/Natron#2118 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
-
bug difficulty:easy prio:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NatronGitHub/openfx-io#523 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
ArduPilot/ardupilot_gazebo#195 ·