Fix RAFT_LOG_TRACE_VEC after the rapids-logger migration - #3105
Fix RAFT_LOG_TRACE_VEC after the rapids-logger migration#3105Wint3rNight wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughChangesThe trace vector logging macro now uses typed trace logging and qualified vector formatting. CUDA tests cover host and device pointer logging, with the test source added to the core test target. Trace Vector Logging
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change repairs TRACE-level vector logging compilation failures and adds host/device coverage; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cpp/tests/core/logger.cu`:
- Around line 42-49: Replace the raw device_data allocation and manual cudaFree
with the project-standard RAII device container, preserving the existing size
and host-to-device copy behavior. Update the cudaMemcpy destination and
RAFT_LOG_TRACE_VEC call to use the container’s data() pointer, ensuring
ownership remains automatic if either operation fails.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 8dc94097-fd60-4037-aad1-0eb7ce8364a4
📒 Files selected for processing (3)
cpp/include/raft/core/logger.hppcpp/tests/CMakeLists.txtcpp/tests/core/logger.cu
Closes #2622.
Building with LIBRAFT_LOGGING_LEVEL=TRACE fails to compile. The issue reports one broken symbol; there are actually three, all left behind by #2566 when the logger moved to rapids-logger:
raft::detail::format was removed in that PR — replaced with direct stream insertion, which is all it was doing here
print_vector is unqualified so it doesn't resolve — now raft::print_vector
log() is passed RAPIDS_LOGGER_LOG_LEVEL_TRACE where it wants rapids_logger::level_enum::trace, which is what the sibling RAFT_LOG_TRACE already uses
Added cpp/tests/core/logger.cu covering the host and device pointer paths. The existing ext_headers test only does a bare #include <raft/core/logger.hpp> at the default log level, so the macro body expands to void(0) and is never compiled — which is why this went unnoticed since the migration. The new test raises the level for that translation unit only; reverting the fix makes it fail to build.
Callers still need raft/util/cudart_utils.hpp for print_vector. The macro only expands at the call site, so core/ doesn't take a dependency on util/.