fix: emit PEFT-standard disk LoRA adapter keys so vLLM can load them (incl. #1577) - #1579
Open
sitabulaixizawaluduo wants to merge 1 commit into
Open
fix: emit PEFT-standard disk LoRA adapter keys so vLLM can load them (incl. #1577)#1579sitabulaixizawaluduo wants to merge 1 commit into
sitabulaixizawaluduo wants to merge 1 commit into
Conversation
… and align sglang best-effort unload test assertion (#1577)
sitabulaixizawaluduo
requested review from
garrett4wade,
geshi001,
nuzant and
rchardx
as code owners
August 4, 2026 12:52
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
sitabulaixizawaluduo
temporarily deployed
to
AReaL-unittests
August 4, 2026 13:21 — with
GitHub Actions
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the disk-mode LoRA adapter save format so vLLM can load AReaL-trained
adapters again, and folds in the one-line assertion fix from #1577.
1. vLLM disk LoRA load regression (main fix)
test_examples.py::test_gsm8k_grpo_lora[vllm:d1-fsdp:d1]fails onmainwith:Root cause: #1444 replaced the PEFT-standard save
(
PeftModel.save_pretrained) with a hand-rolled_save_lora_to_hfinareal/engine/fsdp_engine.pyto avoid gathering the full model state dict(OOM on 27B/35B). Its key cleanup only stripped the
base_model.model.prefix but kept the active-adapter segment
.default, so on-disk keys became...lora_A.default.weight. vLLM'sparse_fine_tuned_lora_name/check_unexpected_modulesexpects PEFT-serving-standard keys(
...lora_A.weight) and rejects the.defaultform, so the vLLM server failsto launch and the example subprocess exits 1.
Fix (minimal): drop the
.defaultsegment instead of stripping theprefix, reproducing the exact pre-#1444 PEFT-standard format
(
base_model.model....lora_A.weight). This keeps #1444's per-parameterunshard (OOM avoidance) intact.
Why SGLang is unaffected (verified, not assumed): both backends load the
same adapter directory via
/load_lora_adapter(lora_path=str(meta.path));only vLLM's parser is strict. The SGLang LoRA test passed with the
PEFT-standard format before #1444 (run
30074565394, 251s) and with the.defaultformat after it (current run, 245s), i.e. SGLang tolerates both.This fix restores the format SGLang already passed with.
2. Rolls in #1577
tests/test_sglang_lora_unload.py: the/load_lora_adapterrequest becamebest_effort=True, but the assertion still expectedFalse. Updated toTrue.Type of Change
Test commands executed
pre-commit run --files areal/engine/fsdp_engine.py tests/test_sglang_lora_unload.py— passedpytest tests/test_sglang_lora_unload.py— 5 passedNotes / skipped suites
test_gsm8k_grpo_lora[vllm]requires the multi-GPU GCP runner and cannot berun locally; it exercises this exact path and should be validated in CI.