Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
NuojCheng
approved these changes
Apr 25, 2026
gagika
approved these changes
Apr 25, 2026
| next_layer_addition = mlp_lnx + residual | ||
| layer_output = next_layer_addition | ||
| layer_output = layer_output * self.layer_scalar.value | ||
| layer_output = layer_output * jnp.asarray(self.layer_scalar.value, cfg.dtype) |
Collaborator
There was a problem hiding this comment.
nit: self.layer_scalar.value.astype(cfg.dtype) probably matches better maxtext style.
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
When fixing another bug in #3727 , I changed to use config.weight_dtype from config.dtype to initialize layer_scalar because it's a weight, this requires casting layer_scalar back to dtype during use time, or it causes error
The input carry component c[1] has type bfloat16[2048,4096,2816] but the corresponding output carry component has type float32[2048,4096,2816], so the dtypes do not match.whenweight_dtype=float32, dtype=bfloat16Tests
log with error
working log
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.