Skip to content

Commit

Permalink
Revert "Determine gpu model from chip ID. (#439)"
Browse files Browse the repository at this point in the history
This reverts commit 31143f4.
  • Loading branch information
coleramos425 committed Oct 4, 2024
1 parent 31143f4 commit afcf6ef
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 22 deletions.
6 changes: 0 additions & 6 deletions src/omniperf_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@
"gfx942": {"mi300": ["MI300A_A1", "MI300X_A1"]},
}

MI300_CHIP_IDS = {
"29856": "MI300A_A1",
"29857": "MI300X_A1",
"29858": "MI308X",
}


class Omniperf:
def __init__(self):
Expand Down
36 changes: 27 additions & 9 deletions src/omniperf_soc/soc_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from collections import OrderedDict

from omniperf_base import SUPPORTED_ARCHS
from omniperf_base import MI300_CHIP_IDS


class OmniSoC_Base:
Expand Down Expand Up @@ -101,6 +100,11 @@ def get_profiler_options(self):
# assume no SoC specific options and return empty list by default
return []

def check_arch_override(self):
if "OMNIPERF_ARCH_OVERRIDE" in os.environ.keys():
return os.environ["OMNIPERF_ARCH_OVERRIDE"]
return ""

@demarcate
def populate_mspec(self):
from utils.specs import search, run, total_sqc, total_xcds
Expand Down Expand Up @@ -152,11 +156,6 @@ def populate_mspec(self):
self._mspec.workgroup_max_size = key
continue

key = search(r"^\s*Chip ID:\s+ ([a-zA-Z0-9]+)\s*", linetext)
if key != None:
self._mspec.chip_id = key
continue

key = search(r"^\s*Max Waves Per CU:\s+ ([a-zA-Z0-9]+)\s*", linetext)
if key != None:
self._mspec.max_waves_per_cu = key
Expand All @@ -182,9 +181,28 @@ def populate_mspec(self):
0
].upper()
if self._mspec.gpu_model == "MI300":
# Use Chip ID to distinguish MI300 gpu model using the built-in dictionary
if self._mspec.chip_id in MI300_CHIP_IDS:
self._mspec.chip_id = MI300_CHIP_IDS[self._mspec.chip_id]
self._mspec.gpu_model = list(SUPPORTED_ARCHS[self._mspec.gpu_arch].values())[
0
][0]
if self._mspec.gpu_arch == "gfx942":
if (
"MI300A" in "\n".join(self._mspec._rocminfo)
or "MI300A" in self.check_arch_override()
):
self._mspec.gpu_model = "MI300A_A1"
elif (
"MI300X" in "\n".join(self._mspec._rocminfo)
or "MI300X" in self.check_arch_override()
):
self._mspec.gpu_model = "MI300X_A1"
# We need to distinguish MI308X by peeking reported num CUs
elif self._mspec.cu_per_gpu == "80" or "MI308X" in self.check_arch_override():
self._mspec.gpu_model = "MI308X"
else:
console_error(
"Cannot parse MI300 details from rocminfo. Please verify output or set the arch using (e.g.,) "
'export OMNIPERF_ARCH_OVERRIDE="MI300A"'
)

self._mspec.num_xcd = str(
total_xcds(self._mspec.gpu_model, self._mspec.compute_partition)
Expand Down
7 changes: 0 additions & 7 deletions src/utils/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,6 @@ class MachineSpecs:
"name": "Workgroup Max Size",
},
)
chip_id: str = field(
default=None,
metadata={
"doc": "<>",
"name": "Chip ID",
},
)
max_waves_per_cu: str = field(
default=None,
metadata={
Expand Down

0 comments on commit afcf6ef

Please sign in to comment.