[II] Own borrowed weights before deferred online processing - #305
voipmonitor wants to merge 1 commit into
Conversation
Layerwise online processing can retain loader arguments until all parameters for a layer arrive. Clone InstantTensor borrowed views at that ownership boundary so staging-buffer reuse cannot change a deferred weight. Assisted-by: OpenAI Codex Signed-off-by: Martin Vit <martin@voipmonitor.org>
|
Warning Review limit reached
Next review available in: 49 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Superseded by the deferred accelerator-tensor ownership rule merged through #382. Commit |
Status
Purpose
Preserve weight values when layerwise online quantization defers a parameter
loader while InstantTensor uses borrowed staging-buffer views.
Resulting behavior
make_online_process_loader()may retain bound loader arguments until everyparameter required by the layer is available. A tensor marked
_vllm_instanttensor_borrowedis cloned before entering that deferred state.Unmarked tensors and loaders that consume their inputs synchronously retain
their allocation behavior.
The owned copy is scoped to the incomplete layer and released after online
processing. This avoids the checkpoint-wide memory cost of
INSTANTTENSOR_COPY=1while preventing staging-buffer reuse from changing adeferred weight.
Technical reason
InstantTensor borrowed mode permits the loader to reuse backing storage after
the iterator advances. Layerwise online processing retained the borrowed view
in
LayerReloadingInfo.loaded_weights. A later tensor load could overwrite aparameter before the layer's online quantizer consumed it.
Pull request #281 defines the borrowed-buffer contract and requires retaining
consumers to materialize owned storage. This change enforces that contract at
the layerwise deferred-loader ownership boundary.
Compatibility
The clone is gated by the explicit borrowed-tensor marker. Safetensors,
owned-copy InstantTensor loads, ordinary parameter loaders, and completed
layers do not acquire an additional copy.
Validation
Focused tests in the Infernal Invocation CUDA 13.3 / PyTorch 2.13 image:
Ruff check, Ruff format, and
git diff --checkpassed for the implementationand tests.
Exact-image E2E qualification used:
completed preparation.
703for37 * 19.127.22 aggregate tok/s with zero request errors.
Machine-readable evidence:
https://github.com/local-inference-lab/blackwell-llm-docker/blob/6f92a9ecff35f0dabd6f444b05daab4024b49257/validation/infernal-invocation-r11-local-gpu.json
Duplicate-work check
Open local and upstream pull requests and issues were searched for
InstantTensor borrowed-buffer ownership in deferred layerwise processing. No
overlapping implementation was found. Pull request #281 is the prerequisite
producer contract rather than a duplicate consumer-side fix.
Qualification boundary
The E2E result qualifies the checkpoint revision and TP4/DCP1/MTP3 profile
above. Other retained consumers still require their own ownership audit; this
pull request changes only layerwise online processing.
AI assistance
AI assistance was used for investigation, implementation, validation, and
pull-request text. The human submitter must review and be able to defend every
changed line before merge.