Skip to content

[Test] Add kfd test - #47

Open
pranavprakash-amd wants to merge 6 commits into
mainfrom
users/pranavprakash-amd/kfd
Open

[Test] Add kfd test#47
pranavprakash-amd wants to merge 6 commits into
mainfrom
users/pranavprakash-amd/kfd

Conversation

@pranavprakash-amd

Copy link
Copy Markdown

Motivation

Add end-to-end test coverage for KFD (Kernel Fusion Driver) — the AMD GPU kernel driver / thunk layer (libhsakmt) at the very base of the ROCm
stack. KFD sits below the HIP runtime, so validating it directly closes a gap at the lowest software layer of our e2e coverage. This ports the
legacy ROCmTest tests/KFD/kfd.py into the marker-compliant rocm-tests framework.

Technical Details

Ports ROCmTest's class-based KFD.execute(executeData) into tests/e2e/kfd/, driving the upstream kfdtest GTest suite from the libhsakmt project.

  • tests/e2e/kfd/test_kfd.py — four tests mirroring the original's coverage:
    • test_kfd_smoke (runtime.fast) — enumerates KFD suites via --gtest_list_tests; proves the binary links against libhsakmt and launches.
    • test_kfd_full_suite (ci.weekly, runtime.soak) — the full run_kfdtest.sh default run.
    • test_kfd_hmm_svm (runtime.medium) — HMM/SVM path (KFDSVMRangeTest/KFDSVMEvictTest), mirroring the original "HMM" case.
    • test_kfd_multi_gpu_parallel (hw.multi_gpu, gpu_count("ALL"), runtime.medium) — parallel multi-GPU mode via HSA_TEST_GPUS_NUM, mirroring
      --hsa_test_gpus_num.
  • tests/e2e/kfd/conftest.py — session-scoped kfdtest_binary fixture that sparse-clones the whole libhsakmt project from the ROCm/rocm-systems
    monorepo (not just tests/kfdtest, since its CMakeLists resolves thunk headers via ../../include) and CMake-builds it against the resolved
    TheRock/ROCm install. Includes fail-fast guards: an actionable skip when libdrm/libnuma pkg-config deps are un-provisioned, and a clear error when
    the sibling include/ tree is missing from a stale checkout.
  • framework/builder/binary_builder.py — clone_repo now re-asserts the sparse-checkout spec on a reused cached checkout (both local and remote
    paths), so a narrower checkout from an earlier run is widened rather than silently missing newly-needed files.
  • framework/markers/taxonomy.py — new tests/e2e/kfd category profile (hw.gpu, layer.runtime, ci.nightly, e2e.stack, os.linux).
  • pyproject.toml — disable pylint R0917 (too-many-positional-arguments), since pytest injects fixtures positionally.

Host provisioning (OS build deps, GCC pinning) is intentionally not ported into test code — nodes are provisioned via --pre-install pkg=libdrm-dev
/ pkg=libnuma-dev. GPU selection/visibility is left to target_executor (which injects ROCR_VISIBLE_DEVICES) rather than the original's fragile
host-topology -n offset.

Test Plan

  • Marker-lint hook validated all files under tests/e2e/kfd/ at write time.
  • Collection preview: pytest tests/e2e/kfd/ --collect-only -q --no-gpu
  • Smoke gate on a gfx942 node: pytest tests/e2e/kfd/test_kfd.py::test_kfd_smoke --gpu-arch gfx942 -v
  • Nightly subset (smoke + HMM/SVM): pytest tests/e2e/kfd/ -m "hw.gpu and ci.nightly" --gpu-arch gfx942 -v
  • Multi-GPU parallel path on a ≥2-GPU node.

Test Result

image -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ====================================================== ROCm Test Suite Summary ====================================================== Test Directory PASS FAIL SKIP ERROR Duration ───────────────────────────────────────────────────── tests/e2e/kfd 2 0 0 0 244.7 s ───────────────────────────────────────────────────── TOTAL 2 tests │ 2 passed │ 0 failed │ 0 skipped │ 0 error │ 244.7 s ================================================================= ================================================================== ====================================== 2 passed, 2 deselected, 1 warning in 245.89s (0:04:05) =======================================

Submission Checklist

Signed-off-by: Pranav Prakash <pranav.prakash@amd.com>
@pranavprakash-amd
pranavprakash-amd force-pushed the users/pranavprakash-amd/kfd branch from 071cb3e to 526fab8 Compare July 23, 2026 04:40
Comment thread tests/e2e/kfd/conftest.py Outdated
Comment thread tests/e2e/kfd/conftest.py Outdated
Comment thread framework/markers/taxonomy.py Outdated
Comment thread tests/e2e/kfd/conftest.py Outdated
Comment thread tests/e2e/kfd/conftest.py
Comment thread tests/e2e/kfd/conftest.py
Comment thread tests/e2e/kfd/conftest.py Outdated
@mparamas-amd mparamas-amd removed the Review PR ready for review label Jul 24, 2026
Signed-off-by: Pranav Prakash <pranav.prakash@amd.com>
Signed-off-by: Pranav Prakash <pranav.prakash@amd.com>
Signed-off-by: Pranav Prakash <pranav.prakash@amd.com>
@pranavprakash-amd pranavprakash-amd added the Review PR ready for review label Aug 3, 2026
Signed-off-by: Pranav Prakash <pranav.prakash@amd.com>
@pranavprakash-amd

Copy link
Copy Markdown
Author

====================================================== ROCm Test Suite Summary ======================================================
Test Directory PASS FAIL SKIP ERROR Duration
─────────────────────────────────────────────────────
tests/e2e/kfd 1 3 0 0 2389.3 s
─────────────────────────────────────────────────────
TOTAL 4 tests │ 1 passed │ 3 failed │ 0 skipped │ 0 error │ 2389.3 s

============================================= 3 failed, 1 passed in 2403.73s (0:40:03) ==============================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review PR ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants