Skip to content

Commit 3a140b7

Browse files
committed
Migrate Gemma3DecoderLayer and Gemma3ScannableBlock to NNX
1 parent f817224 commit 3a140b7

2 files changed

Lines changed: 189 additions & 128 deletions

File tree

src/MaxText/layers/decoders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def get_decoder_layers(self):
387387
case DecoderBlockType.GEMMA2:
388388
return [gemma2.Gemma2DecoderLayer]
389389
case DecoderBlockType.GEMMA3:
390-
return [gemma3.Gemma3DecoderLayer]
390+
return [gemma3.Gemma3DecoderLayerToLinen]
391391
case DecoderBlockType.GPT3:
392392
return [gpt3.Gpt3DecoderLayer]
393393
case DecoderBlockType.GPT_OSS:
@@ -871,7 +871,7 @@ def _apply_gemma3_scanned_blocks(
871871
scan_length = cfg.num_decoder_layers // attention_pattern_length
872872

873873
policy = self.get_remat_policy()
874-
RemattedGemma3Block = self.set_remat_policy([gemma3.Gemma3ScannableBlock], policy)[0]
874+
RemattedGemma3Block = self.set_remat_policy([gemma3.Gemma3ScannableBlockToLinen], policy)[0]
875875

876876
layer_call_kwargs = {"bidirectional_mask": bidirectional_mask}
877877
layer_kwargs = {"num_of_layers": attention_pattern_length}

0 commit comments

Comments
 (0)