Skip to content

Commit 760077b

Browse files
[rocm-libraries] ROCm/rocm-libraries#7209 (commit c07faaa)
[tensilelite] Fix ISA sentinel type drift in validParameters (#7209) ## Motivation Test failure in #7162. ## Technical Details validParameters["ISA"] is set in two places with two different representations of the (0,0,0) "any ISA" sentinel: - ValidParameters.py:66 (import-time default): plain tuple (0,0,0) - GlobalParameters.py:673 (assignGlobalParameters narrow-down): IsaVersion(0,0,0) (a SemanticVersion NamedTuple) Solution.py caches a snapshot of validParameters' allowed-value types at import time as _expectedParamTypes. Once any code path runs assignGlobalParameters, the cached snapshot still records {tuple, SemanticVersion} for "ISA" while the live dict only contains {SemanticVersion}, so the snapshot goes stale. Align the import-time sentinel with the runtime one by using IsaVersion(0,0,0) in both places. Backward compatible because SemanticVersion is a NamedTuple subclass of tuple, so any isinstance(x, tuple) checks still hold. ## Test Plan Run existing tests. ## Test Result Pass ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
1 parent 30353c7 commit 760077b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tensilelite/Tensile/Common/ValidParameters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from functools import lru_cache
2727

2828
from .Architectures import SUPPORTED_ISA
29+
from .Types import IsaVersion
2930

3031
################################################################################
3132
# Enumerate Valid Solution Parameters
@@ -63,7 +64,7 @@
6364
768,
6465
]
6566
validMacroTiles = []
66-
validISA = [(0, 0, 0)]
67+
validISA = [IsaVersion(0, 0, 0)]
6768
validISA.extend(SUPPORTED_ISA)
6869
for i in validMacroTileSides:
6970
for j in validMacroTileSides:

0 commit comments

Comments
 (0)