Skip to content

ngt: Add version 2.8.1 - #3407

Merged
luhenry merged 3 commits into
mainfrom
ngt
Nov 3, 2026
Merged

luhenry merged 3 commits into
mainfrom
ngt

Conversation

@luhenry

@luhenry luhenry commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Compiles Yahoo Japan's NGT nearest-neighbor graph index (a pybind11/CMake C++ library, distinct from the already-published faiss-cpu/hnswlib/annoy/usearch/voyager) into ngtpy*.so. Upstream publishes no riscv64 wheel.

Mirrors the riscv64-portable baseline recipe already documented in upstream's own python/pyproject.toml [tool.cibuildwheel.linux] (no GitHub Actions wheel-building workflow exists upstream; this is what their own PyPI wheels are built from).

Differs from upstream

  • Stages the ngt-src/ checkout the recipe expects next to the Python package - not committed upstream, built by their own release tooling instead
  • Drops a -mno-neon flag their generic non-x86/non-ARM CMake branch wrongly applies on riscv64 (patch, build fails without it)

Testing

  • Upstream ships no pytest suite for the bindings; synthesizes a create/insert/search smoke test

License: Apache-2.0, nothing third-party vendored. -fopenmp links libgomp (GPL), so a gpl_sources job collects gcc's sources.

Patches

  • 0001-cmake-drop-the-arm-only-mno-neon-flag-on-non-arm-no.patch - Inappropriate [riscv64 is neither ARM nor x86; GCC rejects -mno-neon outright on this target]. Build fails to configure without it; reproduces on any non-x86/non-ARM target, not riscv64-only.

CI pending; no local build check (no docker/riscv64 in this environment).

Yahoo Japan's NGT (a nearest-neighbor graph index distinct from the already
-published faiss-cpu/hnswlib/annoy/usearch/voyager) publishes manylinux
wheels for x86_64/aarch64 but none for riscv64. Mirror the portable
NGT_AVX_DISABLED/NGT_MARCH_NATIVE_DISABLED baseline build documented in
upstream's own python/pyproject.toml cibuildwheel config, narrowed to
riscv64, with a small patch dropping an ARM-only -mno-neon flag that its
generic "other architecture" branch wrongly applies to riscv64 too.
@github-actions
github-actions Bot marked this pull request as draft October 16, 2026 00:34
cibuildwheel's before_all step runs with cwd set to the cibuildwheel
project root (the whole checkout), not package-dir. The staged
ngt-src/ checkout lives under python/ngt-src (package-dir), so the
cmake invocation in CIBW_BEFORE_ALL_LINUX couldn't find it there and
failed with 'CMake Error: The source directory "/project/ngt-src"
does not exist.' on cp312/cp313/cp314t.

cd into {package} first, matching the pattern already used in
build-libuuu.yml, so the before_all commands operate in the same
directory where ngt-src was staged and where NGT_STATIC_LIBRARY_PATH/
NGT_INCLUDE_DIR are later resolved during the actual wheel build.
The folded >- CIBW_TEST_COMMAND put `python3 -c "` on its own line, so
the fold left a leading space before `import ngtpy`. CPython 3.12 and
3.13 reject that with "IndentationError: unexpected indent", while 3.14
tolerates it, which is why only the cp312/cp313 legs failed. Start the
script on the same line as the opening quote.
@luhenry
luhenry marked this pull request as ready for review November 2, 2026 11:35
@luhenry
luhenry merged commit deae245 into main Nov 3, 2026
10 checks passed
@luhenry
luhenry deleted the ngt branch November 3, 2026 02:27
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