Skip to content

Adding kfdtest to The Rock CI. - #5377

Merged
andmar-amd merged 1 commit into
mainfrom
users/andmar-amd/kfdtest
Jun 24, 2026
Merged

andmar-amd merged 1 commit into
mainfrom
users/andmar-amd/kfdtest

Conversation

@andmar-amd

@andmar-amd andmar-amd commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Add kfdtest to TheRock CI

- Add kfdtest subproject with correct dependencies (statically links libhsakmt and LLVM)
- Use run_kfdtest.sh script which handles platform-specific test exclusions
- Add --kfdtest flag to install_rocm_from_artifacts.py
- Add kfdtest to BUILD_TOPOLOGY.toml (artifact group, build stage, and artifact)
- Add sysdeps to kfdtest artifact dependencies for bundled libraries
- Use get_target_property to dynamically locate ROCR-Runtime binary directory
- Set RPATH to lib/rocm_sysdeps/lib only (kfdtest statically links main deps)
- Support both standard and quick test modes via TEST_TYPE environment variable

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

@andmar-amd
andmar-amd force-pushed the users/andmar-amd/kfdtest branch 4 times, most recently from 351352c to 13df289 Compare May 22, 2026 18:34
@andmar-amd

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 951302eb.

The two conflicts were:

  • BUILD_TOPOLOGY.toml: Kept kfdtest in the compiler-runtime stage and removed rocrtst (which was moved to the runtime-tests stage in main).
  • core/CMakeLists.txt: Aligned the new kfdtest block with the updated rocrtst structure from main, using if(THEROCK_BUILD_TESTING AND THEROCK_ENABLE_CORE_KFDTESTS) instead of the nested if pattern.

@andmar-amd
andmar-amd force-pushed the users/andmar-amd/kfdtest branch 20 times, most recently from af4c61c to 33d729e Compare June 6, 2026 04:08

# Run on node 7 only to avoid flaky SDMA queue tests on other nodes
# Node 7 has shown consistent test success in CI
cmd.extend(["-n", "7"])

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.

We should not hardcode this. Flaky SDMA queue tests are symptom of other underlying issues that need to be resolved.

@andmar-amd andmar-amd Jun 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Greetings @saadrahim

Thank for the comment. This was just an attempt to see it would succeed here. Is there a way to get a node exclusively for kfdtest? Is does not play well with sharing the GPU, it has to have the node for itself . As for how long it would take to run this full test, it averages to about 20 minutes.

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.

I believe you should consider it a requirement to make the tests work on a shared GPU. What feature does the test exercise that all GPUs are impacted? Can you separate the ones that cannot share GPUs because they test a feature that impacts all GPUs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@kentrussell could articulate better on this.

But it is not that it need all of the GPU nodes, it just needs 1 in the set, and it need to have all by itself or it may crash. FTR it does run on all the GPU node available, if it is not controlled with a '-n', and this usually will be green if there is no other process sharing that specific node. Since it looks like you have 8+ nodes on this ASIC , just show me how I can lock 1 exclusively for kfdtest and then I would release it when the test is complete.

@kentrussell kentrussell Jun 16, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

While kfdtest can benefit from running on all GPUs, there is a lot of redundancy. The majority of subtests are testing the thunk+kernel interface, and it's not designed to be a HW validation tool like agfhc. Yes certain GPUs could throw failures in certain cases where previous ones did not, but it's rare. For TheRock CI, a single GPU is sufficient, since that covers the interfaces well enough, and speeds up the test by 7x
The big issue is that a number of subtests don't play well with others. Allocating all VRAM (or more), triggering faults, triggering GPU resets, etc. These all conflict with running other tests simultaneously

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.

kfdtest is designed to test the driver. TheRock CI does not gate the driver releases. Therefore, updating the driver may break TheRock builds if a failure is introduced in the driver and is caught in TheRock CI through kfdtests. From a testability perspective, I do not support its enablement in TheRock. I think you need to consult with leadership on the CI side. Fixing a defect in the driver has no associated source code in TheRock as well.

@amd-aakash @suchitravemuri1 @ScottTodd @marbre

We also cannot publish kfdtests as a component versioned with ROCm, it needs to be versioned with the AMD GPU driver.

@saadrahim

Copy link
Copy Markdown
Member

PLATFORM_MAP is defined but never referenced (the comment says detection is automatic) — dead code.
The large commented-out ADDITIONAL_EXCLUDE block is dead code; if container exclusions aren't needed in TheRock CI, delete it rather than ship it commented.
SHARD_INDEX/TOTAL_SHARDS defaults are ints (os.getenv(..., 1)) while env values are strings; it works because of later int(...) casts, but it's inconsistent.
In core/CMakeLists.txt, the existing rocrtst block gets re-indented (whitespace-only churn) just to nest the new if(... CORE_KFDTESTS) beside it. That inflates the diff and makes blame noisier — better to add the new block without reformatting the old one.

@geomin12 geomin12 left a comment

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.

Comment thread core/CMakeLists.txt Resolved

@geomin12 geomin12 left a comment

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.

please provide better PR description

@andmar-amd
andmar-amd force-pushed the users/andmar-amd/kfdtest branch 5 times, most recently from a1002e8 to f34793d Compare June 18, 2026 18:48

@nunnikri nunnikri left a comment •

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.

kfdtest is an internal amdgpu driver test. Its not testing user space ROCm. It need not be part of TheRock/ROCm ci. Or I would suggest to make it as 2 part change. bringing the kfdtest artifact to ROCm as first step and adding to TheRock ci be a different PR which need more consideration.
@saadrahim @amd-aakash could you clarify?

