Public bug reported:

[Impact]
The libcomposable-kernel-tests binary package, and the composable-kernel-tests 
autopkgtest declared in debian/tests/control, have shipped no test binaries 
since the package was first imported (7.2.4-1~exp1). FULL_TEST was hard-coded 
to 0 in debian/rules, and the build/cktests/gfx* line in 
debian/libcomposable-kernel-tests.install was commented out. The package 
therefore only contained the wrapper scripts (run-tests, 
composable-kernel-tests), so the autopkgtest had nothing to run. Composable 
Kernel (CK) has no real test coverage in Ubuntu, either on GPU-enabled test 
infrastructure or for users who want to validate CK on their own hardware.
This update enables the per-architecture CK tests and examples at build time 
and ships them in libcomposable-kernel-tests. That makes the existing 
autopkgtest useful and gives validation coverage for the ROCm 10 stack bump.
Still, the tests should not be enabled by default, however, the package should 
have the option to build and ship its tests.

Changes:
- d/rules: set FULL_TEST ?= 1 so tests and examples are configured, built and 
installed for every architecture returned by rocm-target-arch.
- d/rules: copy the system googletest sources from /usr/src/googletest 
(GTEST_SYSTEM_SRC) into _deps/gtest-src and make them writable. Previously 
these were symlinked, which caused "Permission denied" errors when building as 
an unprivileged user.
- d/rules: change the thread calculation from NPROC / 8 to NPROC / 6 for 
non-Launchpad environments.
- d/bin/composable-kernel-tests: detect the GPU with amdgpu-arch, falling back 
to /usr/lib/rocm/llvm/bin/amdgpu-arch. The old amdgpu-arch-21 binary name no 
longer exists with the new toolchain.
- d/libcomposable-kernel-tests.install: re-enable installing build/cktests/gfx* 
to /usr/libexec/rocm/libcomposable-kernel-tests.
- d/control: add the runtime dependencies the test runner needs to 
libcomposable-kernel-tests: cmake for ctest and clang-tools-rocm for 
amdgpu-arch.

[Test Plan]
1. Build the package with sbuild with no special DEB_BUILD_OPTIONS/profiles. 
Check that the build finishes within the builder's resource limits and that 
libcomposable-kernel-tests contains 
/usr/libexec/rocm/libcomposable-kernel-tests/<arch>/{test,example} for every 
target architecture.
2. Check that <build_dir> paths have been rewritten in the shipped 
CTestTestfile.cmake files and now point to 
/usr/libexec/rocm/libcomposable-kernel-tests/<arch>/usr/bin.
3. On a machine with a supported AMD GPU, install libcomposable-kernel-tests 
and run /usr/libexec/rocm/libcomposable-kernel-tests/run-tests. Confirm that it 
detects the GPU architecture, maps gfx11*/gfx12* to the -generic targets, and 
runs ctest for test/ and example/.
4. Run autopkgtest (composable-kernel-tests) on GPU-enabled infrastructure and 
confirm it runs and reports results. On systems without a GPU it should be 
skipped (Restrictions: skippable).

[Where problems could occur]
- Build resources: building tests and examples for every architecture greatly 
increases build time, memory use and disk use. debian/rules already warns that 
a full test build "requires huge amount of memory/cpu". The .o cleanup before 
dh_auto_install was added because of earlier "No space left on device" 
failures. A build may time out or fail on Launchpad builders, and the higher 
thread count (NPROC/6) raises peak memory pressure in non-LP environments.
- Package size: libcomposable-kernel-tests becomes much larger, which affects 
mirror space and install time for anyone who installs it.
- Test runner: if amdgpu-arch reports an architecture that has no matching 
directory under /usr/libexec/rocm/libcomposable-kernel-tests, the wrapper fails 
instead of skipping.
- Rest of the archive: the change only touches the -tests binary package and 
the build process. The libraries in libcomposable-kernel-dev/-host-dev are 
built with the same flags as before, so the risk to reverse dependencies such 
as MIOpen is low.

[Other Info]
- Branch: ck-10.0-tests, target version 10.0-0ubuntu2 (stonking).
- Related: ROCm 10 stack bump, LP: #2164669.

** Affects: composable-kernel (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2169705

Title:
  Enable building test suite in libcomposable-kernel-tests

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/composable-kernel/+bug/2169705/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to