minor: update killall script (#2391)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
"""Common utilities."""
|
"""Common utilities"""
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import gc
|
import gc
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
# Kill all SGLang processes and free the GPU memory.
|
#!/bin/bash
|
||||||
|
|
||||||
kill -9 $(ps aux | grep 'multiprocessing.spawn' | grep -v 'grep' | awk '{print $2}')
|
# Show current GPU status
|
||||||
kill -9 $(ps aux | grep 'sglang.launch_server' | grep -v 'grep' | awk '{print $2}')
|
nvidia-smi
|
||||||
kill -9 $(ps aux | grep 'sglang.bench' | grep -v 'grep' | awk '{print $2}')
|
|
||||||
|
# Clean SGLang processes
|
||||||
|
kill -9 $(ps aux | grep 'multiprocessing.spawn' | grep -v 'grep' | awk '{print $2}') 2>/dev/null
|
||||||
|
kill -9 $(ps aux | grep 'sglang.launch_server' | grep -v 'grep' | awk '{print $2}') 2>/dev/null
|
||||||
|
kill -9 $(ps aux | grep 'sglang.bench' | grep -v 'grep' | awk '{print $2}') 2>/dev/null
|
||||||
|
|
||||||
|
# Clean all GPU processes if any argument is provided
|
||||||
|
if [ $# -gt 0 ]; then
|
||||||
|
kill -9 $(nvidia-smi | sed -n '/Processes:/,$p' | grep " [0-9]" | awk '{print $5}') 2>/dev/null
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user