Skip to content

mnn: Add version 3.6.1 - #2969

Draft
luhenry wants to merge 3 commits into
mainfrom
mnn
Draft

luhenry wants to merge 3 commits into
mainfrom
mnn

Conversation

@luhenry

@luhenry luhenry commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Builds 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

  • Drops build_deps.py llm - additive LLM/omni engine, out of scope for a first port.
  • Patches build_wheel.py's hardcoded manylinux1_x86_64 plat-name - riscv64 is unlisted there; auditwheel repair retags the wheel instead.
  • opencv-python<5 relaxed 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

  • same as upstream (pymnn/test/unit_test.py), minus test_merge and test_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_sources collects 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.

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
luhenry marked this pull request as draft October 13, 2026 09:26
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://riseproject-dev.github.io/python-wheels/pr-preview/pr-2969/

Built to branch gh-pages at 2026-10-13 13:50 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant