Repository navigation
test(hip-tests): expect hipErrorInvalidClusterSize for a zero __clust… - #14218
Merged
sunhmy-amd merged 2 commits intoOct 28, 2026
Merged
Conversation
…er_dims__ axis #13004 made a partially specified kernel cluster requirement return hipErrorInvalidClusterSize, and made the graph path reject it at hipGraphAddKernelNode instead of at instantiate or launch. The two ZeroClusterDim cases still assert the previous contract, so they fail on any runtime that carries #13004 while Negative_OversizedCluster in the same file already expects hipErrorInvalidClusterSize. Require the specific code in both cases and treat node creation as a valid rejection point. Skipped graph stages now log "not attempted" rather than reporting the hipSuccess they were initialised with. Drop the claim that this matches a zero dimension passed through hipLaunchAttributeClusterDimension: that path still returns hipErrorInvalidConfiguration, so the two are no longer equivalent.
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused test changes match the updated runtime behavior and preserve graph control flow and cleanup, with no unresolved findings.
No open issues 🎉
What changed in this PR
Updates HIP cluster compiler-directive tests to match the runtime behavior introduced by #13004 for a zero cluster dimension.
Changes:
- Requires
hipErrorInvalidClusterSizein both direct-launch and graph tests. - Accepts graph rejection at node creation, instantiation, or launch, with guarded execution and clearer diagnostics.
- Updates comments to remove the outdated equivalence with the launch-attribute route.
| File | Description |
|---|---|
projects/hip-tests/catch/unit/cluster/hipClusterCompilerDirective.cc |
Aligns zero-dimension assertions, graph rejection handling, and comments with the updated runtime. |
Review effort: Balanced
kjayapra-amd
approved these changes
Oct 27, 2026
chrispaquot
approved these changes
Oct 27, 2026
sunhmy-amd
deleted the
users/mingsun/fix-cluster-zerodim-test-error-codes
branch
October 28, 2026 01:23
Contributor
|
🤖 AI-assisted pre-review (for @mangupta) Re-reviewed the updated head ( |
ywang103-amd
pushed a commit
that referenced
this pull request
Oct 28, 2026
#14218) ## Motivation `Unit_hipClusterLaunch_CompilerDirective_Negative_ZeroClusterDim` and its `_Graph` variant fail on any runtime carrying #13004. They passed on ROCm 10.2.0a build 26405 and fail on 26422; the only exported-symbol difference between those two `libamdhip64` builds is `hipKernelSetAttributeForDevice@@hip_7.16`, which #13004 adds. The launch is still correctly refused — only the error code and, for graphs, the rejection point changed. `Negative_OversizedCluster` in the same file already expects `hipErrorInvalidClusterSize` and passes, so the two ZeroClusterDim cases are the stragglers. ## Technical Details The kernel is `CLUSTER_DIMS(0, 1, 1)`, i.e. a zero in one axis only. Direct launch — `UpdateNumClustersFromKernel`, `projects/clr/hipamd/src/hip_module.cpp:552-577`: required_cluster[i] = hasClusterAttr_ && clusterSize_[i] != 0 ? clusterSize_[i] : runtimeClusterSize_[i]; // -> {0, 1, 1} `<<<nbig, ntib>>>` supplies no dimensions, so `clusterDimsSpecified_` is false and `has_required_cluster` is true. That branch copies the requirement into `selected_cluster` and returns `hipErrorInvalidClusterSize` on the zero component. The test asserted `hipErrorInvalidConfiguration`. Graph — `ihipGraphAddKernelNode` calls `ihipResolveGraphClusterDimensions` (`hip_module.cpp:481-483`) before building launch params (`hip_graph.cpp:128-133`), and the resolver rejects a partially specified requirement outright. So `hipGraphAddKernelNode` now returns `hipErrorInvalidClusterSize`. On 26405 the node-add succeeds and `hipGraphInstantiate` returns `hipErrorInvalidConfiguration` instead. The test wrapped the node-add in `HIP_CHECK` and only tolerated a rejection at instantiate or launch, so it fails the moment the rejection moves earlier. This change requires `hipErrorInvalidClusterSize` in both cases and adds node creation to the set of valid rejection points, matching `Negative_OversizedCluster` three tests above. Requiring the specific code rather than also admitting `hipErrorInvalidConfiguration` keeps the test able to catch a regression back to the generic code; it does mean these cases now require a runtime carrying #13004, which is the pairing CI builds. The doc comment also drops its claim that this matches a zero dimension passed through `hipLaunchAttributeClusterDimension`. #13004 moved only the compiler-directive route, so the two no longer agree — measured directly on both stacks: route 26405 26422 __cluster_dims__(0,1,1) 9 1054 attr clusterDim {0,1,1} 9 9 Whether the attribute route should follow is a CLR question, so this change leaves it alone and only stops the comment from asserting an equivalence that no longer holds. ## Issue Tracking JIRA ID: none — no ticket exists for either failure. Behaviour changed by: #13004 (re-land of #10542, reverted by #12954) ## Test Plan gfx1250, two ROCm 10.2.0a tarball stacks in a container. First the shipped test binaries against their own libraries, plus single-library overrides to attribute the change. Then `ClusterTest` built from this branch and run against each stack, whole binary, to confirm no other case moves: ROCR_VISIBLE_DEVICES=0 ./ClusterTest \ "Unit_hipClusterLaunch_CompilerDirective_Negative_ZeroClusterDim[_Graph]" ## Test Result Component isolation, one library overridden per arm (`ldd` captured per run to confirm the override took): | libamdhip64 | libamd_comgr | libhsa-runtime64 | result | |---|---|---|---| | 26405 | 26405 | 26405 | pass | | 26422 | 26422 | 26422 | fail `1054 == 9` | | 26405 | 26422 | 26422 | pass | | 26422 | 26405 | 26405 | fail `1054 == 9` | | 26422 | 26405 | 26422 | fail | | 26405 | 26422 | 26405 | pass | The verdict follows `libamdhip64` in every arm; ROCr, comgr and the test binary are not the variable. The 26422 test binary passes on 26405 libraries and the 26405 test binary fails on 26422 libraries. Identical at 1, 2 and 4 visible GPUs. Observed in a full `hip_directed` run on both stacks: 26405 1 failure / 5054, 26422 3 failures / 5080, the two extra being these cases. The third failure, `Unit_hipDeviceFlushGPUDirectRDMAWrites_CapabilityConsistency`, fails on both stacks and is unrelated. `ClusterTest` built from this branch, whole binary: 26422 8 cases | 7 passed | 1 skipped 404 assertions | 404 passed 26405 8 cases | 5 passed | 2 failed | 1 skipped 404 assertions | 402 passed | 2 failed Both target cases pass on 26422 and no other case moves. On 26405 they fail `9 == 1054`, which is the intended signal: that runtime predates #13004 and returns the generic code. CI pairs hip-tests with a matching CLR, so this only shows up when a newer test binary is deliberately run against an older library set. ## Submission Checklist - [ ] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md.
Contributor
TheRock Submodule Bump ActivityNewest first
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Unit_hipClusterLaunch_CompilerDirective_Negative_ZeroClusterDimand its_Graphvariant fail onany runtime carrying #13004. They passed on ROCm 10.2.0a build 26405 and fail on 26422; the only
exported-symbol difference between those two
libamdhip64builds ishipKernelSetAttributeForDevice@@hip_7.16, which #13004 adds.The launch is still correctly refused — only the error code and, for graphs, the rejection point
changed.
Negative_OversizedClusterin the same file already expectshipErrorInvalidClusterSizeand passes, so the two ZeroClusterDim cases are the stragglers.
Technical Details
The kernel is
CLUSTER_DIMS(0, 1, 1), i.e. a zero in one axis only.Direct launch —
UpdateNumClustersFromKernel,projects/clr/hipamd/src/hip_module.cpp:552-577:<<<nbig, ntib>>>supplies no dimensions, soclusterDimsSpecified_is false andhas_required_clusteris true. That branch copies the requirement intoselected_clusterandreturns
hipErrorInvalidClusterSizeon the zero component. The test assertedhipErrorInvalidConfiguration.Graph —
ihipGraphAddKernelNodecallsihipResolveGraphClusterDimensions(
hip_module.cpp:481-483) before building launch params (hip_graph.cpp:128-133), and theresolver rejects a partially specified requirement outright. So
hipGraphAddKernelNodenowreturns
hipErrorInvalidClusterSize. On 26405 the node-add succeeds andhipGraphInstantiatereturns
hipErrorInvalidConfigurationinstead. The test wrapped the node-add inHIP_CHECKandonly tolerated a rejection at instantiate or launch, so it fails the moment the rejection moves
earlier.
This change requires
hipErrorInvalidClusterSizein both cases and adds node creation to the setof valid rejection points, matching
Negative_OversizedClusterthree tests above. Requiring thespecific code rather than also admitting
hipErrorInvalidConfigurationkeeps the test able tocatch a regression back to the generic code; it does mean these cases now require a runtime
carrying #13004, which is the pairing CI builds.
The doc comment also drops its claim that this matches a zero dimension passed through
hipLaunchAttributeClusterDimension. #13004 moved only the compiler-directive route, so the twono longer agree — measured directly on both stacks:
Whether the attribute route should follow is a CLR question, so this change leaves it alone and
only stops the comment from asserting an equivalence that no longer holds.
Issue Tracking
JIRA ID: none — no ticket exists for either failure.
Behaviour changed by: #13004 (re-land of #10542, reverted by #12954)
Test Plan
gfx1250, two ROCm 10.2.0a tarball stacks in a container. First the shipped test binaries against
their own libraries, plus single-library overrides to attribute the change. Then
ClusterTestbuilt from this branch and run against each stack, whole binary, to confirm no other case moves:
Test Result
Component isolation, one library overridden per arm (
lddcaptured per run to confirm theoverride took):
1054 == 91054 == 9The verdict follows
libamdhip64in every arm; ROCr, comgr and the test binary are not thevariable. The 26422 test binary passes on 26405 libraries and the 26405 test binary fails on 26422
libraries. Identical at 1, 2 and 4 visible GPUs.
Observed in a full
hip_directedrun on both stacks: 26405 1 failure / 5054, 26422 3 failures /5080, the two extra being these cases. The third failure,
Unit_hipDeviceFlushGPUDirectRDMAWrites_CapabilityConsistency, fails on both stacks and isunrelated.
ClusterTestbuilt from this branch, whole binary:Both target cases pass on 26422 and no other case moves. On 26405 they fail
9 == 1054, which isthe intended signal: that runtime predates #13004 and returns the generic code. CI pairs hip-tests
with a matching CLR, so this only shows up when a newer test binary is deliberately run against an
older library set.
Submission Checklist
https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md.