Skip to content

Commit 2e0c869

Browse files
authored
Arm backend: Add Gemma3n layer tests (pytorch#17813)
Signed-off-by: Baris Demir <baris.demir@arm.com>
1 parent 9023780 commit 2e0c869

3 files changed

Lines changed: 1162 additions & 2 deletions

File tree

‎backends/arm/MODELS.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# The following file contains all models that have been confirmed to be functional and tested for the Arm backend:
1+
# The following file contains all models that have been confirmed to be functional and tested for the Arm backend :
22
- Conformer
33
- Deit Tiny
44
- DeepLab v3 (DL3)
55
- Inception v3 (IC3)
66
- Llama
7+
- Gemma3n
78
- Long Short-Term Memory (LSTM)
89
- MobileNet v2 (MV2)
910
- MobileNet v3 (MV3)
@@ -17,4 +18,4 @@
1718
* CLIP Text Encoder (CLIP Text with Projection)
1819
* Stable Diffusion 3 Transformer (SD3 Transformer)
1920
* T5 Encoder
20-
* VAE Encoder/Decoder (VAE)
21+
* VAE Encoder/Decoder (VAE)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright 2026 Arm Limited and/or its affiliates.
2+
#
3+
# This source code is licensed under the BSD-style license found in the
4+
# LICENSE file in the root directory of this source tree.
5+
"""This file defines test configs used to initialize Gemma3n module tests.
6+
7+
Module tests in the same directory will import these configs.
8+
9+
"""
10+
11+
from transformers.models.gemma3n.configuration_gemma3n import (
12+
Gemma3nAudioConfig,
13+
Gemma3nTextConfig,
14+
)
15+
16+
17+
def get_gemma3n_text_test_config() -> Gemma3nTextConfig:
18+
config = Gemma3nTextConfig(
19+
hidden_size=2048,
20+
hidden_size_per_layer_input=256,
21+
rms_norm_eps=1e-6,
22+
layer_types=None,
23+
altup_num_inputs=4,
24+
altup_active_idx=0,
25+
altup_correct_scale=True,
26+
)
27+
# Force eager attention path to keep the module exportable in tests.
28+
config._attn_implementation = "eager"
29+
return config
30+
31+
32+
def get_gemma3n_audio_test_config() -> Gemma3nAudioConfig:
33+
return Gemma3nAudioConfig(
34+
input_feat_size=128,
35+
hidden_size=256,
36+
rms_norm_eps=1e-6,
37+
)

0 commit comments

Comments
 (0)