Skip to content

Commit 7d3ba61

Browse files
committed
Add nsys patch in ray sub template
Signed-off-by: Hemil Desai <hemild@nvidia.com>
1 parent 213c399 commit 7d3ba61

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

nemo_run/run/ray/templates/ray.sub.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ monitor-sidecar() {
132132
}
133133
monitor-sidecar &
134134
135+
# Patch nsight.py before starting Ray head
136+
sed -i 's/context\.py_executable = " "\.join(self\.nsight_cmd) + " python"/context.py_executable = " ".join(self.nsight_cmd) + f" {context.py_executable}"/g' /opt/nemo_rl_venv/lib64/python*/site-packages/ray/_private/runtime_env/nsight.py
137+
135138
cat <<EOFINNER | tee /launch-head.sh
136139
ray start --head \
137140
--disable-usage-stats \
@@ -209,6 +212,9 @@ monitor-sidecar() {
209212
}
210213
monitor-sidecar &
211214
215+
# Patch nsight.py before starting Ray worker
216+
sed -i 's/context\.py_executable = " "\.join(self\.nsight_cmd) + " python"/context.py_executable = " ".join(self.nsight_cmd) + f" {context.py_executable}"/g' /opt/nemo_rl_venv/lib64/python*/site-packages/ray/_private/runtime_env/nsight.py
217+
212218
cat <<EOFINNER | tee /launch-worker.sh
213219
sleep 5
214220
ray start --address "$ip_head" \

test/core/execution/artifacts/expected_ray_cluster.sub

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ monitor-sidecar() {
126126
}
127127
monitor-sidecar &
128128
129+
# Patch nsight.py before starting Ray head
130+
sed -i 's/context\.py_executable = " "\.join(self\.nsight_cmd) + " python"/context.py_executable = " ".join(self.nsight_cmd) + f" {context.py_executable}"/g' /opt/nemo_rl_venv/lib64/python*/site-packages/ray/_private/runtime_env/nsight.py
131+
129132
cat <<EOFINNER | tee /launch-head.sh
130133
ray start --head \
131134
--disable-usage-stats \
@@ -199,6 +202,9 @@ monitor-sidecar() {
199202
}
200203
monitor-sidecar &
201204
205+
# Patch nsight.py before starting Ray worker
206+
sed -i 's/context\.py_executable = " "\.join(self\.nsight_cmd) + " python"/context.py_executable = " ".join(self.nsight_cmd) + f" {context.py_executable}"/g' /opt/nemo_rl_venv/lib64/python*/site-packages/ray/_private/runtime_env/nsight.py
207+
202208
cat <<EOFINNER | tee /launch-worker.sh
203209
sleep 5
204210
ray start --address "$ip_head" \

test/core/execution/artifacts/expected_ray_cluster_ssh.sub

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ monitor-sidecar() {
131131
}
132132
monitor-sidecar &
133133
134+
# Patch nsight.py before starting Ray head
135+
sed -i 's/context\.py_executable = " "\.join(self\.nsight_cmd) + " python"/context.py_executable = " ".join(self.nsight_cmd) + f" {context.py_executable}"/g' /opt/nemo_rl_venv/lib64/python*/site-packages/ray/_private/runtime_env/nsight.py
136+
134137
cat <<EOFINNER | tee /launch-head.sh
135138
ray start --head \
136139
--disable-usage-stats \
@@ -206,6 +209,9 @@ monitor-sidecar() {
206209
}
207210
monitor-sidecar &
208211
212+
# Patch nsight.py before starting Ray worker
213+
sed -i 's/context\.py_executable = " "\.join(self\.nsight_cmd) + " python"/context.py_executable = " ".join(self.nsight_cmd) + f" {context.py_executable}"/g' /opt/nemo_rl_venv/lib64/python*/site-packages/ray/_private/runtime_env/nsight.py
214+
209215
cat <<EOFINNER | tee /launch-worker.sh
210216
sleep 5
211217
ray start --address "$ip_head" \

0 commit comments

Comments
 (0)