Repository navigation
Conversation
Builds Alibaba's MNN inference engine (CPU backend, vendored protobuf and flatbuffers built from source) and its PyMNN python bindings for riscv64. CMAKE_SYSTEM_PROCESSOR gates every SIMD backend (SSE/AVX/ ARM82) off on riscv64, leaving MNN's own scalar CPU kernels; MNN also carries a real optional RVV backend (MNN_USE_RVV), left off for this first port. Mirrors upstream's pymnn_linux.yml: build_deps.py once, then pymnn/pip_package/build_wheel.py per interpreter.
luhenry
added a commit
that referenced
this pull request
Oct 13, 2026
luhenry
marked this pull request as draft
October 13, 2026 09:26
Contributor
|
The manylinux image's cp312+ interpreters ship without setuptools, so build_wheel.py's 'python setup.py bdist_wheel' died with ModuleNotFoundError and no wheel was produced. Also restrict numpy to binary wheels so build_wheel.py's 'pip install -U numpy<2.5' takes the registry's riscv64 wheel instead of building the 2.4.6 sdist (~23 min per interpreter).
opencv-python 5.0.0.93, the only riscv64 build in the registry, returns 1-D Mats for 1-D input, so cv2.merge/cv2.split give (9, 3) and (12,) where MNN.cv (and opencv-python<5, which upstream pins) give (9, 1, 3) and (12, 1). Upstream's x86_64 mnn 3.6.1 wheel fails the same two tests with opencv-python 5.0.0.93 and passes all 180 with opencv-python 4.14.
This branch has not been deployed
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.
mnn3.6.1Builds Alibaba's MNN inference engine (CPU backend, vendored protobuf and flatbuffers built from source) and its PyMNN python bindings. Upstream publishes no riscv64 wheel.
Mirrors upstream's
pymnn_linux.yml.Differs from upstream
build_deps.py llm- additive LLM/omni engine, out of scope for a first port.build_wheel.py's hardcodedmanylinux1_x86_64plat-name - riscv64 is unlisted there;auditwheel repairretags the wheel instead.opencv-python<5relaxed to unpinned - the registry only carries 5.0.0.93 for riscv64.Matrix: cp312/cp313/cp314 - upstream ships no cp314t wheel for any platform.
Testing
pymnn/test/unit_test.py), minustest_mergeandtest_split_image_channels: they compare 1-D inputs against opencv 4's(N, 1)shape, and opencv-python 5 returns 1-D Mats. Upstream's own x86_64 mnn 3.6.1 wheel fails the same two tests with opencv-python 5.0.0.93 and passes all 180 with opencv-python 4.14.License: Wheel links libgomp (GPL, via
-fopenmp) from the build image;gpl_sourcescollects gcc's source RPM.Patches
0001-pymnn-riscv64-plat-name.patch- Inappropriate [riscv64 unlisted by upstream's own packaging script]. Without it the wheel is mislabeled manylinux1_x86_64 and pip never selects it on riscv64.CI running on this PR branch; no results yet.