Skip to content
4 changes: 3 additions & 1 deletion build_tools/tests/artifact_manager_tool_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1678,17 +1678,19 @@ def test_broad_family_selects_family_and_enabled_target_artifacts(self):
"rand_lib_generic.tar.zst",
"rand_lib_gfx125X-all.tar.zst",
"rand_lib_gfx1250.tar.zst",
"rand_lib_gfx1250-strict.tar.zst",
},
)

def test_explicit_target_can_supplement_broad_family(self):
self.assertEqual(
self._select("gfx125X-all;gfx1250-strict"),
self._select("gfx125X-all;gfx942"),
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gfx942 added for gfx1250 patch ????

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine. It's a unit test, and now that gfx1250-strict is part of gfx1250X-all, gfx942 is an "explicit family" supplementing the "broad family" (unit test name).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly :)

"rand_lib_generic.tar.zst",
"rand_lib_gfx125X-all.tar.zst",
"rand_lib_gfx1250.tar.zst",
"rand_lib_gfx1250-strict.tar.zst",
"rand_lib_gfx942.tar.zst",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same : gfx942 added for gfx1250 patch ????

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is tests for broader family enablement.

},
)

Expand Down
36 changes: 17 additions & 19 deletions build_tools/tests/cmake_amdgpu_targets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,33 @@ class CmakeTargetSelectionTest(unittest.TestCase):
def test_registration(self):
infos = parse_amdgpu_targets_cmake(ROOT / "cmake/therock_amdgpu_targets.cmake")
strict = next(info for info in infos if info.gfx_target == "gfx1250-strict")
self.assertEqual(strict.families, [])
self.assertEqual(strict.families, ["dcgpu-all", "gfx125X-all", "gfx125X-dcgpu"])
families = amdgpu_family_map()
self.assertEqual(families["gfx1250"], ["gfx1250"])
self.assertEqual(families["gfx1250-strict"], ["gfx1250-strict"])
for family in ("gfx125X-all", "gfx125X-dcgpu", "dcgpu-all"):
self.assertNotIn("gfx1250-strict", families[family])
self.assertIn("gfx1250-strict", families[family])

def test_cmake_selection_and_defaults(self):
cases = [
("set(THEROCK_AMDGPU_FAMILIES gfx1250)", "gfx1250", "gfx1250", "default"),
("set(THEROCK_AMDGPU_FAMILIES gfx1250)", "gfx1250", "gfx1250", "all"),
(
"set(THEROCK_AMDGPU_FAMILIES gfx125X-all)",
"gfx1250",
"gfx1250",
"default",
"gfx1250-strict;gfx1250",
"gfx1250-strict;gfx1250",
"all",
),
(
"set(THEROCK_AMDGPU_FAMILIES gfx125X-dcgpu)\nset(THEROCK_TEST_AMDGPU_FAMILIES gfx125X-dcgpu)",
"gfx1250-strict;gfx1250",
"gfx1250-strict;gfx1250",
"gfx1250-strict;gfx1250",
),
(
"set(THEROCK_AMDGPU_TARGETS gfx1250)",
"gfx1250",
"THEROCK_DIST_AMDGPU_TARGETS-NOTFOUND",
"default",
"all",
),
(
"set(THEROCK_AMDGPU_FAMILIES gfx1250-strict)\nset(THEROCK_TEST_AMDGPU_FAMILIES gfx1250-strict)",
Expand Down Expand Up @@ -168,12 +174,6 @@ def test_cmake_selection_and_defaults(self):
"gfx1250;gfx1250-strict",
"all",
),
(
"set(THEROCK_AMDGPU_FAMILIES gfx125X-all)\nset(THEROCK_AMDGPU_TARGETS gfx1250-strict)\nset(THEROCK_AMDGPU_DIST_BUNDLE_NAME combined)",
"gfx1250;gfx1250-strict",
"gfx1250",
"all",
),
(
"set(THEROCK_DIST_AMDGPU_FAMILIES gfx1250-strict)",
"THEROCK_AMDGPU_TARGETS-NOTFOUND",
Expand All @@ -189,8 +189,8 @@ def test_cmake_selection_and_defaults(self):
(
"set(THEROCK_DIST_AMDGPU_FAMILIES gfx125X-all)",
"THEROCK_AMDGPU_TARGETS-NOTFOUND",
"gfx1250",
"default",
"gfx1250-strict;gfx1250",
"all",
),
(
"set(THEROCK_AMDGPU_FAMILIES gfx1250-strict)\nset(THEROCK_TEST_AMDGPU_TARGETS gfx1250)",
Expand All @@ -202,7 +202,7 @@ def test_cmake_selection_and_defaults(self):
"set(THEROCK_AMDGPU_FAMILIES gfx1250-strict)\nset(THEROCK_TEST_AMDGPU_FAMILIES gfx125X-all)",
"gfx1250-strict",
"gfx1250-strict",
"gfx1250",
"gfx1250-strict;gfx1250",
),
]
for settings, build, dist, tests in cases:
Expand All @@ -222,12 +222,10 @@ def test_cmake_selection_and_defaults(self):
"""
)
with script.open("a") as f:
if tests in ("default", "all"):
if tests == "all":
f.write(
"get_property(expected GLOBAL PROPERTY THEROCK_AMDGPU_TARGETS)\n"
)
if tests == "default":
f.write("list(REMOVE_ITEM expected gfx1250-strict)\n")
else:
f.write(f'set(expected "{tests}")\n')
f.write(
Expand Down
10 changes: 1 addition & 9 deletions cmake/therock_amdgpu_targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ therock_add_amdgpu_target(gfx1201 "AMD RX 9070 / XT" FAMILY dgpu-all gfx120X-all
)

# gfx125X family
# TODO(#8278): strict is outside outside broad build/test selection, with family added later.
therock_add_amdgpu_target(gfx1250-strict "AMD Instinct gfx1250 strict")
therock_add_amdgpu_target(gfx1250-strict "AMD Instinct gfx1250 strict" FAMILY dcgpu-all gfx125X-all gfx125X-dcgpu)
therock_add_amdgpu_target(gfx1250 "AMD Instinct MI450/MI450X/MI455X CDNA" FAMILY dcgpu-all gfx125X-all gfx125X-dcgpu)

# amdgcnspirv architecture-independent portable SPIR-V target
Expand Down Expand Up @@ -402,13 +401,6 @@ function(therock_validate_amdgpu_targets)
set(_test_expanded_targets "${THEROCK_TEST_AMDGPU_TARGETS}")
if(NOT _test_families AND NOT _test_expanded_targets)
set(_test_expanded_targets "${_available_targets}")
# TODO(#8278): Remove this opt-in restriction when gfx1250-strict joins gfx125X.
# Include selected strict builds in default test compilation. Check dist
# targets too so target-neutral CI stages use the same test target list.
if(NOT "gfx1250-strict" IN_LIST _expanded_targets AND
NOT "gfx1250-strict" IN_LIST _dist_expanded_targets)
list(REMOVE_ITEM _test_expanded_targets gfx1250-strict)
endif()
else()
foreach(_family ${_test_families})
if(NOT "${_family}" IN_LIST _available_families)
Expand Down
Loading