Route zero-byte binning allocations through bin resources - #2403
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
📝 WalkthroughWalkthroughThe PR removes the zero-size short-circuit from ChangesZero-byte allocation behavior
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cpp/tests/mr/binning_mr_tests.cpp (1)
31-43: ⚡ Quick winAdd alignment parameter for consistency.
Line 42 calls
deallocate_syncwith only 2 arguments (ptr and bytes), while line 41 explicitly passes the alignment parameter todeallocate. Based on the implementation signature at lines 87-89 of the implementation file,deallocate_syncrequires 3 parameters:ptr,bytes, andalignment.For consistency and clarity, consider adding the alignment parameter:
📝 Suggested change for consistency
mr.deallocate(cuda_stream_view{}, nullptr, 0, rmm::CUDA_ALLOCATION_ALIGNMENT); - mr.deallocate_sync(nullptr, 0); + mr.deallocate_sync(nullptr, 0, rmm::CUDA_ALLOCATION_ALIGNMENT);🤖 Prompt for 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. In `@cpp/tests/mr/binning_mr_tests.cpp` around lines 31 - 43, The test calls binning_mr::deallocate with an alignment but calls binning_mr::deallocate_sync without it; update the test (BinningTest::ZeroByteDeallocateIsNoOp) to pass the alignment to deallocate_sync as well (use the same rmm::CUDA_ALLOCATION_ALIGNMENT constant) so the call matches the deallocate_sync(ptr, bytes, alignment) signature in binning_mr and keeps behavior consistent with deallocate.
🤖 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.
Nitpick comments:
In `@cpp/tests/mr/binning_mr_tests.cpp`:
- Around line 31-43: The test calls binning_mr::deallocate with an alignment but
calls binning_mr::deallocate_sync without it; update the test
(BinningTest::ZeroByteDeallocateIsNoOp) to pass the alignment to deallocate_sync
as well (use the same rmm::CUDA_ALLOCATION_ALIGNMENT constant) so the call
matches the deallocate_sync(ptr, bytes, alignment) signature in binning_mr and
keeps behavior consistent with deallocate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: aa45d400-c99e-45f7-9942-f4922782d7cb
📒 Files selected for processing (2)
cpp/src/mr/detail/binning_memory_resource_impl.cppcpp/tests/mr/binning_mr_tests.cpp
|
Actually the better fix here is to always route zero-byte allocations and deallocations through the corresponding resource. That way they can be tracked or logged if that bin's resource has side-effects. The bug is really just that allocation and deallocation don't match. edit: Updated! |
|
/merge |
Description
Routes zero-byte
binning_memory_resourceallocations through the selected bin resource instead of returningnullptrdirectly. Deallocations already route through the selected resource, so this keeps zero-byte allocation/deallocation behavior matched and preserves side effects from bin resources such as logging or tracking.Adds a regression test that verifies zero-byte async and sync allocation/deallocation calls reach the bin resource.
Checklist