Add chip specs (#681)

* Add perfmon config spec, enhance memory partition info.

* Add gfx950 perfmon config.

* Add High Freq variants in gfx942.

* Add backup detection methods for gpu model.

* Improve get_num_xcds logic by adding detection of 1to1 arch-to-compute_partition logic.

* Add default compute partition settings spx:8 for when gpu_model=None.

* Update gpu spec tests.

* Add backup compute partition detection.

---------

Signed-off-by: xuchen-amd <xuchen@amd.com>
This commit is contained in:
xuchen-amd
2025-05-29 16:35:34 -04:00
committed by GitHub
parent 45296ceb46
commit f0fad19e8b
13 changed files with 527 additions and 177 deletions
+31 -6
View File
@@ -22,6 +22,10 @@ GFX942_CHIP_IDS_TO_NUM_XCDS = {
"29878": {"spx": 4, "dpx": 2, "cpx": 1},
"29861": {"spx": 8, "dpx": 4, "qpx": 2, "cpx": 1},
"29881": {"spx": 8, "dpx": 4, "qpx": 2, "cpx": 1},
"29864": {"spx": 4, "dpx": 2, "cpx": 1},
"29884": {"spx": 4, "dpx": 2, "cpx": 1},
"29865": {"spx": 8, "dpx": 4, "qpx": 2, "cpx": 1},
"29885": {"spx": 8, "dpx": 4, "qpx": 2, "cpx": 1},
}
# helper to strip ANSI color codes if your app uses them
@@ -91,17 +95,37 @@ def get_num_xcds():
if str(chip_id) in GFX942_CHIP_IDS_TO_NUM_XCDS.keys():
num_xcds = GFX942_CHIP_IDS_TO_NUM_XCDS[str(chip_id)]
if num_xcds is None:
return
return num_xcds
def get_gpu_arch():
rocminfo = str(
# decode with utf-8 to account for rocm-smi changes in latest rocm
subprocess.run(
["rocminfo"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
).stdout.decode("utf-8")
)
rocminfo = rocminfo.split("\n")
soc_regex = re.compile(r"^\s*Name\s*:\s+ ([a-zA-Z0-9]+)\s*$", re.MULTILINE)
devices = list(filter(soc_regex.match, rocminfo))
gpu_arch = devices[0].split()[1]
return gpu_arch
@pytest.mark.num_xcds_spec_class
def test_num_xcds_spec_class(monkeypatch):
num_xcds = get_num_xcds()
# 1. Check if gfx942 soc
if not num_xcds:
gpu_arch = get_gpu_arch()
if gpu_arch is None or gpu_arch.lower() != "gfx942":
pytest.skip("Skipping num xcds test for non-gfx942 socs.")
num_xcds = get_num_xcds()
# 2. load machine specs
machine_spec = generate_machine_specs(None)
@@ -114,12 +138,13 @@ def test_num_xcds_spec_class(monkeypatch):
@pytest.mark.num_xcds_cli_output
def test_num_xcds_cli_output():
num_xcds = get_num_xcds()
# 1. Check if gfx942 soc
if not num_xcds:
gpu_arch = get_gpu_arch()
if gpu_arch is None or gpu_arch.lower() != "gfx942":
pytest.skip("Skipping num xcds test for non-gfx942 socs.")
num_xcds = get_num_xcds()
# 2. Run rocprof-compute -s and grab rocprof-compute num_xcd
proc = subprocess.run(
["rocprof-compute", "-s"],