Repository navigation
Add Python inference bindings to the Native wheel (#24070) - #24070
JakeStevens wants to merge 2 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24070
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Cancelled JobAs of commit 6cecdfa with merge base bf9bef3 ( CANCELLED JOB - The following job was cancelled. Please retry:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@JakeStevens has exported this pull request. If you are a Meta employee, you can view the originating Diff in D126686193. |
This PR needs a
|
c6f082d to
143c146
Compare
Summary: Pull Request resolved: pytorch#24070 Expose Native `Model` and `Session` through NumPy bindings in the separately installable `executorch-native` wheel, using its shared runtime. Keep the binding implementation, Python wrappers, type stubs, and binding tests in `backends/native/pybindings`, alongside the Native runtime. Place the Python vision runner beside the C++ runner in `backends/native/examples/vision` and install it as `executorch_native.vision`. Bundle pretrained MobileNetV2, a preprocessed cat tensor, ImageNet labels, and reference logits in the existing SDK example location so `python -m executorch_native.vision` runs offline with just Native and NumPy. The default uses GGML and checks every logit against the reference; `--engine vulkan` selects Vulkan. Custom model and input paths remain paired, with optional labels and reference outputs. Use the existing `examples/native/vision/export.py` to regenerate artifacts; keep the source image with that exporter and use its `mv2` filenames for the bundled assets. Asset provenance, export versions, and checksums are documented with the data. The wheel uses the CPython ABI and includes the `pybind11` license. allow-large-files: The 14,097,630-byte pretrained MobileNetV2 `.ptn` and its demo tensors are intentionally checked in so the installed Native vision demo runs offline without exporter dependencies. Artifact provenance and SHA-256 checksums are documented alongside the files. Authored with assistance from Codex. Differential Revision: D126686193
Summary: Pull Request resolved: pytorch#24070 Expose Native `Model` and `Session` through NumPy bindings in the separately installable `executorch-native` wheel, using its shared runtime. Keep the binding implementation, Python wrappers, type stubs, and binding tests in `backends/native/pybindings`, alongside the Native runtime. Place the Python vision runner beside the C++ runner in `backends/native/examples/vision` and install it as `executorch_native.vision`. Bundle pretrained MobileNetV2, a preprocessed cat tensor, ImageNet labels, and reference logits in the existing SDK example location so `python -m executorch_native.vision` runs offline with just Native and NumPy. The default uses GGML and checks every logit against the reference; `--engine vulkan` selects Vulkan. Custom model and input paths remain paired, with optional labels and reference outputs. Use the existing `examples/native/vision/export.py` to regenerate artifacts; keep the source image with that exporter and use its `mv2` filenames for the bundled assets. Asset provenance, export versions, and checksums are documented with the data. The wheel uses the CPython ABI and includes the `pybind11` license. allow-large-files: The 14,097,630-byte pretrained MobileNetV2 `.ptn` and its demo tensors are intentionally checked in so the installed Native vision demo runs offline without exporter dependencies. Artifact provenance and SHA-256 checksums are documented alongside the files. Authored with assistance from Codex. Differential Revision: D126686193
143c146 to
90920fa
Compare
SS-JIA
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
…orch#24069) Summary: Add a separately installable Linux SDK wheel containing the Native runtime, Vulkan engine and shaders, and GGML CPU engine. Its CMake package lets consumers build the shipped vision runner without rebuilding the runtime, and the package coexists with `executorch`. Keep the standalone wheel recipe in `backends/native/python` and its Python wrappers alongside the runtime in `backends/native/pybindings`. CMake installs those sources into `executorch_native`; the source tree does not need a nested copy of the import package. Python execution bindings are added in the following diff. Authored with assistance from Codex. Reviewed By: SS-JIA Differential Revision: D126459370
Summary: Expose Native `Model` and `Session` through NumPy bindings in the separately installable `executorch-native` wheel, using its shared runtime. Keep the binding implementation, Python wrappers, type stubs, and binding tests in `backends/native/pybindings`, alongside the Native runtime. Place the Python vision runner beside the C++ runner in `backends/native/examples/vision` and install it as `executorch_native.vision`. Bundle pretrained MobileNetV2, a preprocessed cat tensor, ImageNet labels, and reference logits in the existing SDK example location so `python -m executorch_native.vision` runs offline with just Native and NumPy. The default uses GGML and checks every logit against the reference; `--engine vulkan` selects Vulkan. Custom model and input paths remain paired, with optional labels and reference outputs. Use the existing `examples/native/vision/export.py` to regenerate artifacts; keep the source image with that exporter and use its `mv2` filenames for the bundled assets. Asset provenance, export versions, and checksums are documented with the data. The wheel uses the CPython ABI and includes the `pybind11` license. Authored with assistance from Codex. Differential Revision: D126686193
90920fa to
6cecdfa
Compare
Summary:
Expose Native
ModelandSessionthrough NumPy bindings in the separately installableexecutorch-nativewheel, using its shared runtime. Keep the binding implementation, Python wrappers, type stubs, and binding tests inbackends/native/pybindings, alongside the Native runtime.Place the Python vision runner beside the C++ runner in
backends/native/examples/visionand install it asexecutorch_native.vision. Bundle pretrained MobileNetV2, a preprocessed cat tensor, ImageNet labels, and reference logits in the existing SDK example location sopython -m executorch_native.visionruns offline with just Native and NumPy. The default uses GGML and checks every logit against the reference;--engine vulkanselects Vulkan. Custom model and input paths remain paired, with optional labels and reference outputs.Use the existing
examples/native/vision/export.pyto regenerate artifacts; keep the source image with that exporter and use itsmv2filenames for the bundled assets. Asset provenance, export versions, and checksums are documented with the data. The wheel uses the CPython ABI and includes thepybind11license.Authored with assistance from Codex.
Differential Revision: D126686193