Refactor model loading in distillation to remove Tunix adapter.#2927
Merged
copybara-service[bot] merged 1 commit intomainfrom Jan 14, 2026
Merged
Refactor model loading in distillation to remove Tunix adapter.#2927copybara-service[bot] merged 1 commit intomainfrom
copybara-service[bot] merged 1 commit intomainfrom
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ba157c4 to
597f866
Compare
597f866 to
6bd9e12
Compare
dipannita08
reviewed
Jan 14, 2026
| # Ensure load_parameters_path is set (check overrides, then env var) | ||
| # Ensure load_parameters_path is set in overrides | ||
| if not teacher_overrides.get("load_parameters_path"): | ||
| ckpt_path = os.environ.get("TEACHER_CHECKPOINT_PATH") |
Collaborator
There was a problem hiding this comment.
Out of curiosity, why do we remove this fallback?
Collaborator
Author
There was a problem hiding this comment.
I was testing with env TEACHER_CHECKPOINT_PATH before for teacher checkpoint path, but there is not need to have extra env, it can just be provided from distillaiton.yml file or command line argument, e.g. teacher_overrides.load_parameters_path="gs://agagik-us/...
dipannita08
approved these changes
Jan 14, 2026
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
Refactors the distillation trainer to remove the
TunixMaxTextAdapterdependency, enabling direct control over model execution and configuration.Key Changes:
nnx.Moduleloading viaget_maxtext_model.create_forward_fnto generate distinct forward functions for Student and Teacher. This correctly bindsenable_dropoutfrom the config, allowing the Student to train with dropout while keeping the Teacher deterministic.teacher_overrides.load_parameters_pathis now mandatory to ensure reproducibility.Tests
Verified locally with the following command:
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.