Skip to content
Merged
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
7 changes: 7 additions & 0 deletions TraceLens/PerfModel/benchmarking/microbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import argparse
import json
import logging
import re
import time
from pathlib import Path
from typing import Dict, List, Optional, Tuple
Expand Down Expand Up @@ -169,6 +170,12 @@ def _bpe(dtype: torch.dtype) -> int:

def _arch_product_name(gpu_name: str, mem_gb: float) -> str:
"""Short name to match arch JSONs like `MI300X.json` (e.g. 'MI300X')."""
# Client parts report e.g. "AMD Radeon 8060S Graphics": the model sits
# between the brand and the trailing "Graphics", which names no model.
match = re.search(r"\bRadeon\s+(.+?)\s+Graphics\b", gpu_name, re.IGNORECASE)
if match:
return "_".join(["Radeon", *match.group(1).split()])

# ROCm containers often report a generic device string; use memory tier as hint.
mem = int(round(mem_gb))
if mem >= 280:
Expand Down
5 changes: 5 additions & 0 deletions tests/test_perfmodel_benchmarking.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,13 @@ def test_gemm_flops(self):
"gpu_name,mem_gb,expected",
[
("AMD Instinct MI300X", 192.0, "MI300X"),
("AMD Instinct MI210", 64.0, "MI210"),
# Trailing "Graphics" is a marketing suffix, not the model.
("AMD Radeon 8060S Graphics", 64.0, "Radeon_8060S"),
("AMD Radeon 890M Graphics", 32.0, "Radeon_890M"),
("Generic GPU", 280.0, "MI355X"),
("Some Card", 64.0, "Card"),
("", 0.0, "GPU"),
],
)
def test_arch_product_name(self, gpu_name, mem_gb, expected):
Expand Down
Loading