Skip to content

Commit

Permalink
Add range_query tests to NVML test suite (#4879)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbluca authored Jun 8, 2021
1 parent 2c86847 commit 8d89016
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion distributed/diagnostics/tests/test_nvml.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def test_gpu_metrics(s, a, b):


@gen_cluster()
async def test_gpu_monitoring(s, a, b):
async def test_gpu_monitoring_recent(s, a, b):
if nvml.device_get_count() < 1:
pytest.skip("No GPUs available")

Expand All @@ -83,3 +83,16 @@ async def test_gpu_monitoring(s, a, b):
)
assert res[a.address]["gpu_name"] == pynvml.nvmlDeviceGetName(h).decode()
assert res[a.address]["gpu_memory_total"] == pynvml.nvmlDeviceGetMemoryInfo(h).total


@gen_cluster()
async def test_gpu_monitoring_range_query(s, a, b):
if nvml.device_get_count() < 1:
pytest.skip("No GPUs available")

res = await s.get_worker_monitor_info()
ms = ["gpu_utilization", "gpu_memory_used"]
for w in (a, b):
assert all(res[w.address]["range_query"][m] is not None for m in ms)
assert res[w.address]["count"] is not None
assert res[w.address]["last_time"] is not None

0 comments on commit 8d89016

Please sign in to comment.