|
32 | 32 | from executorch.examples.models.edsr import EdsrModel |
33 | 33 | from executorch.examples.models.inception_v3 import InceptionV3Model |
34 | 34 | from executorch.examples.models.inception_v4 import InceptionV4Model |
35 | | -from executorch.examples.models.llama2 import Llama2Model |
| 35 | + |
| 36 | +# from executorch.examples.models.llama2 import Llama2Model |
36 | 37 | from executorch.examples.models.mobilebert import MobileBertModelExample |
37 | 38 | from executorch.examples.models.mobilenet_v2 import MV2Model |
38 | 39 | from executorch.examples.models.mobilenet_v3 import MV3Model |
@@ -439,7 +440,8 @@ def test_qnn_backend_example_models(self): |
439 | 440 | EdsrModel(), |
440 | 441 | InceptionV3Model(), |
441 | 442 | InceptionV4Model(), |
442 | | - Llama2Model(), |
| 443 | + # The module of llama is changing frequently. Reopen it when it's stable |
| 444 | + # Llama2Model(), |
443 | 445 | MV2Model(), |
444 | 446 | MV3Model(), |
445 | 447 | MobileBertModelExample(), |
@@ -922,7 +924,8 @@ def test_qnn_backend_example_models(self): |
922 | 924 | {"module": EdsrModel(), "annotation": ()}, |
923 | 925 | {"module": InceptionV3Model(), "annotation": ()}, |
924 | 926 | {"module": InceptionV4Model(), "annotation": ()}, |
925 | | - {"module": Llama2Model(), "annotation": ()}, |
| 927 | + # The module of llama is changing frequently. Reopen it when it's stable |
| 928 | + # {"module": Llama2Model(), "annotation": ()}, |
926 | 929 | {"module": MV2Model(), "annotation": ()}, |
927 | 930 | {"module": MV3Model(), "annotation": ()}, |
928 | 931 | # only works on QNN 2.12 so far |
@@ -1221,6 +1224,51 @@ def test_qnn_backend_shared_buffer(self): |
1221 | 1224 | ) |
1222 | 1225 |
|
1223 | 1226 |
|
| 1227 | +class TestExampleOssScript(TestQNN): |
| 1228 | + def required_envs(self, conditions=None) -> bool: |
| 1229 | + conditions = [] if conditions is None else conditions |
| 1230 | + return all( |
| 1231 | + [ |
| 1232 | + self.executorch_root, |
| 1233 | + self.artifact_dir, |
| 1234 | + *conditions, |
| 1235 | + ] |
| 1236 | + ) |
| 1237 | + |
| 1238 | + def test_fbnet(self): |
| 1239 | + if not self.required_envs([self.image_dataset]): |
| 1240 | + self.skipTest("missing required envs") |
| 1241 | + |
| 1242 | + cmds = [ |
| 1243 | + "python", |
| 1244 | + f"{self.executorch_root}/examples/qualcomm/oss_scripts/fbnet.py", |
| 1245 | + "--dataset", |
| 1246 | + self.image_dataset, |
| 1247 | + "--artifact", |
| 1248 | + self.artifact_dir, |
| 1249 | + "--build_folder", |
| 1250 | + self.build_folder, |
| 1251 | + "--device", |
| 1252 | + self.device, |
| 1253 | + "--model", |
| 1254 | + self.model, |
| 1255 | + "--ip", |
| 1256 | + self.ip, |
| 1257 | + "--port", |
| 1258 | + str(self.port), |
| 1259 | + ] |
| 1260 | + if self.host: |
| 1261 | + cmds.extend(["--host", self.host]) |
| 1262 | + |
| 1263 | + p = subprocess.Popen(cmds, stdout=subprocess.DEVNULL) |
| 1264 | + with Listener((self.ip, self.port)) as listener: |
| 1265 | + conn = listener.accept() |
| 1266 | + p.communicate() |
| 1267 | + msg = json.loads(conn.recv()) |
| 1268 | + self.assertGreaterEqual(msg["top_1"], 60) |
| 1269 | + self.assertGreaterEqual(msg["top_5"], 90) |
| 1270 | + |
| 1271 | + |
1224 | 1272 | class TestExampleScript(TestQNN): |
1225 | 1273 | def required_envs(self, conditions=None) -> bool: |
1226 | 1274 | conditions = [] if conditions is None else conditions |
@@ -1442,6 +1490,9 @@ def test_deeplab_v3(self): |
1442 | 1490 | self.assertGreaterEqual(msg["MIoU"], 0.55) |
1443 | 1491 |
|
1444 | 1492 | def test_dummy_llama2(self): |
| 1493 | + self.skipTest( |
| 1494 | + "The module of llama is changing frequently. Reopen it when it's stable" |
| 1495 | + ) |
1445 | 1496 | if not self.required_envs(): |
1446 | 1497 | self.skipTest("missing required envs") |
1447 | 1498 |
|
@@ -1476,6 +1527,9 @@ def test_dummy_llama2(self): |
1476 | 1527 |
|
1477 | 1528 | @unittest.expectedFailure |
1478 | 1529 | def test_ptq_dummy_llama2(self): |
| 1530 | + self.skipTest( |
| 1531 | + "The module of llama is changing frequently. Reopen it when it's stable" |
| 1532 | + ) |
1479 | 1533 | if not self.required_envs(): |
1480 | 1534 | self.skipTest("missing required envs") |
1481 | 1535 |
|
|
0 commit comments