Skip zero-byte binning deallocations#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. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR optimizes zero-byte deallocation in the binning memory resource by adding early-return checks to both ChangesZero-byte deallocation optimization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 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
Description
Makes zero-byte
binning_memory_resourcedeallocations no-ops. This avoids routing zero-byte frees through bin selection, which could otherwise dispatch to an unrelated bin resource.Validation
BINNING_MR_TESTBINNING_MR_PTDS_TESTBINNING_MR_REF_TESTBINNING_MR_REF_PTDS_TESTChecklist