Update: single-source model card (consistent V2 title, custom-kernel section, PTE run instructions)
Browse files* README.md
* config.json
* executorch/linux-aarch64/plant_runner
* executorch/linux-x64/plant_runner
* extension/moe/README.md
* extension/moe/build_linux.sh
* SHA256SUMS.json
- .gitattributes +2 -0
- README.md +7 -2
- SHA256SUMS.json +55 -52
- config.json +15 -0
- executorch/linux-aarch64/plant_runner +3 -0
- executorch/linux-x64/plant_runner +3 -0
- extension/moe/README.md +12 -1
- extension/moe/build_linux.sh +43 -0
.gitattributes
CHANGED
|
@@ -1,2 +1,4 @@
|
|
| 1 |
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 2 |
*.ts filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 1 |
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 2 |
*.ts filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
executorch/linux-aarch64/plant_runner filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
executorch/linux-x64/plant_runner filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -23,14 +23,19 @@ tags:
|
|
| 23 |
- **Accuracy:** 86.11% top-1 on the separate WA single-photo benchmark (0.22 points below the FP32 export)
|
| 24 |
|
| 25 |
#### Running the PTE
|
| 26 |
-
It does **not** load on a stock ExecuTorch runtime — it requires the four custom `plant_quant::*` operators. The operator sources, build instructions and
|
| 27 |
|
| 28 |
```powershell
|
| 29 |
executorch/windows-x64/plant_runner.exe executorch/PlantDetect-WA-V2-INT8.pte encode image.bin embedding.bin
|
| 30 |
executorch/windows-x64/plant_runner.exe executorch/PlantDetect-WA-V2-INT8.pte classify slots.bin out 4
|
| 31 |
```
|
| 32 |
|
| 33 |
-
`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
### FP8 AdaRound Weights
|
| 36 |
`fp8/model.safetensors` is the AdaRound E4M3FN per-channel weight-only export of the same checkpoint. Adaptive rounding improved 107 of 108 layer reconstructions (0.875% aggregate MSE reduction over nearest rounding); see `fp8/adaround_report.json`.
|
|
|
|
| 23 |
- **Accuracy:** 86.11% top-1 on the separate WA single-photo benchmark (0.22 points below the FP32 export)
|
| 24 |
|
| 25 |
#### Running the PTE
|
| 26 |
+
It does **not** load on a stock ExecuTorch runtime — it requires the four custom `plant_quant::*` operators. The operator sources, build instructions and prebuilt runners for Windows x64, Linux x86-64 and Linux aarch64 are included:
|
| 27 |
|
| 28 |
```powershell
|
| 29 |
executorch/windows-x64/plant_runner.exe executorch/PlantDetect-WA-V2-INT8.pte encode image.bin embedding.bin
|
| 30 |
executorch/windows-x64/plant_runner.exe executorch/PlantDetect-WA-V2-INT8.pte classify slots.bin out 4
|
| 31 |
```
|
| 32 |
|
| 33 |
+
```bash
|
| 34 |
+
executorch/linux-x64/plant_runner executorch/PlantDetect-WA-V2-INT8.pte encode image.bin embedding.bin
|
| 35 |
+
executorch/linux-aarch64/plant_runner executorch/PlantDetect-WA-V2-INT8.pte encode image.bin embedding.bin
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
`image.bin` is float32 ImageNet-normalised RGB 448x448 (`3*448*448` floats); `slots.bin` is `4*512` floats. Set `OMP_NUM_THREADS` (5 on an Exynos 2400, 2 on an Allwinner A733). Required ExecuTorch version and commit, ISA tiers (`PLANTDETECT_MARCH`), activation modes (`PLANTDETECT_ACT`) and profiling switches are documented in `extension/moe/README.md`. The aarch64 runner targets the `armv8.2-a+dotprod+fp16` tier (Cortex-A76 and newer); rebuild it for older cores or for I8MM with `extension/moe/build_linux.sh`. The downloadable Linux runners may need `chmod +x` first.
|
| 39 |
|
| 40 |
### FP8 AdaRound Weights
|
| 41 |
`fp8/model.safetensors` is the AdaRound E4M3FN per-channel weight-only export of the same checkpoint. Adaptive rounding improved 107 of 108 layer reconstructions (0.875% aggregate MSE reduction over nearest rounding); see `fp8/adaround_report.json`.
|
SHA256SUMS.json
CHANGED
|
@@ -1,53 +1,56 @@
|
|
| 1 |
-
{
|
| 2 |
-
".gitattributes": "0294a4beda90912a6c104c52678e2232241d58989b4908e84a9d4b2fc36ff73b",
|
| 3 |
-
".gitignore": "01d8d0360f02a0c00e236a4eb2a1d8bdf83377acf442eaafad7a136bf14d6bb0",
|
| 4 |
-
"centroid_report.json": "0937f1b0888e8abd7a89f6df301fe6dd45375154050e605be9e172b1040834e4",
|
| 5 |
-
"classifier.ts": "6125829ddf395068dfedb4e67d7bc09b6bac8c7581e2830e9eb80692466dd9b6",
|
| 6 |
-
"classifier_gpu.ts": "eae351952653af3e73a9867abb94884973883f859ee5011731fa8e7a13406c0c",
|
| 7 |
-
"config.json": "
|
| 8 |
-
"encoder.ts": "4366f22f547d5ea2e04a9f03e4309ce4a6d794a1056647675597a5c70185a8fe",
|
| 9 |
-
"encoder_gpu.ts": "02ed97e48b862bd7889e2be42ce8acec90c595c985db18c40099e033c1db7f2c",
|
| 10 |
-
"evaluation.json": "bad59f0264d4b298be059e7385b428635bde8be5e684c372ffb016e1604e08c3",
|
| 11 |
-
"model.safetensors": "d7de5dccf2e506f65baafd88ceb02fe879c8bc935c2d5226a1bec66a7e408ef9",
|
| 12 |
-
"NOTICE.md": "da929745511346289310485e90392505e3276d10fc9beb99eed453116ce88871",
|
| 13 |
-
"plant_v2_cli.py": "fe747e5c1b9f99ca943e811c9db6eb5426e05727da67a042d6fd3990019cf35b",
|
| 14 |
-
"README.md": "
|
| 15 |
-
"requirements-executorch-cli.txt": "331b433b131c3845fe3f258f29cc40a2df26b461b5e2fd711541a78c0b9bde63",
|
| 16 |
-
"requirements.txt": "f534b0e520f94060992877828d9e8e4402d8629b401bc52ce91da0b9fecb014f",
|
| 17 |
-
"species_centroids.npz": "79503c3920937da4ed5883bdb790472ca719397cc6d49a8a79935e2eb1b8bf54",
|
| 18 |
-
"taxonomy_index.json": "b2047439308b2146c507112d88f529daf0d565beb73562c9c405600ccd8dff61",
|
| 19 |
-
"torchscript_parity.json": "a9930940ad73f8492047691ecb63077e0ecf9cbea024e087fc5b2b6ca2267308",
|
| 20 |
-
"executorch/PlantDetect-WA-V2-INT8.pte": "e28340a9a037c39b7424d45815f1ef8e7a2d5ce6699bb36f108180bbcdc7e3ca",
|
| 21 |
-
"fp8/adaround_report.json": "30bb758746bb15b29e88a906029a224d698901bbbe8daf17a2a5f2b67e48e164",
|
| 22 |
-
"fp8/config.json": "f8f4269391a164491d223689abd84d3bee331365d084a92d09b212d878d0b86d",
|
| 23 |
-
"fp8/model.safetensors": "7f4ee321ebcec47b3f305a8b513ca179f737b8fc60aabbd2fbb956252d624315",
|
| 24 |
-
"licenses/APACHE-2.0.txt": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30",
|
| 25 |
-
"licenses/DINOV3.md": "25d122eb8f5b880fd23c736fb6ea8018ee45c12237e00b8a86d14c653904999e",
|
| 26 |
-
"licenses/EXECUTORCH.txt": "d509ee20a86672d9f51d1dc057a9be504f86238aa139356279dda84182e74e68",
|
| 27 |
-
"licenses/PYTORCH.txt": "bd018feef8825e88181c84eb7e3aa4eafb8f08a20d9fd6ef948569610c4a3e43",
|
| 28 |
-
"src/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
| 29 |
-
"executorch/
|
| 30 |
-
"
|
| 31 |
-
"
|
| 32 |
-
"extension/moe/
|
| 33 |
-
"extension/moe/
|
| 34 |
-
"extension/moe/
|
| 35 |
-
"extension/moe/
|
| 36 |
-
"extension/moe/
|
| 37 |
-
"extension/moe/
|
| 38 |
-
"extension/moe/
|
| 39 |
-
"extension/moe/
|
| 40 |
-
"extension/moe/
|
| 41 |
-
"extension/moe/
|
| 42 |
-
"extension/moe/
|
| 43 |
-
"extension/moe/kernels/
|
| 44 |
-
"extension/moe/
|
| 45 |
-
"extension/moe/
|
| 46 |
-
"extension/moe/
|
| 47 |
-
"
|
| 48 |
-
"
|
| 49 |
-
"
|
| 50 |
-
"src/models/
|
| 51 |
-
"src/models/
|
| 52 |
-
"src/models/
|
|
|
|
|
|
|
|
|
|
| 53 |
}
|
|
|
|
| 1 |
+
{
|
| 2 |
+
".gitattributes": "0294a4beda90912a6c104c52678e2232241d58989b4908e84a9d4b2fc36ff73b",
|
| 3 |
+
".gitignore": "01d8d0360f02a0c00e236a4eb2a1d8bdf83377acf442eaafad7a136bf14d6bb0",
|
| 4 |
+
"centroid_report.json": "0937f1b0888e8abd7a89f6df301fe6dd45375154050e605be9e172b1040834e4",
|
| 5 |
+
"classifier.ts": "6125829ddf395068dfedb4e67d7bc09b6bac8c7581e2830e9eb80692466dd9b6",
|
| 6 |
+
"classifier_gpu.ts": "eae351952653af3e73a9867abb94884973883f859ee5011731fa8e7a13406c0c",
|
| 7 |
+
"config.json": "924c00f95798c8d7ce0d978ce3745fe741f61f808936fd13bfbc009dbcbd68ed",
|
| 8 |
+
"encoder.ts": "4366f22f547d5ea2e04a9f03e4309ce4a6d794a1056647675597a5c70185a8fe",
|
| 9 |
+
"encoder_gpu.ts": "02ed97e48b862bd7889e2be42ce8acec90c595c985db18c40099e033c1db7f2c",
|
| 10 |
+
"evaluation.json": "bad59f0264d4b298be059e7385b428635bde8be5e684c372ffb016e1604e08c3",
|
| 11 |
+
"model.safetensors": "d7de5dccf2e506f65baafd88ceb02fe879c8bc935c2d5226a1bec66a7e408ef9",
|
| 12 |
+
"NOTICE.md": "da929745511346289310485e90392505e3276d10fc9beb99eed453116ce88871",
|
| 13 |
+
"plant_v2_cli.py": "fe747e5c1b9f99ca943e811c9db6eb5426e05727da67a042d6fd3990019cf35b",
|
| 14 |
+
"README.md": "e90d6388601852c3c6217b95d6132f05da220002a5e888c9169929542da92907",
|
| 15 |
+
"requirements-executorch-cli.txt": "331b433b131c3845fe3f258f29cc40a2df26b461b5e2fd711541a78c0b9bde63",
|
| 16 |
+
"requirements.txt": "f534b0e520f94060992877828d9e8e4402d8629b401bc52ce91da0b9fecb014f",
|
| 17 |
+
"species_centroids.npz": "79503c3920937da4ed5883bdb790472ca719397cc6d49a8a79935e2eb1b8bf54",
|
| 18 |
+
"taxonomy_index.json": "b2047439308b2146c507112d88f529daf0d565beb73562c9c405600ccd8dff61",
|
| 19 |
+
"torchscript_parity.json": "a9930940ad73f8492047691ecb63077e0ecf9cbea024e087fc5b2b6ca2267308",
|
| 20 |
+
"executorch/PlantDetect-WA-V2-INT8.pte": "e28340a9a037c39b7424d45815f1ef8e7a2d5ce6699bb36f108180bbcdc7e3ca",
|
| 21 |
+
"fp8/adaround_report.json": "30bb758746bb15b29e88a906029a224d698901bbbe8daf17a2a5f2b67e48e164",
|
| 22 |
+
"fp8/config.json": "f8f4269391a164491d223689abd84d3bee331365d084a92d09b212d878d0b86d",
|
| 23 |
+
"fp8/model.safetensors": "7f4ee321ebcec47b3f305a8b513ca179f737b8fc60aabbd2fbb956252d624315",
|
| 24 |
+
"licenses/APACHE-2.0.txt": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30",
|
| 25 |
+
"licenses/DINOV3.md": "25d122eb8f5b880fd23c736fb6ea8018ee45c12237e00b8a86d14c653904999e",
|
| 26 |
+
"licenses/EXECUTORCH.txt": "d509ee20a86672d9f51d1dc057a9be504f86238aa139356279dda84182e74e68",
|
| 27 |
+
"licenses/PYTORCH.txt": "bd018feef8825e88181c84eb7e3aa4eafb8f08a20d9fd6ef948569610c4a3e43",
|
| 28 |
+
"src/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
| 29 |
+
"executorch/linux-aarch64/plant_runner": "0a710a11d73c0113d9bd804edca87f9cd580b103296aeddb5ca626f76d05afd7",
|
| 30 |
+
"executorch/linux-x64/plant_runner": "35daec582cbf235560c726c1e4035db8bfd928eb8a330f39c42049464b8ba365",
|
| 31 |
+
"executorch/windows-x64/plant_runner.exe": "52c3dd0c71989f1b4acf378fff833a0b3e1828dfe86a07e1593726eaf3602283",
|
| 32 |
+
"extension/moe/build_linux.sh": "6510a0bc7d659caae8d1f2a75e684954bf25567f7001ed7ff721dc85930228e1",
|
| 33 |
+
"extension/moe/build_windows.ps1": "36df191458fba0cd72e51019a973207284f091875771fcb717125d40dea0fc5b",
|
| 34 |
+
"extension/moe/CMakeLists.txt": "18cd35e48965aa93918ee422fe8a1eb7172679c9c132795590290c668b6c2d2a",
|
| 35 |
+
"extension/moe/compile.ps1": "57f03c3b5011dfe0609bdd695b887927049cd844e1effa1f416a81c1ba2ff69e",
|
| 36 |
+
"extension/moe/CPU_KERNEL_PLAN.md": "856d698d51622a6fbf9665ce3bd3eed78bb11f7deabf94843e537d60262a1360",
|
| 37 |
+
"extension/moe/int8_ops.py": "3f479e28b18dc947151238a0fada91de94de90e21dbfc227a9ebb28efa0e6b6c",
|
| 38 |
+
"extension/moe/mixed_encoder.py": "764543f57f8c6086f81a4200de0a5ee5e19f7a5c1e6e44c74031cf8b52bfeb16",
|
| 39 |
+
"extension/moe/plant_ops.py": "f4f5056a39bfd681c87faed062a810acab55831c6d61499cfbe40c38d71533b0",
|
| 40 |
+
"extension/moe/README.md": "04d069d65ab83b546bcde87449debc8863e1c084b19915182541cd7b1a5db374",
|
| 41 |
+
"extension/moe/runner.cpp": "a2eec1ff107d5aa40ce7f9eebb0d7a1d0d7056699bf8bd1f62164c3cf1d1c65b",
|
| 42 |
+
"extension/moe/__init__.py": "ce65c825b55c2f26555a80a4607e8a9b09904a0d73d37637a694f41c7c467e67",
|
| 43 |
+
"extension/moe/kernels/plant_fp16.cpp": "49e66a74d67be8144f3ba4dd96a70a38d8cd916e48f401f407cb02696c49ae35",
|
| 44 |
+
"extension/moe/kernels/plant_int8.cpp": "7d5ebf90f5cee4454f305060b48bb0ec1138edc0272543e0c1f29783ea2ec8af",
|
| 45 |
+
"extension/moe/kernels/plant_moe_cpu.cpp": "09d6a5d3698ceb7080e46a27d62f737073d6b8cd9b5025c996fb5451f67b8360",
|
| 46 |
+
"extension/moe/kernels/qgemm.h": "23d2c1c8df45ff42ea9c76ac9184793479c02756beb5f24eb2ac4820fa8a9fb8",
|
| 47 |
+
"extension/moe/test/test_fp16_native.cpp": "1dd33e25ab3c06390dc004514e7eef7ed1d5f071ffc49b6246619d2852913d13",
|
| 48 |
+
"extension/moe/test/test_moe_native.cpp": "c85cf4d5312ee983e1e7d9230e329d08ae4144bc417ebe356cdb82164149ff5d",
|
| 49 |
+
"extension/moe/test/test_plant_moe_ops.py": "3c2ee5599c0fb1f43d5feeb531cb15f2ec9e236039b092fa7e6c80a229b59dbe",
|
| 50 |
+
"src/models/expert_ffn.py": "1df6a32a4c038c7c2483b167ba7c5a710e800edca0b360182b8a1bf16db377bf",
|
| 51 |
+
"src/models/moe_swiglu_v2.py": "c8e1784254f7ae2e29b53962f366d17ba063a151ef50a830ea291eff64285173",
|
| 52 |
+
"src/models/plant_unified.py": "ecae96dd8759bd80210a23dde76e2c7e7643308a1642378ecc1a1fe4a542052b",
|
| 53 |
+
"src/models/plant_vit_v2.py": "95a980b43347f4667e6dc916cc156b29e3a1aff120b0ccdd5ed9b64d65b66b12",
|
| 54 |
+
"src/models/subcenter_arcface.py": "05686d6219b2b5d7d5840968821b96ba21f9557e01b98eb5d5700fdeb78beb58",
|
| 55 |
+
"src/models/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
| 56 |
}
|
config.json
CHANGED
|
@@ -3893,6 +3893,21 @@
|
|
| 3893 |
"sha256": "e28340a9a037c39b7424d45815f1ef8e7a2d5ce6699bb36f108180bbcdc7e3ca",
|
| 3894 |
"format": "executorch_w8a8_dynamic_moe_fp16"
|
| 3895 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3896 |
"fp8_weights": {
|
| 3897 |
"file": "fp8/model.safetensors",
|
| 3898 |
"sha256": "7f4ee321ebcec47b3f305a8b513ca179f737b8fc60aabbd2fbb956252d624315",
|
|
|
|
| 3893 |
"sha256": "e28340a9a037c39b7424d45815f1ef8e7a2d5ce6699bb36f108180bbcdc7e3ca",
|
| 3894 |
"format": "executorch_w8a8_dynamic_moe_fp16"
|
| 3895 |
},
|
| 3896 |
+
"executorch_runners": {
|
| 3897 |
+
"windows_x64": {
|
| 3898 |
+
"file": "executorch/windows-x64/plant_runner.exe",
|
| 3899 |
+
"sha256": "52c3dd0c71989f1b4acf378fff833a0b3e1828dfe86a07e1593726eaf3602283"
|
| 3900 |
+
},
|
| 3901 |
+
"linux_x64": {
|
| 3902 |
+
"file": "executorch/linux-x64/plant_runner",
|
| 3903 |
+
"sha256": "35daec582cbf235560c726c1e4035db8bfd928eb8a330f39c42049464b8ba365"
|
| 3904 |
+
},
|
| 3905 |
+
"linux_aarch64": {
|
| 3906 |
+
"file": "executorch/linux-aarch64/plant_runner",
|
| 3907 |
+
"sha256": "0a710a11d73c0113d9bd804edca87f9cd580b103296aeddb5ca626f76d05afd7",
|
| 3908 |
+
"march": "armv8.2-a+dotprod+fp16"
|
| 3909 |
+
}
|
| 3910 |
+
},
|
| 3911 |
"fp8_weights": {
|
| 3912 |
"file": "fp8/model.safetensors",
|
| 3913 |
"sha256": "7f4ee321ebcec47b3f305a8b513ca179f737b8fc60aabbd2fbb956252d624315",
|
executorch/linux-aarch64/plant_runner
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0a710a11d73c0113d9bd804edca87f9cd580b103296aeddb5ca626f76d05afd7
|
| 3 |
+
size 4581440
|
executorch/linux-x64/plant_runner
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:35daec582cbf235560c726c1e4035db8bfd928eb8a330f39c42049464b8ba365
|
| 3 |
+
size 5410160
|
extension/moe/README.md
CHANGED
|
@@ -100,6 +100,17 @@ For Android cross-compilation add the NDK toolchain, `-DANDROID_ABI=arm64-v8a
|
|
| 100 |
-DANDROID_PLATFORM=26`, and build from a **space-free** path (CMake's whole-archive
|
| 101 |
quoting splits on spaces).
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
## Run
|
| 104 |
|
| 105 |
The runner takes a PTE plus a preprocessed binary input (float32, ImageNet-normalised,
|
|
@@ -117,5 +128,5 @@ hurts on the S24).
|
|
| 117 |
|
| 118 |
A prebuilt Windows x64 runner built from these sources is included at
|
| 119 |
`executorch/windows-x64/plant_runner.exe`; it needs the Microsoft Visual C++ x64 runtime
|
| 120 |
-
including OpenMP. Note that a PTE using `plant_quant::gelu` requires a runner built from
|
| 121 |
the kernels in this directory — an older runner will fail to load it.
|
|
|
|
| 100 |
-DANDROID_PLATFORM=26`, and build from a **space-free** path (CMake's whole-archive
|
| 101 |
quoting splits on spaces).
|
| 102 |
|
| 103 |
+
On Linux (x86-64 or aarch64) the same recipe runs natively; `build_linux.sh` wraps it:
|
| 104 |
+
|
| 105 |
+
```bash
|
| 106 |
+
EXECUTORCH_SOURCE_DIR=/path/to/executorch \
|
| 107 |
+
PYTHON_EXECUTABLE=/path/to/venv/bin/python \
|
| 108 |
+
bash extension/moe/build_linux.sh
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
On aarch64 set `PLANTDETECT_MARCH` to the target tier (see above); the prebuilt
|
| 112 |
+
`executorch/linux-aarch64/plant_runner` is built for `armv8.2-a+dotprod+fp16`.
|
| 113 |
+
|
| 114 |
## Run
|
| 115 |
|
| 116 |
The runner takes a PTE plus a preprocessed binary input (float32, ImageNet-normalised,
|
|
|
|
| 128 |
|
| 129 |
A prebuilt Windows x64 runner built from these sources is included at
|
| 130 |
`executorch/windows-x64/plant_runner.exe`; it needs the Microsoft Visual C++ x64 runtime
|
| 131 |
+
including OpenMP. Linux x86-64 and aarch64 runners are included at `executorch/linux-x64/plant_runner` and `executorch/linux-aarch64/plant_runner` (the latter built for `armv8.2-a+dotprod+fp16`). Note that a PTE using `plant_quant::gelu` requires a runner built from
|
| 132 |
the kernels in this directory — an older runner will fail to load it.
|
extension/moe/build_linux.sh
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# Build the PlantDetect ExecuTorch runner natively on Linux (x86-64 or aarch64).
|
| 3 |
+
#
|
| 4 |
+
# Prerequisites: a checkout of ExecuTorch at the pinned commit with its submodules
|
| 5 |
+
# (see README.md), Ninja and a C++17 toolchain, and a Python environment with
|
| 6 |
+
# ``torch`` installed (used by ExecuTorch's code generation).
|
| 7 |
+
#
|
| 8 |
+
# Usage:
|
| 9 |
+
# EXECUTORCH_SOURCE_DIR=/path/to/executorch \
|
| 10 |
+
# PYTHON_EXECUTABLE=/path/to/venv/bin/python \
|
| 11 |
+
# bash extension/moe/build_linux.sh [build_dir]
|
| 12 |
+
#
|
| 13 |
+
# On aarch64, PLANTDETECT_MARCH picks the ISA tier, e.g.
|
| 14 |
+
# PLANTDETECT_MARCH=armv8.2-a+dotprod+fp16 # A76-class (Radxa A733)
|
| 15 |
+
# PLANTDETECT_MARCH=armv8.6-a+i8mm+dotprod+fp16+fp16fml # I8MM (default)
|
| 16 |
+
# PLANTDETECT_MARCH=armv8-a+fp16 # portable generic arm64
|
| 17 |
+
set -euo pipefail
|
| 18 |
+
|
| 19 |
+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
| 20 |
+
BUILD_DIR="${1:-$ROOT/build/plant}"
|
| 21 |
+
|
| 22 |
+
: "${EXECUTORCH_SOURCE_DIR:?set EXECUTORCH_SOURCE_DIR to the pinned ExecuTorch checkout}"
|
| 23 |
+
: "${PYTHON_EXECUTABLE:?set PYTHON_EXECUTABLE to a Python with torch installed}"
|
| 24 |
+
|
| 25 |
+
MARCH_ARGS=()
|
| 26 |
+
if [ -n "${PLANTDETECT_MARCH:-}" ]; then
|
| 27 |
+
MARCH_ARGS+=("-DPLANTDETECT_MARCH=${PLANTDETECT_MARCH}")
|
| 28 |
+
fi
|
| 29 |
+
|
| 30 |
+
cmake -S "$ROOT/extension/moe" -B "$BUILD_DIR" -G Ninja \
|
| 31 |
+
-DEXECUTORCH_SOURCE_DIR="$EXECUTORCH_SOURCE_DIR" \
|
| 32 |
+
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
|
| 33 |
+
-DCMAKE_BUILD_TYPE=Release \
|
| 34 |
+
-DEXECUTORCH_BUILD_KERNELS_CUSTOM_AOT=OFF \
|
| 35 |
+
"${MARCH_ARGS[@]}"
|
| 36 |
+
|
| 37 |
+
# Schema generators first: works around the upstream Ninja byproduct issue and keeps
|
| 38 |
+
# the flatcc/flatbuffers codegen on the host.
|
| 39 |
+
cmake --build "$BUILD_DIR" --target flatbuffers_ep flatcc_ep --parallel "$(nproc)"
|
| 40 |
+
cmake --build "$BUILD_DIR" --target plant_runner plant_fp16_test --parallel "$(nproc)"
|
| 41 |
+
|
| 42 |
+
file "$BUILD_DIR/plant_runner"
|
| 43 |
+
echo "built $BUILD_DIR/plant_runner"
|