Skip to content

Commit 283297e

Browse files
authored
Skip unsupported SoCs (pytorch#23054) (pytorch#23054)
Summary: Hextimate had skips for non-x86 and LPAI, but none for unsupported SoCs. Enforce the list from `estimate_htp_profile_result` Differential Revision: D121396433
1 parent ea0d441 commit 283297e

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎backends/qualcomm/tests/test_qnn_delegate.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
get_qnn_pass_manager_cls,
2424
)
2525
from executorch.backends.qualcomm.debugger.utils import (
26+
_HEXTIMATE_SUPPORTED_SOCS,
27+
_MIN_SDK_FOR_HEXTIMATE,
2628
estimate_htp_profile_result,
2729
generate_htp_profile_result,
2830
)
@@ -8856,13 +8858,18 @@ def test_qnn_backend_generate_optrace(self):
88568858
with open(a.qhas_json, "r") as f:
88578859
self.assertIn("data", json.load(f))
88588860

8861+
@unittest.skipIf(
8862+
is_qnn_sdk_version_less_than(_MIN_SDK_FOR_HEXTIMATE),
8863+
f"Hextimate requires QNN SDK >= {_MIN_SDK_FOR_HEXTIMATE}.",
8864+
)
88598865
def test_qnn_backend_generate_hextimate(self):
88608866
if not self.enable_x86_64:
88618867
self.skipTest(
88628868
"Hextimate is host-side (compile-time); requires --enable_x86_64."
88638869
)
88648870
if get_backend_type(self.backend) == QnnExecuTorchBackendType.kLpaiBackend:
88658871
self.skipTest("LPAI does not support hextimate generation.")
8872+
hextimate_soc = _HEXTIMATE_SUPPORTED_SOCS[0]
88668873
module = SimpleModel() # noqa: F405
88678874
sample_input = (torch.ones(1, 32, 28, 28), torch.ones(1, 32, 28, 28))
88688875
module = self.get_qdq_module(module, sample_input)
@@ -8872,7 +8879,7 @@ def test_qnn_backend_generate_hextimate(self):
88728879
# required — hextimate profiling is attached by the QNN CLI at
88738880
# context-binary-generation time.
88748881
compiler_spec = generate_qnn_executorch_compiler_spec(
8875-
soc_model=self.chipset_table[TestQNN.soc_model],
8882+
soc_model=hextimate_soc,
88768883
backend_options=backend_options,
88778884
online_prepare=True,
88788885
)
@@ -8887,7 +8894,7 @@ def test_qnn_backend_generate_hextimate(self):
88878894

88888895
artifacts = estimate_htp_profile_result(
88898896
artifact_dir=tmp_dir,
8890-
soc_id=self.chipset_table[self.soc_model],
8897+
soc_id=hextimate_soc,
88918898
pte_path=pte_path,
88928899
)
88938900
for a in artifacts:

0 commit comments

Comments
 (0)