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
2 changes: 1 addition & 1 deletion nemo_run/core/execution/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def get_nsys_entrypoint(self) -> str:
launcher = self.get_launcher()
entrypoint, postfix = "nsys", ""
if launcher.nsys_gpu_metrics:
entrypoint = 'bash -c \'GPU_METRICS_FLAG=""; if [ "$SLURM_PROCID" -eq 0 ]; then GPU_METRICS_FLAG="--gpu-metrics-devices=all"; fi; nsys'
entrypoint = 'bash -c \'GPU_METRICS_FLAG=""; if echo "${GPU_METRICS_NODES}" | grep -q -w "${SLURM_NODEID}"; then GPU_METRICS_FLAG="--gpu-metrics-devices=${SLURM_LOCALID}"; fi; nsys'
postfix = "'"
return (entrypoint, postfix)

Expand Down
2 changes: 1 addition & 1 deletion test/core/execution/test_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def test_get_nsys_entrypoint(self):

with patch.object(executor, "get_launcher", return_value=launcher_mock):
assert executor.get_nsys_entrypoint() == (
'bash -c \'GPU_METRICS_FLAG=""; if [ "$SLURM_PROCID" -eq 0 ]; then GPU_METRICS_FLAG="--gpu-metrics-devices=all"; fi; nsys',
'bash -c \'GPU_METRICS_FLAG=""; if echo "${GPU_METRICS_NODES}" | grep -q -w "${SLURM_NODEID}"; then GPU_METRICS_FLAG="--gpu-metrics-devices=${SLURM_LOCALID}"; fi; nsys',
"'",
)

Expand Down
Loading