DataLoader: consume-ahead on a background thread removes the data wait but not step time (results from #2312)
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- machine-learning, performance
Research direction
Start with the results and profiling details in this issue, then read the linked work in #2312 to understand the background-consume change. The issue records no code or test file to modify; any follow-up should evaluate one of the listed approaches and report whether it improves step time. If revisiting the implementation, inspect how MultiDataset handles prepare_background_consume and review the note about collective ordering across ranks.
Written by the indexing model from the issue text.
Description
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:
MultiDatasetneeds to forwardprepare_background_consumeto 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.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 853
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 64
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/physicsnemo
-
🐛[BUG]: ONNX export fails for Transolver with plus=FalsePossibly taken @jihonjoa claimed this 5 days ago. Open? - Needs Triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/physicsnemo#2323 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
NVIDIA/physicsnemo#2302 · 1 comment ·
Maintainers usually reply within 2 days
-
swe_nonlinear_pino: physicsnemo_fdm_swe_nonlin slices batch dim ([1:-1]) -> empty PDE residual / NaN loss_pde with default batchsize=1Possibly taken @dmitriySem claimed this 27 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NVIDIA/physicsnemo#2214 ·
Maintainers usually reply within 2 days
-
Wasserstein CDF distance uses the first width for every binPossibly taken @sylvesterkaczmarek claimed this 60 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
NVIDIA/physicsnemo#2042 ·
Maintainers usually reply within 2 days
-
🐛[BUG]: Darcy2D Jacobi kernel divides grad(k)·grad(u) by 2dx instead of 4dx², so the data doesn't solve the Darcy equationMay be free again @coreyjadams claimed this 58 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/physicsnemo#2036 · 2 comments · 1 assignee ·
Maintainers usually reply within 2 days
All issues in NVIDIA/physicsnemo
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TigreGotico/orthography2ipa#2950 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Unstructured-IO/unstructured#4876 ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openfoodfacts/openfoodfacts-python#579 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
fairagro/m4.2_sql_to_arc#388 ·
Maintainers usually reply within 1 day