acoustic-carpenter-78188
07/01/2026, 6:46 PMexamples/accelerators/nsys_profiling — profile a GPU training script with Nsight Systems inside a Flyte task.
What it does
• Runs nsys profile --trace=cuda,nvtx,osrt --output=lightning_nsys_trace --force-overwrite=true python train.py on an L4 GPU.
• Returns the .nsys-rep as a flyte.io.File output (downloadable, open in the Nsight Systems GUI).
• Renders an nsys stats summary (kernel / NVTX / OS-runtime) into the task's HTML report deck (report=True + flyte.report).
• train.py ships as a real file via include=, not an inline string, so it's editable/runnable on its own.
Notes
• Base is the NGC PyTorch image (`nvcr.io/nvidia/pytorch:24.08-py3`) for a preinstalled nsys + torch; the module comments document the clone(extendable=True, python_version=(3,10)) + `flyte`/`uv`/`kubernetes` layers needed to make an arbitrary base flyte-runnable.
• PodTemplate.allow_nested_sandboxing() supplies the CAP_SYS_ADMIN + AppArmor-unconfined posture that --trace=osrt and GPU counters require.
Validated end-to-end on flyte run (run succeeded; profiling ran under /usr/bin/python3.10, .nsys-rep generated and uploaded).
flyteorg/flyte-sdkacoustic-carpenter-78188
07/15/2026, 1:00 PM