DataLoader: consume-ahead on a background thread removes the data wait but not step time (results from #2312)

Aperta Adatta ai principianti
#2,354 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, pytorch

Direzione di ricerca

Inizia dai risultati e dai dettagli di profiling di questo issue, poi leggi il lavoro collegato in #2312 per capire la modifica al consumo in background. L’issue non indica alcun file di codice o di test da modificare; un eventuale lavoro successivo dovrebbe valutare uno degli approcci elencati e riferire se migliora il tempo per step. Se riesamini l’implementazione, controlla come MultiDataset gestisce prepare_background_consume e leggi la nota sull’ordinamento collettivo tra i rank.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Consuming and collating the next batch on a background thread (#2312, now closed) cuts the wait in next(dataloader) to ~0.1 ms, but step time does not improve: the work moves from "data wait" into slower kernel launches. Recording the result and what could make it pay off.

Details

  • Unified external-aero recipe, DrivAerML surface, flare_surface, bf16, 200k cells, compile, domain size = GPU count (H100), median of 120 steps. Step time off → on: 0.148 → 0.149 s (1 GPU), 0.098 → 0.102 s (2), 0.094 → 0.094 s (8).
  • Profile at 8 GPUs: training kernels and NCCL time unchanged; host time in the compiled forward +30% and backward +48%. The step is launch-bound (~2100 kernels/step), and the consume work is Python that holds the GIL, so it slows the launching threads.
  • Ways it could pay off: consume in a separate process instead of a thread; fewer, fused or compiled transforms; or a step that is not launch-bound (e.g. CUDA graphs).
  • If revisited: MultiDataset needs to forward prepare_background_consume to its children (otherwise the background all-reduce shares the training communicator), and a collective on a background thread can still interleave with main-thread collectives in a different order per rank.
Lingua principale
Python
Stelle
3.5k
Fork
853
Merge medio
2g 2h
PR unite (30g)
64

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NVIDIA/physicsnemo

Tutte le issue di NVIDIA/physicsnemo

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.