Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python pnnx with pnnx binary #5067

Merged
merged 46 commits into from
Dec 11, 2023
Merged

Conversation

Hideousmon
Copy link
Contributor

@Hideousmon Hideousmon commented Oct 6, 2023

Python wheels have been created for PNNX using Pybind with CI.

You can find the release test, combined with pytest, at the following location: https://github.com/Hideousmon/ncnn/actions/runs/6433620002 .

The pytest files are available here: https://github.com/Hideousmon/ncnn/tree/python-pnnx-with-pybind/tools/pnnx/python/tests .

A basic documentation can be found here: https://github.com/Hideousmon/ncnn/blob/python-pnnx-with-pybind/tools/pnnx/python/README.md , which can also be found in this pull request.

The codes for Pypi publishment in the .yml file are currently commented out. A new API Token for PNNX project may need to be created first.

Note:

  1. The pnnx2onnx feature is currently disabled, primarily due to limitations in my PC's environment for building protobuf.
  2. Presently, we offer support exclusively for x86_64 (amd64) architecture. This limitation is primarily due to the significant amount of additional work required to expand compatibility.

@Hideousmon Hideousmon changed the title Python pnnx with pybind [WIP] Python pnnx with pybind Oct 9, 2023
@Hideousmon
Copy link
Contributor Author

Hideousmon commented Oct 9, 2023

TO DO:

  • enable pnnx2onnx feature.
  • fix wheels repairing on linux & macos.
  • check workability with different versions of pytorch after wheels repairing.
  • expand compatibility for different platforms.

@Hideousmon Hideousmon force-pushed the python-pnnx-with-pybind branch from b5ce6bb to 57c29c3 Compare October 28, 2023 13:50
@Hideousmon Hideousmon changed the title [WIP] Python pnnx with pybind Python pnnx with pnnx binary Oct 30, 2023
@Hideousmon
Copy link
Contributor Author

The attempt with pybind is aborted because of a challenging error for me under GCC, which is a segmentation fault when simultaneously using the pre-compiled pnnx shared library alongside the pytorch.
Now the python pnnx wheel contains a pnnx binary to avoid the utilization of shared library. The release test and functions test can be found at: https://github.com/Hideousmon/pnnx/actions/runs/6691173863
A corresponding pull request is on pnnx/pnnx for ci release: pnnx/pnnx#94 .

@nihui nihui mentioned this pull request Dec 1, 2023
@nihui nihui merged commit ef29bbe into Tencent:master Dec 11, 2023
3 of 6 checks passed
@nihui
Copy link
Member

nihui commented Dec 11, 2023

虽然还有点细节的问题,先merge了!
Thanks for your contribution !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants