Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
entrpn
reviewed
Apr 21, 2026
entrpn
reviewed
Apr 21, 2026
JamesDeng42
reviewed
Apr 21, 2026
entrpn
approved these changes
Apr 22, 2026
gagika
reviewed
Apr 22, 2026
gagika
reviewed
Apr 22, 2026
gagika
reviewed
Apr 23, 2026
| self, | ||
| raw_iterator: Any | None, | ||
| root_directory: str | None = None, | ||
| student_config: Any | None = None, |
Collaborator
There was a problem hiding this comment.
nit: can it be None?
perhaps change default and data type if it can't.
| It effectively collapses the learn-to-init parameterization back into a standard | ||
| decoder architecture, modifying the `student_model` in-place. | ||
|
|
||
| NOTE: works for ToNXX decoder model and layer-scan mode only |
Collaborator
There was a problem hiding this comment.
could you throw an exception if it's not layer-scan mode?
| LLAMA4 = "llama4" | ||
| OLMO3 = "olmo3" | ||
|
|
||
| LLAMA2LTI = "llama2-learn-to-init" |
Collaborator
There was a problem hiding this comment.
for naming convention could you use "_" instead of "-" e.g. LLAMA2_LTI = "llama2_lti"
Collaborator
There was a problem hiding this comment.
could you name the test with "_" insead of "-"? e..g. learn_to_init_test.py
| self._buffered_train_metrics.additional_metrics[name] = ([], distillation_utils.weighted_mean) | ||
|
|
||
| self._buffered_train_metrics.additional_metrics[name][0].append(value) | ||
| max_logging.log(f"Distillation metrics: {aux}") |
Collaborator
There was a problem hiding this comment.
is it logged at every step or once? as it's inside _post_process_train_step
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
This PR introduces the base implementation for Learn-to-Init (LTI) attention for distillation (llama only be can easily be generalized).
Relevant details and context:
learn_to_init_layer.pymodule.distillation_utils.pyandtrain_distill.py) and decoders to support the new attention layer.Tests
src/maxtext/tests/post_training/unit/learn-to-init_test.py
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.