8000 [Monitoring] enable rocm monitoring for trunk and general tests by yangw-dev · Pull Request #153455 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[Monitoring] enable rocm monitoring for trunk and general tests #153455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/rocm-mi300.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ jobs:
build-environment: linux-jammy-rocm-py3.10
docker-image: ${{ needs.linux-jammy-rocm-py3_10-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-jammy-rocm-py3_10-build.outputs.test-matrix }}
disable-monitor: false
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/rocm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ jobs:
build-environment: linux-jammy-rocm-py3.10
docker-image: ${{ needs.linux-jammy-rocm-py3_10-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-jammy-rocm-py3_10-build.outputs.test-matrix }}
disable-monitor: false
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ jobs:
build-environment: linux-jammy-rocm-py3.10
docker-image: ${{ needs.linux-jammy-rocm-py3_10-build.outputs.docker-image }}
test-matrix: ${{ needs.linux-jammy-rocm-py3_10-build.outputs.test-matrix }}
disable-monitor: false
tests-to-include: "test_nn test_torch test_cuda test_ops test_unary_ufuncs test_binary_ufuncs test_autograd inductor/test_torchinductor distributed/test_c10d_common distributed/test_c10d_nccl"
secrets: inherit

Expand Down
14 changes: 9 additions & 5 deletions tools/stats/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def add_data(self, data: UsageData) -> None:
with self._lock:
self._data_list.append(data)

def add_error(self, error: Exception) -> None:
def add_error(self, error: Exception | str) -> None:
with self._lock:
self._data_errors.append(str(error))

Expand Down Expand Up @@ -380,13 +380,17 @@ def _collect_gpu_data(self) -> list[GpuData]:
)
)
elif self._has_amdsmi:
# Iterate over the available GPUs
gpu_data_list = []
for handle in self._gpu_handles:
# see https://rocm.docs.amd.com/projects/amdsmi/en/docs-5.7.0/py-interface_readme_link.html
engine_usage = amdsmi.amdsmi_get_gpu_activity(handle)
usage = f"check engine_usage: {engine_usage}"
self.shared_resource.add_error(usage)

gpu_uuid = amdsmi.amdsmi_get_gpu_device_uuid(handle)
gpu_utilization = engine_usage["gfx_activity"]
gpu_mem_utilization = gpu_utilization["umc_activity"]

gpu_utilization = engine_usage.get("gfx_activity", 0)
gpu_mem_utilization = engine_usage.get("umc_activity", 0)

gpu_data_list.append(
GpuData(
uuid=gpu_uuid,
Expand Down
Loading
0