Add data-loading bottleneck diagnostic skill - #6466
Conversation
Signed-off-by: Rostan Tabet <rtabet@nvidia.com>
|
| Filename | Overview |
|---|---|
| skills/data-loading-bottleneck/SKILL.md | Defines the end-to-end diagnostic routing, equivalence requirements, verdict thresholds, and reporting contract. |
| skills/data-loading-bottleneck/references/profiling.md | Documents production-path NVTX instrumentation, Nsight capture validation, and evidence requirements for localization. |
| skills/data-loading-bottleneck/references/pytorch-dali.md | Documents bounded LoaderEvaluator construction and Real/Replay work-equivalence checks. |
| skills/data-loading-bottleneck/scripts/collect_preflight.py | Collects workload, environment, GPU, dependency, filesystem, and Git readiness into a preflight artifact. |
| skills/data-loading-bottleneck/scripts/summarize_nsys.py | Exports and summarizes the selected NVTX window, CUDA activity, worker coverage, and loader-wait overlap. |
| skills/data-loading-bottleneck/evals/evals.json | Defines representative input-bound, compute-bound, and inference scenarios for evaluating skill behavior. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Preflight workload and environment] --> B{Workload runnable?}
B -- No --> I[Report INCONCLUSIVE]
B -- Yes --> C[Run bounded Real workload]
C --> D{LoaderEvaluator available?}
D -- Yes --> E[Run equivalent Replay]
E --> F{Replay speedup}
F -- <= 1.10x --> N[Report NOT DETECTED]
F -- > 1.10x --> P[Profile production path]
D -- No --> P
P --> G{Validated input-path delay?}
G -- Yes --> H[Report DETECTED or POTENTIAL and localize]
G -- No --> I
Reviews (3): Last reviewed commit: "Add eval suite for data-loading bottlene..." | Re-trigger Greptile
|
/nvskills-ci |
Signed-off-by: Rostan Tabet <rtabet@nvidia.com>
Signed-off-by: Rostan Tabet <rtabet@nvidia.com>
|
/nvskills-ci |
| @@ -0,0 +1,225 @@ | |||
| --- | |||
| name: data-loading-bottleneck | |||
| description: "Diagnose input-bound PyTorch training. Use for low or bursty GPU utilization, slow batches, num_workers tuning, preprocessing regressions, or input stalls. Not for model/kernel optimization." | |||
There was a problem hiding this comment.
Is this useful only for only pyTorch based training?
| - python | ||
| team: dali | ||
| domain: deep-learning | ||
| version: "1.0.0" |
There was a problem hiding this comment.
Is the intent to update version number manually? Can it re-use DALI versioning ?
|
|
||
| ### 1. Preflight and route | ||
|
|
||
| Create an artifact directory for commands and raw output, then run preflight with the |
There was a problem hiding this comment.
The skill assumes that the platform that we run the preflight is configured so that it can run training.
Would it be possible to extend it to create virtual environment and execute pip install -f requiremnets.txt if such file exist?
| - CUDA 13.x: `nvidia-dali-cuda130` | ||
| - Other or unknown: record the unsupported runtime and skip replay. | ||
|
|
||
| ```bash |
There was a problem hiding this comment.
Wouldn't it be better to create a venv?
| | Real | [value, invalid, or unavailable] | [value, invalid, or unavailable] | [value and percent, invalid, or unavailable] | | ||
| | Replay | [value, invalid, or unavailable] | [value, invalid, or unavailable] | [value and percent, invalid, or unavailable] | | ||
|
|
||
| **Result:** [Measured speedup, wait-only prediction from Real, their difference, and threshold |
There was a problem hiding this comment.
Would it be possible to add a graph (run a python script), that would show how much improvement we get for specific batch sizes and number or workers?
| | Script | Purpose | Arguments | | ||
| |---|---|---| | ||
| | `scripts/collect_preflight.py` | Record environment, source, data, and optional-tool readiness in `preflight.json` | `--source-dir`, `--artifact-dir`, one of `--data-path` or `--data-source`; optional `--expected-visible-gpus` | | ||
| | `scripts/summarize_nsys.py` | Summarize the measured NVTX window, CUDA activity, and loader-wait/GPU-idle overlap | input `.nsys-rep` and required `--output` JSON path | |
There was a problem hiding this comment.
I guess this could be a skill, but I understand that we need 100% reproducibility, correct?
Category:
Other (e.g. Documentation, Tests, Configuration)
Description:
Create a skill allowing agent to detect and localize data loading bottlenecks in PyTorch training.
The workflow roughly contains two important phases:
LoaderEvaluatorThe complete workflow is more complex and looks as follows:
LoaderEvaluatoris or can be made importable , continue to 3. Else, go to 4.LoaderEvaluator's replay mode. Establish if there's a measured bottleneck. If we this steps provdes that there's no bottleneck, go to 5. Otherwise, continue to 4. to localize.This was tested on multiple models, with different environment requirements, including simple ResNet50, OpenCLIP, LeWorldModel, and Hugging Face timm.
In terms of the model used by the agent, I found that GPT 5.6 Terra or equivalent is a sound minimum requirement to run this reliably, although it can sometimes fail to accurately follow all instructions, like the shape of the report.
I unfortunately couldn't commit evaluations as the skill CI doesn't support GPU environments.
Additional information:
Affected modules and functionalities:
Skill created.
Key points relevant for the review:
Note that if you run locally, depending on the workload, it may take time to complete.
Tests:
Skill CI doesn't support GPU workers yet
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: DALI-4796