fix(inference): align vllm_decode with LoRA checkpoint restoration an…#3978
Draft
chiajunglien wants to merge 2 commits into
Draft
fix(inference): align vllm_decode with LoRA checkpoint restoration an…#3978chiajunglien wants to merge 2 commits into
chiajunglien wants to merge 2 commits into
Conversation
RexBearIU
reviewed
May 26, 2026
| if self.maxtext_config.lora.enable_lora: | ||
| model = lora_utils.apply_lora_to_model(model, self.mesh, self.maxtext_config) | ||
| if self.maxtext_config.lora.lora_restore_path: | ||
| mock_trainer = type("MockTrainer", (), {"model": model, "train_steps": 0}) |
Collaborator
There was a problem hiding this comment.
why we mock model here? we should restore with above model like we did in train_sft
Author
There was a problem hiding this comment.
I've refactored restore_lora_from_path in lora_utils to support polymorphism.
It now accepts either a full Trainer instance or a standalone nnx.Module directly.
Comment on lines
+77
to
+78
| dtype=bfloat16 \ | ||
| weight_dtype=bfloat16 |
Collaborator
There was a problem hiding this comment.
do we need those setting? please also verify.
| load_parameters_path=${BASE_OUTPUT_DIRECTORY}/sft/${run_id}/checkpoints/5/model_params \ | ||
| lora.lora_restore_path=${BASE_OUTPUT_DIRECTORY}/lora/${run_id}/checkpoints/5/model_params \ | ||
| base_output_directory=${BASE_OUTPUT_DIRECTORY}/to_huggingface/unscanned/${run_id} \ | ||
| use_multimodal=false scan_layers=true |
Collaborator
There was a problem hiding this comment.
why we need to set use_multimodal? And please run pre-commit to the code
2c23253 to
97b76b9
Compare
… end-to-end support
10fde95 to
2a0ea9a
Compare
f994e02 to
cc0e0e6
Compare
7938d49 to
bc62d64
Compare
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.
…d add test_gemma3_lora script
Description
Start with a short description of what the PR does and how this is a change from
the past.
The rest of the description includes relevant details and context, examples:
If the change fixes a bug or a Github issue, please include a link, e.g.,:
FIXES: b/123456
FIXES: #123456
You can also provide a comma-separated list. If you don't want to close a bug but
simply to reference it, use BUGS, e.g.:
BUGS: b/123456
Notice 1: Once all tests pass, the "pull ready" label will automatically be assigned.
This label is used for administrative purposes. Please do not add it manually.
Notice 2: For external contributions, our settings currently require an approval from a MaxText maintainer to trigger CI tests.
Tests
Please describe how you tested this change, and include any instructions and/or
commands to reproduce.
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.