Skip to content

Commit

Permalink
make cuda process killer conditional
Browse files Browse the repository at this point in the history
Signed-off-by: Ata Fatahi <[email protected]>
  • Loading branch information
MrAta committed Dec 12, 2024
1 parent 460d50f commit 230aede
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-test-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
pip install --force-reinstall dist/*.whl
- name: Run e2e test
run: |
bash scripts/killall_sglang.sh
bash scripts/killall_sglang.sh "nuke_gpus"
cd rust/py_test
python3 run_suite.py
Expand Down
7 changes: 5 additions & 2 deletions scripts/killall_sglang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ kill -9 $(ps aux | grep 'sglang.launch_server' | grep -v 'grep' | awk '{print $2
kill -9 $(ps aux | grep 'sglang.bench' | grep -v 'grep' | awk '{print $2}') 2>/dev/null

# Clean all GPU processes
kill -9 $(nvidia-smi | sed -n '/Processes:/,$p' | grep " [0-9]" | awk '{print $5}') 2>/dev/null
lsof /dev/nvidia* | awk '{print $2}' | xargs kill -9 2>/dev/null
if [ $# -gt 0 ]; then
kill -9 $(nvidia-smi | sed -n '/Processes:/,$p' | grep " [0-9]" | awk '{print $5}') 2>/dev/null
lsof /dev/nvidia* | awk '{print $2}' | xargs kill -9 2>/dev/null
fi


# Show GPU status after clean up
nvidia-smi

0 comments on commit 230aede

Please sign in to comment.