ci: add code coverage for header-only ROCm libraries (rocPRIM/hipCUB/rocThrust)#9287
ci: add code coverage for header-only ROCm libraries (rocPRIM/hipCUB/rocThrust)#9287jainprad wants to merge 87 commits into
Conversation
The current therock_configure_ci.py doesn't have a clean way to only configure the project that has changed, and not other components that the changed component has been grouped together with. For code coverage reports, it does not make sense to even test downstream components.
…erage_lib_v2 Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # .github/workflows/therock-test-component.yml # projects/rocfft/CMakeLists.txt
The develop merge pulled in "feat(rocrand): use primbench (#4454)", whose benchmark unconditionally links amd_smi and includes <amd_smi/amdsmi.h> on Linux. Narrowed builds that do not stage the amd-smi dev headers (e.g. the code-coverage builds, which enable only RAND/FFT) then fail to compile the rocRAND benchmark, which cascades to skipped test/report jobs so no profraw or coverage report is produced for hipRAND/rocRAND/rocFFT. Detect the amd-smi dev header and only enable monitoring (link amd_smi) when present; otherwise build the benchmark with PRIMBENCH_NO_MONITORING. This matches primbench's own soft-dependency design and keeps full builds (header present) unchanged while unblocking the coverage builds. Co-authored-by: Cursor <cursoragent@cursor.com>
…cThrust) Header-only libraries have no shared object to instrument, so coverage is collected from their instrumented test binaries. Split out from the shared-object coverage work so it can be developed independently. - therock_configure_coverage.py: activate rocPRIM/hipCUB/rocThrust (PRIM group), each with a per-project coverage_config path. - Per-project test_categories_coverage.yaml under each project's test/ dir (test_binaries prefixes); drop the combined root file. export_coverage_metadata.py now reads the flat per-project file. - therock-ci-coverage.yml: pass the instrumented test binaries (staged under coverage-objects/test) to llvm-cov as -object; thread coverage_config through the matrix. - rocThrust: fall back to the bundled SQLite when the system package is unsuitable (TheRock coverage builds report SQLite version "unknown"), so the PRIM-group configure step does not hard-fail. - codecov.yml: add the rocPRIM flag. Co-authored-by: Cursor <cursoragent@cursor.com>
…ents only Header-only coverage (rocPRIM/hipCUB/rocThrust) is split into its own PR (users/jainprad/codecoverage_lib_header_only -> develop, ROCm#9287). Remove it here: - the disabled header-only metadata dict in therock_configure_coverage.py - the *_ENABLE_COVERAGE options + instrumentation blocks in the rocPRIM/hipCUB/ rocThrust CMakeLists (pre-existing BUILD_CODE_COVERAGE/CODE_COVERAGE untouched) This PR now covers only the shared-object components: hipRAND, rocRAND, rocFFT, rocBLAS. Co-authored-by: Cursor <cursoragent@cursor.com>
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
The prior cleanup deleted the pre-existing if(BUILD_CODE_COVERAGE) / if(CODE_COVERAGE) instrumentation blocks instead of only reverting the <PROJECT>_ENABLE_COVERAGE guard rename, so the PR still modified these files. Restore all three to develop verbatim so this PR does not touch the header-only projects at all (they live in ROCm#9287). Co-authored-by: Cursor <cursoragent@cursor.com>
malcolmroberts
left a comment
There was a problem hiding this comment.
This changes variables in the fft libraries, so the title doesn't match.
Also, we already had a cmake variable for doing code coverage; there is no reason for this to change; please revert.
|
@jainprad - could you please add your name to your github account? It's hard to figure out who to talk to about these things. |
This PR is scoped to the header-only libraries (rocPRIM / hipCUB / rocThrust). Restore the shared-object components' CMakeLists (hipRAND / rocRAND / rocFFT / rocBLAS) to develop verbatim so they are not part of this PR - they are covered in the shared-object PR (#8656). Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (76.92%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #9287 +/- ##
===========================================
- Coverage 64.99% 64.84% -0.15%
===========================================
Files 2685 2685
Lines 422111 422132 +21
Branches 62707 62702 -5
===========================================
- Hits 274339 273722 -617
- Misses 127073 127785 +712
+ Partials 20699 20625 -74
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
Summary
Enables code-coverage CI for the header-only libraries — rocPRIM, hipCUB, rocThrust — split out from the shared-object coverage work (hipRAND/rocRAND/rocFFT/rocBLAS, tracked in #8656). Header-only libraries have no shared object to instrument, so coverage is collected from their instrumented test binaries.
Branched from the coverage infrastructure (following #9221's
users/<user>/…→developconvention) and scoped to the header-only components.Changes
.github/scripts/therock_configure_coverage.py: coverage matrix = rocPRIM / hipCUB / rocThrust (PRIM group), each with a per-projectcoverage_configpath.test_categories_coverage.yamlunder each project'stest/dir (test-binary name prefixes); the combined root file is removed andexport_coverage_metadata.pynow reads the flat per-project file..github/workflows/therock-ci-coverage.yml: the report step passes the staged instrumented test binaries (coverage-objects/test/*) tollvm-covas-object;coverage_configis threaded through the matrix.projects/rocthrust/cmake/Dependencies.cmake: fall back to the bundled SQLite when the system package is unsuitable (TheRock coverage builds report SQLite version "unknown"), so the PRIM-group configure step does not hard-fail.codecov.yml: add therocPRIMflag.Test plan
rocPRIM/hipCUB/rocThrustMade with Cursor
Made with Cursor