Skip to content

[multi-lora] 1/n - 8, fix: skip base-weight update session for LoRA sync - #2715

Open
yushengsu-thu wants to merge 1 commit into
radixark:mainfrom
yushengsu-thu:fix/lora-skip-base-weight-session
Open

[multi-lora] 1/n - 8, fix: skip base-weight update session for LoRA sync#2715
yushengsu-thu wants to merge 1 commit into
radixark:mainfrom
yushengsu-thu:fix/lora-skip-base-weight-session

Conversation

@yushengsu-thu

Copy link
Copy Markdown
Collaborator

Summary

  • keep pause/cache-flush, adapter transfer, weight-version update, and resume unchanged
  • skip begin_weight_update / end_weight_update for LoRA-only distributed sync
  • preserve the existing base-weight session for full-parameter sync
  • cover both lifecycle paths with a focused regression test

This is intentionally a small PR against main; the stacked Multi-LoRA PR #2273 can rebase onto it.

Why

The distributed LoRA path sends only adapter tensors (lora_A / lora_B). It never refills base-model weights, so it must not open a base-weight update session.

On W4A16 MoE models, SGLang's begin_weight_update restores the quantized base buffers to checkpoint shapes, while end_weight_update runs post-load packing again. With no base weights loaded between those calls, already-packed Marlin bytes/scales are interpreted and packed a second time, corrupting the frozen base model. A zero-initialized LoRA does not prevent this because the corruption happens in the base session itself.

Full-model reproduction

Reproduced on the official full moonshotai/Kimi-K2.5 checkpoint (61 layers, W4A16), current sglang-miles@cb05a44f35a7, TP8 on 8x H200:

  1. Baseline bare generation was coherent; checksum was 2218b65dab1fa8c0ba4139e47ba30407eab0c9002ba3459bce2556b1c28b08a4.
  2. Loaded a rank-32 identity LoRA covering q_a_proj in all 61 layers (lora_B=0) without a base-weight session. The checksum and deterministic bare generation were unchanged.
  3. Ran an otherwise empty begin_weight_update -> end_weight_update session. The checksum changed to b17b4e8b6e0066480873dd373ba2cb039deba301a6f7180aeb1ab945b0e9c400, and bare generation immediately became repeated Python tokens.

Across all eight TP ranks, exactly 240 tensors changed: layers 1-60 x {w13_weight_packed, w13_weight_scale, w2_weight_packed, w2_weight_scale}. No tensor changed in the LoRA-only control.

Validation

Run on an H200 Linux devbox:

  • focused test file: 25 passed
  • all tests/fast/backends/megatron_utils: 263 passed
  • pre-commit on both changed files: passed

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@yushengsu-thu yushengsu-thu added run-ci-lora run-ci-lora-native Run native (raw-mode) LoRA plugin e2e tests labels Aug 23, 2026
@yushengsu-thu

Copy link
Copy Markdown
Collaborator Author

@claude review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review found no issues

No high-confidence issues detected in this change.

@yushengsu-thu yushengsu-thu changed the title fix: skip base-weight update session for LoRA sync [multi-lora] 1/n - 8, fix: skip base-weight update session for LoRA sync Aug 24, 2026
@yushengsu-thu yushengsu-thu reopened this Aug 24, 2026
yushengsu-thu added a commit that referenced this pull request Aug 24, 2026
…uted sync

LoRA sync sends only adapter tensors and never refills base weights;
opening the session anyway makes begin/end_weight_update restore and
re-pack the quantized base buffers with nothing loaded in between,
corrupting the frozen base (reproduced on Kimi-K2.5 W4A16, TP8).
Also re-adds the update_weight_version abort_all_requests=False wire
pin so main #2589's no-abort behavior cannot silently regress.
Absorbed from closed PRs #2715 and #2713.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci-lora run-ci-lora-native Run native (raw-mode) LoRA plugin e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant