code: def test_gpu_amd(test_settings):
      with mock.patch.object(
          wandb.sdk.internal.system.assets.gpu_amd.subprocess,
          "check_output",
          return_value=json.dumps(STATS_AMD),
      ), mock.patch.object(
          wandb.sdk.internal.system.assets.gpu_amd.shutil,
          "which",
          return_value=True,
      ):
          # print(wandb.sdk.internal.system.assets.gpu_amd.get_rocm_smi_stats())
  
          interface = AssetInterface()
          settings = SettingsStatic(
              test_settings(
                  dict(
                      _stats_sample_rate_seconds=0.1,
                      _stats_samples_to_average=2,
                  )
              ).to_proto()
          )
          shutdown_event = threading.Event()
  
          gpu = GPUAMD(
              interface=interface,
              settings=settings,
              shutdown_event=shutdown_event,
          )
          assert gpu.is_available()
          gpu.start()
          probe = gpu.probe()
          assert probe["gpu_count"] == 1
          assert (
              probe["gpu_devices"][0]["vendor"]
              == "Advanced Micro Devices, Inc. [AMD/ATI]"
          )
          time.sleep(1)
          shutdown_event.set()
          gpu.finish()
  
          assert not interface.metrics_queue.empty()
  
          metrics = interface.metrics_queue.get()
  
          known_metric_keys = list(get_args(_StatsKeys))
          assert all(
              f"gpu.0.{key}" in metrics for key in known_metric_keys
          )
  
file_path: wandb/tests/pytest_tests/unit_tests/test_system_metrics/test_gpu_amd.py
imports: import copy
  import json
  import sys
  import threading
  import time
  from unittest import mock
  import wandb
  from wandb.sdk.internal.settings_static import SettingsStatic
  from wandb.sdk.internal.system.assets import GPUAMD
  from wandb.sdk.internal.system.assets.gpu_amd import _StatsKeys
  from wandb.sdk.internal.system.system_monitor import AssetInterface
label_desc: Use image node_id 1 for calling a global function with example usage: test_gpu_amd(test_settings) without return types