Skip to content

Commit ee897da

Browse files
author
Github Executorch
committed
Summary: MCU Tests: Add two basic qadd , qlinear qdq tests
- Enable on CI for consistent signals - Note that this is interim solution until a proper MCU testing standalone pipeline is ready Test Plan: - examples/arm/run_mcu_models_fvp.sh --target=cortex-m55 --models=qadd,qlinear ════════════════════════════════════════════════════════════════ 🏁 MCU MODEL VALIDATION SUMMARY - TARGET: cortex-m55 ════════════════════════════════════════════════════════════════ qadd : ✅ Passed qlinear : ✅ Passed Reviewers: Subscribers: Tasks: Tags:
1 parent a548635 commit ee897da

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

examples/arm/aot_arm_compiler.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,19 @@ def forward(self, x: torch.Tensor, y: torch.Tensor):
297297
can_delegate = True
298298

299299

300+
class QuantLinearTest(torch.nn.Module):
301+
def __init__(self):
302+
super().__init__()
303+
# Define a simple linear layer
304+
self.linear = torch.nn.Linear(64, 32)
305+
306+
def forward(self, x):
307+
return self.linear(x)
308+
309+
example_input = (torch.randn([8, 64], dtype=torch.float32),)
310+
can_delegate = True
311+
312+
300313
models = {
301314
"add": AddModule,
302315
"add2": AddModule2,
@@ -306,6 +319,7 @@ def forward(self, x: torch.Tensor, y: torch.Tensor):
306319
"qops": QuantOpTest,
307320
"softmax": SoftmaxModule,
308321
"MultipleOutputsModule": MultipleOutputsModule,
322+
"qlinear": QuantLinearTest,
309323
}
310324

311325
calibration_data = {
@@ -330,6 +344,7 @@ def forward(self, x: torch.Tensor, y: torch.Tensor):
330344
torch.randn(32, 2, 1) * 1000,
331345
),
332346
"softmax": (torch.randn(32, 2, 2),),
347+
"qlinear": (torch.randn(32, 64),),
333348
}
334349

335350
evaluators = {

examples/arm/run_mcu_models_fvp.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ VALID_TARGETS=(
2424
)
2525

2626
# Default models for MCU validation with portable kernels
27-
DEFAULT_MODELS=(mv2 mv3 lstm)
27+
DEFAULT_MODELS=(mv2 mv3 lstm qadd qlinear)
2828
# Available models (on FVP)
29-
AVAILABLE_MODELS=(mv2 mv3 lstm)
29+
AVAILABLE_MODELS=(mv2 mv3 lstm qadd qlinear)
3030
# Add the following models if you want to enable them later (atm they are not working on FVP)
3131
# edsr w2l ic3 ic4 resnet18 resnet50
3232

@@ -257,6 +257,7 @@ for model in "${MODELS[@]}"; do
257257
-m "$model" \
258258
--target="$ETHOS_TARGET" \
259259
--quantize \
260+
--enable_qdq_fusion_pass \
260261
--output="arm_test/$model"; then
261262
echo "❌ AOT compilation failed for $model"
262263
MODEL_SUCCESS=false

0 commit comments

Comments
 (0)