@saadrahim

Copy link
Copy Markdown
Member

kfdtest is an internal amdgpu driver test. Its not testing user space ROCm. It need not be part of TheRock/ROCm ci. Or I would suggest to make it as 2 part change. bringing the kfdtest artifact to ROCm as first step and adding to TheRock ci be a different PR which need more consideration. @saadrahim @amd-aakash could you clarify?

Yes, adding it as a build artifact is the best approach. There is no need to add to CI for testing. kfdtests is only being built for historic purposes and should be removed in the future.

@nunnikri

Copy link
Copy Markdown
Contributor

kfdtest is an internal amdgpu driver test. Its not testing user space ROCm. It need not be part of TheRock/ROCm ci. Or I would suggest to make it as 2 part change. bringing the kfdtest artifact to ROCm as first step and adding to TheRock ci be a different PR which need more consideration. @saadrahim @amd-aakash could you clarify?

Yes, adding it as a build artifact is the best approach. There is no need to add to CI for testing. kfdtests is only being built for historic purposes and should be removed in the future.

@andmar-amd do you want to remove build_tools/github_actions/test_executable_scripts/test_kfdtest.py based on this?

@andmar-amd
andmar-amd force-pushed the users/andmar-amd/kfdtest branch from f34793d to 0682781 Compare June 24, 2026 17:33
@therock-pr-bot

therock-pr-bot Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
🌿 Branch Name ✅ Pass —
📝 PR Title/Description ❌ Fail Error: Title does not follow Conventional Commits style.
Expected: start with a valid type (feat, fix, docs, …).
Desired format: type(optional-scope): short description
───
Error: PR description must reference a JIRA ID or ISSUE ID.
Expected: include a JIRA ID or ISSUE ID line. The separator may be : or - (or omitted), and the value can be a JIRA key, a number (with or without #), or a link. Accepted examples:
• JIRA ID : TESTAUTO-6039
• JIRA ID - #330
• JIRA ID #330
• ISSUE ID : TESTUTO-3334
• ISSUE ID #3334
• ISSUE ID - TESTAUTO-3433
• ISSUE ID : https://github.com/<org_name>/<repo_name>/issues/1234
Current: no valid JIRA/ISSUE reference found
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ❌ Fail Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: build_tools/install_rocm_from_artifacts.py; no test file found
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

⚠️ 2 policy check(s) failed. Please address the issues above before this PR can be Reviewed.

🚫 Please fix the failed policies

  • ❌ PR Title/Description
  • ❌ Unit Test

The Not ready to Review label was added to this PR. Once all policies pass, the label is removed automatically.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

@therock-pr-bot therock-pr-bot Bot added the Not ready to Review PR has unresolved policy failures — reviews blocked label Jun 24, 2026
@therock-pr-bot

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Title/Description
  • ❌ Unit Test

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

@andmar-amd

Copy link
Copy Markdown
Contributor Author

Greetings @nunnikri @saadrahim

Yes I have completely remove the build_tools/github_actions/test_executable_scripts/test_kfdtest.py and other references to testing. As you can see AI review is now failing for missing unit test.

- Add kfdtest subproject with correct dependencies (statically links libhsakmt and LLVM)
- Add --kfdtest flag to install_rocm_from_artifacts.py
- Add kfdtest to BUILD_TOPOLOGY.toml (artifact group, build stage, and artifact)
- Add sysdeps to kfdtest artifact dependencies for bundled libraries
- Use get_target_property to dynamically locate ROCR-Runtime binary directory
- Set RPATH to lib/rocm_sysdeps/lib only (kfdtest statically links main deps)

JIRA ID: AILIKFD-40

Co-Authored-By: Claude Sonnet 4.5
Signed-off-by: Andrew Martin <andrew.martin@amd.com>
@andmar-amd
andmar-amd force-pushed the users/andmar-amd/kfdtest branch from 0682781 to 7eb2380 Compare June 24, 2026 17:57

@saadrahim saadrahim left a comment

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 is needed temporarily until we find a new home for kfdtests.

@nunnikri nunnikri left a comment

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.

Discussed with @saadrahim. BU is good to release kfdtest as it is. So approving.

@andmar-amd
andmar-amd merged commit 1d06dd2 into main Jun 24, 2026
22 of 23 checks passed
@andmar-amd
andmar-amd deleted the users/andmar-amd/kfdtest branch June 24, 2026 18:17
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Jun 24, 2026
@jayhawk-commits

Copy link
Copy Markdown
Contributor

Latest ASAN builds are failing on main due to kfdtest, I will revert this commit.
Example log: https://github.com/ROCm/TheRock/actions/runs/28172850345/job/83441457289

@stellaraccident

Copy link
Copy Markdown
Collaborator

Latest ASAN builds are failing on main due to kfdtest, I will revert this commit. Example log: https://github.com/ROCm/TheRock/actions/runs/28172850345/job/83441457289

[kfdtest] ld.lld: error: unable to find library -lhsakmt
[kfdtest] ld.lld: error: unable to find library -lnuma
[kfdtest] clang++: error: linker command failed with exit code 1 (use -v to see invocation)

This doesn't look like it would be as an specific and I would expect that it would impact the non asan builds too. It will need cmake plumbing changes to detect the proper in tree dependencies for those two deps.

jayhawk-commits added a commit that referenced this pull request Jun 25, 2026
@andmar-amd
andmar-amd restored the users/andmar-amd/kfdtest branch July 3, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Not ready to Review PR has unresolved policy failures — reviews blocked

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants