-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Update Phi 3 Requirements (#550)
**Reason for Change**: Using `monitor_gpu_memory.sh` script on Phi-3 tuning jobs to get updated metrics on GPU memory required for running inference and tuning for Phi-3
- Loading branch information
1 parent
7899717
commit 5bde8f4
Showing
2 changed files
with
40 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <device_number>" | ||
exit 1 | ||
fi | ||
|
||
device_number=$1 | ||
|
||
max_memory_usage=0 | ||
|
||
# Log file to store the memory usage, including the device number | ||
log_file="gpu_memory_usage_${device_number}.log" | ||
|
||
update_max_memory_usage() { | ||
current_memory_usage=$(nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits -i $device_number | tr -d '[:space:]') | ||
|
||
# Update the maximum memory usage if the current usage is higher | ||
if (( current_memory_usage > max_memory_usage )); then | ||
max_memory_usage=$current_memory_usage | ||
# Log the new maximum memory usage | ||
echo "$(date): New max GPU memory usage on GPU $device_number: ${max_memory_usage}MiB" | tee -a $log_file | ||
fi | ||
} | ||
|
||
# Monitor GPU memory usage every second | ||
while true; do | ||
update_max_memory_usage | ||
sleep 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters