File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66
77import os
8+ import platform
89
910from datetime import datetime
1011
2728from executorch .backends .arm .vgf import VgfCompileSpec
2829
2930
31+ def is_aarch64_host () -> bool :
32+ return platform .machine ().lower () in ("aarch64" , "arm64" )
33+
34+
3035def get_time_formatted_path (path : str , log_prefix : str ) -> str :
3136 """Returns the log path with the current time appended to it. Used for
3237 debugging.
Original file line number Diff line number Diff line change @@ -488,6 +488,16 @@ def test_qwen3_vl_tosa_FP(test_case: Qwen3VLTestCase):
488488@common .parametrize (
489489 "test_case" ,
490490 TOSA_BF16_TEST_CASES ,
491+ xfails = (
492+ {
493+ "vision_patch_embed" : (
494+ "MLETORCH-2048: Large bf16 patch embedding mismatch on aarch64" ,
495+ AssertionError ,
496+ ),
497+ }
498+ if common .is_aarch64_host ()
499+ else None
500+ ),
491501)
492502def test_qwen3_vl_tosa_FP_bf16 (test_case : Qwen3VLTestCase ):
493503 model , inputs = test_case .model_cls .prepare_model_and_inputs ()
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ def test_mv3_tosa_FP():
4545 pipeline .run ()
4646
4747
48+ # Different atol for TOSA on ARM (MLETORCH-2048: Large bf16 patch embedding mismatch on aarch64)
4849@pytest .mark .slow
4950def test_mv3_tosa_FP_fp16 ():
5051 input_tensor_fp16 = torch .rand (
@@ -57,7 +58,7 @@ def test_mv3_tosa_FP_fp16():
5758 aten_op = [],
5859 exir_op = [],
5960 use_to_edge_transform_and_lower = True ,
60- atol = 6e-2 ,
61+ atol = 6.5e-2 if common . is_aarch64_host () else 6e-2 ,
6162 )
6263 pipeline .run ()
6364
Original file line number Diff line number Diff line change @@ -49,6 +49,12 @@ def test_resnet_18_tosa_FP():
4949 pipeline .run ()
5050
5151
52+ @pytest .mark .xfail (
53+ common .is_aarch64_host (),
54+ reason = "MLETORCH-2048: Large bf16 ResNet18 mismatch on aarch64" ,
55+ raises = AssertionError ,
56+ strict = True ,
57+ )
5258def test_resnet_18_tosa_FP_bf16 ():
5359 bf16_model = resnet18 (weights = ResNet18_Weights ).eval ()
5460 bf16_model = bf16_model .to (torch .bfloat16 )
You can’t perform that action at this time.
0 commit comments