Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nemo/lightning/run/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class NsysPlugin(run.Plugin):
nsys_trace: Optional[list[str]] = None
nsys_extra_args: Optional[list[str]] = None
gen_shape: bool = False
nsys_gpu_metrics: bool = False

def setup(self, task: run.Partial | run.Script, executor: run.Executor):
"""Set up the nsys profiling plugin."""
Expand All @@ -186,6 +187,13 @@ def setup(self, task: run.Partial | run.Script, executor: run.Executor):
"--cuda-event-trace=false",
"--nvtx-domain-include=NCCL",
]
if self.nsys_gpu_metrics:
if hasattr(launcher, "nsys_gpu_metrics"):
launcher.nsys_gpu_metrics = self.nsys_gpu_metrics
else:
logging.warning(
"Unable to enable nsys gpu metrics collection. Please upgrade Nemo-Run to include commit 70a0df4."
)


@dataclass(kw_only=True)
Expand Down
7 changes: 7 additions & 0 deletions scripts/performance/argument_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,13 @@ def bool_arg(arg):
"-pso", "--profiling_stop_step", type=int, help="Defines start step for profiling", required=False, default=50
)

parser.add_argument(
"-pgm",
"--profiling_gpu_metrics",
help="Enable nsys gpu metrics. Disabled by default.",
action="store_true",
)

parser.add_argument(
"-cps",
"--checkpoint_save",
Expand Down
1 change: 1 addition & 0 deletions scripts/performance/llm/pretrain_deepseek_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def override_recipe_configs(
start_step=args.profiling_start_step,
end_step=args.profiling_stop_step,
ranks=list(range(num_nodes * args.gpus_per_node)),
nsys_gpu_metrics=args.profiling_gpu_metrics,
)
)
# nsys takes precedent over ncclttrace
Expand Down
1 change: 1 addition & 0 deletions scripts/performance/llm/pretrain_grok1_314b.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ def override_recipe_configs(
start_step=args.profiling_start_step,
end_step=args.profiling_stop_step,
ranks=list(range(num_nodes * args.gpus_per_node)),
nsys_gpu_metrics=args.profiling_gpu_metrics,
)
)
# nsys takes precedent over ncclttrace
Expand Down
1 change: 1 addition & 0 deletions scripts/performance/llm/pretrain_llama31_405b.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def override_recipe_configs(
start_step=args.profiling_start_step,
end_step=args.profiling_stop_step,
ranks=list(range(num_nodes * args.gpus_per_node)),
nsys_gpu_metrics=args.profiling_gpu_metrics,
)
)
# nsys takes precedent over ncclttrace
Expand Down
1 change: 1 addition & 0 deletions scripts/performance/llm/pretrain_llama4_e128.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def override_recipe_configs(
start_step=args.profiling_start_step,
end_step=args.profiling_stop_step,
ranks=list(range(num_nodes * args.gpus_per_node)),
nsys_gpu_metrics=args.profiling_gpu_metrics,
)
)
# nsys takes precedent over ncclttrace
Expand Down
1 change: 1 addition & 0 deletions scripts/performance/llm/pretrain_nemotron4_15b.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def override_recipe_configs(
start_step=args.profiling_start_step,
end_step=args.profiling_stop_step,
ranks=list(range(num_nodes * args.gpus_per_node)),
nsys_gpu_metrics=args.profiling_gpu_metrics,
)
)

Expand Down
1 change: 1 addition & 0 deletions scripts/performance/llm/pretrain_nemotron4_340b.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def override_recipe_configs(
start_step=args.profiling_start_step,
end_step=args.profiling_stop_step,
ranks=list(range(num_nodes * args.gpus_per_node)),
nsys_gpu_metrics=args.profiling_gpu_metrics,
)
)

Expand Down
1 change: 1 addition & 0 deletions scripts/performance/llm/pretrain_nemotronh_56b.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def override_recipe_configs(
start_step=args.profiling_start_step,
end_step=args.profiling_stop_step,
ranks=list(range(num_nodes * args.gpus_per_node)),
nsys_gpu_metrics=args.profiling_gpu_metrics,
)
)
elif args.enable_nccltrace: # nsys takes precedent over nccltrace
Expand Down
Loading