Repository navigation
pnnx: Add version 20260526 - #3264
Merged
Merged
Conversation
luhenry
added a commit
that referenced
this pull request
Oct 15, 2026
luhenry
marked this pull request as draft
October 15, 2026 12:13
All four build jobs of run 38676705597 built and repaired the wheel, then failed every test with FileNotFoundError on the *_pnnx.py the converter should have written: the bundled pnnx executable never ran (no stderr, although main() prints its parameters first). The executable is non-PIE, linked at riscv64's default base 0x10000. When auditwheel grafts libtorch/libc10/libtorch_cpu it rewrites the executable with patchelf, which prepends a segment at 0xe000, below the runners' vm.mmap_min_addr, so the kernel kills it at exec without output (gotcha 595). Link it with -Wl,-Ttext-segment=0x200000 via LDFLAGS. Once the executable runs, the generated *_pnnx.py modules import numpy unconditionally, so add numpy to the test requirements (binary-only: PyPI's newest numpy has no riscv64 wheel), as upstream's own test job does. Also pass the release version to setup.py, which otherwise stamps the wheel with the build date (the run above built pnnx-20261015).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pnnx20260526Compiles the
pnnxCLI (PyTorch TorchScript -> pnnx IR / ncnn conversion), linking libtorch. Upstream publishes no riscv64 wheel.Mirrors the
import torch-probed CMake path upstream's ownquick-test/testjobs use (.github/workflows/pnnx.yml), not thebuildjob's from-scratch patched static-mobile libtorch + torchvision + onnxruntime rebuild, which is far too heavy to replicate for a new arch.Differs from upstream
cp3xx-manylinux_riscv64tags, not upstream's hand-setpy3-none-<platform>.Testing
python/tests(test_convert,test_export, and the dynamic/naive-input variants) viaCIBW_TEST_SOURCES- same cases upstream'spython-pnnxCI step runs, minus ONNX/TorchVision-only tests this build doesn't carry.License: Wheel bundles torch's
libtorch/libc10/libgompvia auditwheel, same as any other port here linking our torch wheel; ncnn's top-level BSD-3-ClauseLICENSE.txtis staged into the wheel since it lives three directories abovesetup.py.Patches
0001-cmake-require-c-20-for-pytorch-2.13.patch- Backport [https://github.com/Tencent/ncnn/commit/61ea75123d0ea71e4b029742664e3d49b7c8eec6]. Without it, torch>=2.13 headers (the only riscv64 torch we host) fail with "C++20 or later compatible compiler is required to use ATen"; reproduces on x86_64 too, confirmed locally against PyPI's CPU torch.Built and tested locally on x86_64 against PyPI's CPU torch 2.14.1: the patched CMake configure finds Torch, skips TorchVision/onnxruntime gracefully, and the built binary passes all 6 of upstream's own
python/testscases plus an end-to-endpnnx.convertnumerical check.