[https://nvbugs/6674826][fix] Drop overlap hint from KV cache page-index upload - #18694
Conversation
|
/bot run --disable-fail-fast |
|
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)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughThe page-index device copy uses zero memcpy flags for CUDA 12.8 and newer. The integration waiver list adds skips for four Flux text-to-image end-to-end tests linked to NVIDIA bug 6720250. ChangesCUDA memcpy update
Integration test waivers
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to The change avoids the affected CUDA page-index copy path and adds targeted Flux test waivers. No current merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
PR_Github #71404 [ run ] triggered by Bot. Commit: |
50072af to
f7eb4f0
Compare
|
PR_Github #71404 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #71478 [ run ] triggered by Bot. Commit: |
…dex upload
copyPageIndicesToDevice() uploads page indices from a pageable host buffer
using CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL, whose documented contract is
that "all accesses must be complete before the API call returns" - so the
caller may reuse the source as soon as the call returns, with no stream sync.
Setting CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE alongside it breaks that
guarantee. The hint makes the driver skip its inline (I2M) path and route the
copy through a staged host->device path that reads the source after
cuMemcpyBatchAsync has already returned, so the device receives whatever the
caller wrote next instead of the page indices. This surfaced as
KvCacheManagerV2StagingBufferTest.EphemeralHostIndicesUploadIntoDeviceRing
reading back the caller's sentinel value, and in production would push stale
indices during cold-page migration and silently corrupt KV cache pages.
The driver defect is tracked as nvbugs 6718200 with a standalone reproducer;
this change is the caller-side mitigation.
Only the page-index upload is changed. copyColdPageDataBatch() keeps the hint:
it uses CU_MEMCPY_SRC_ACCESS_ORDER_STREAM, which does not go through the
defective branch, and it carries the bulk transfers where overlap matters.
Also remove the waiver this bug added:
cpp/test_unit_tests.py::test_unit_tests[batch_manager-80] SKIP (nvbugs/6674826)
That waiver skips the whole batch_manager C++ unit suite, so without removing
it the fix is never exercised in CI and the bug cannot move to verify-to-close.
Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
f7eb4f0 to
5c0ea83
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #71500 [ run ] triggered by Bot. Commit: |
|
PR_Github #71478 [ run ] completed with state |
|
PR_Github #71500 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #71530 [ run ] triggered by Bot. Commit: |
|
PR_Github #71530 [ run ] completed with state |
copyPageIndicesToDevice() uploads page indices from a pageable host buffer using CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL, whose documented contract is that "all accesses must be complete before the API call returns" — so the caller may reuse the source as soon as the call returns, with no stream sync.
Setting CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE alongside it breaks that guarantee. The hint makes the driver skip its inline (I2M) path and route the copy through a staged host->device path that reads the source after
cuMemcpyBatchAsynchas already returned, so the device receives whatever the caller wrote next instead of the page indices.This surfaced as
KvCacheManagerV2StagingBufferTest.EphemeralHostIndicesUploadIntoDeviceRingreading back the caller's sentinel value (nvbugs 6674826). In production the same path carries KV cache page indices, so a cold-page migration would push stale indices and silently corrupt KV cache pages.The driver defect is tracked as nvbugs 6718200 with a standalone reproducer; this change is the caller-side mitigation.
Only the page-index upload is changed.
copyColdPageDataBatch()keeps the hint: it usesCU_MEMCPY_SRC_ACCESS_ORDER_STREAM, which does not go through the defective branch, and it carries the bulk transfers where overlap matters.Test Coverage
KvCacheManagerV2StagingBufferTest.EphemeralHostIndicesUploadIntoDeviceRing— the existing test that caught this. It fails on an affected driver (CUDA UMD 13.4/13.5) and passes with this change.PR Checklist
[JIRA/NVBUG/None][type] summary🤖 Generated with Claude Code
Dev Engineer Review
CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTEfrom CUDA 12.8+ page-index uploads.copyColdPageDataBatch().cpp/test_unit_tests.py::test_unit_tests[batch_manager-80].QA Engineer Review
tests/integration/test_lists/waives.txt.cpp/test_unit_tests.py::test_unit_tests[batch_manager-80]waiver.