Skip to content

Commit 1b9534a

Browse files
authored
[BE] Tweak nvidia-smi to return the same device name as PyTorch (#7631)
I realize that piping the output of nvidia-smi to awk is redundant, and we should use the same device name as what PyTorch returns. For example `nvidia-smi -i 0 --query-gpu=name --format=csv,noheader` returns `NVIDIA H100 80GB HBM3` and `NVIDIA B200` like PyTorch, but `nvidia-smi -i 0 --query-gpu=name --format=csv,noheader | awk '{print $2}'` only return `H100` and `B200` (the short form) ### Testing https://github.com/pytorch/pytorch-integration-testing/actions/runs/20765773145/job/59631431108#step:8:30 correctly returns `NVIDIA B200` Signed-off-by: Huy Do <[email protected]>
1 parent 0d43574 commit 1b9534a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/actions/gather-runners-info/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ runs:
5151
set -eux
5252
5353
if [[ "${DEVICE_NAME}" == "cuda" ]]; then
54-
DEVICE_TYPE=$(nvidia-smi -i 0 --query-gpu=name --format=csv,noheader | awk '{print $2}')
54+
# Return the same device name as PyTorch
55+
DEVICE_TYPE=$(nvidia-smi -i 0 --query-gpu=name --format=csv,noheader)
5556
elif [[ "${DEVICE_NAME}" == "rocm" ]]; then
5657
DEVICE_TYPE=$(rocminfo | grep "Marketing Name" | tail -n1 | awk -F':' '{print $2}' | xargs)
5758
elif [[ "${DEVICE_NAME}" == "hpu" ]]; then

.github/actions/upload-benchmark-results/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ runs:
7474
set -eux
7575
7676
if [[ "${DEVICE_NAME}" == "cuda" ]]; then
77-
DEVICE_TYPE=$(nvidia-smi -i 0 --query-gpu=name --format=csv,noheader | awk '{print $2}')
77+
# Return the same device name as PyTorch
78+
DEVICE_TYPE=$(nvidia-smi -i 0 --query-gpu=name --format=csv,noheader)
7879
elif [[ "${DEVICE_NAME}" == "rocm" ]]; then
7980
DEVICE_TYPE=$(rocminfo | grep "Marketing Name" | tail -n1 | awk -F':' '{print $2}' | xargs)
8081
elif [[ "${DEVICE_NAME}" == "hpu" ]]; then

0 commit comments

Comments
 (0)