Skip to content

[GG] loader: add explicit InstantTensor borrowed-buffer mode - #281

Merged
lukealonso merged 1 commit into
dev/gilded-gnosisfrom
codex/gg-instanttensor-zero-copy-contract-20260810
Aug 11, 2026
Merged

lukealonso merged 1 commit into
dev/gilded-gnosisfrom
codex/gg-instanttensor-zero-copy-contract-20260810

Conversation

@voipmonitor

Copy link
Copy Markdown

Summary

Add an explicit, opt-in InstantTensor borrowed-buffer mode for large model
loads. INSTANTTENSOR_COPY=0 forwards copy=False to safe_open; the default
remains the existing owned-copy behavior.

Why

The R7 EXL3 checkpoint is close enough to the per-rank memory ceiling that an
extra loader-owned copy can OOM before quantized weights finish preparation.
InstantTensor already supports borrowed buffers, but vLLM did not expose that
contract and therefore always requested copied tensors.

Contract

  • INSTANTTENSOR_COPY=1 is the default and preserves current behavior;
  • INSTANTTENSOR_COPY=0 requests borrowed tensors and marks each yielded tensor
    with _vllm_instanttensor_borrowed=True;
  • parameter loaders consume borrowed tensors synchronously; a loader that
    retains one beyond the yield must materialize owned storage;
  • values other than 0 or 1 fail immediately with a clear error.

This PR deliberately does not change InstantTensor's default or the model
quantization runtime.

Validation

  • focused iterator tests: 3 passed, 1 skipped;
  • tests verify both copy modes, marker behavior, forwarded arguments, and
    invalid configuration;
  • clean 4x RTX PRO 6000 Blackwell TP4 model load completed with
    LOAD_FORMAT=instanttensor, BUFFERED backend, and INSTANTTENSOR_COPY=0;
  • the resulting model passed full-graph MTP0/MTP3 decode, 8k/64k prefill,
    prompt-logprob, and correctness smoke tests;
  • Ruff, formatting, and git diff --check: pass.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@voipmonitor, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a7fa849a-a8c1-4644-b88e-2508e315bd6d

📥 Commits

Reviewing files that changed from the base of the PR and between e2666d9 and 126039a.

📒 Files selected for processing (2)
  • tests/model_executor/model_loader/instanttensor_loader/test_weight_utils.py
  • vllm/model_executor/model_loader/weight_utils.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants