Skip to content

fix(linalg): build on architectures without SIMD kernels - #9446

Merged
BubbleCal merged 1 commit into
lance-format:mainfrom
sunyuechi:riscv64-scalar-simd-fallback
Sep 28, 2026
Merged

BubbleCal merged 1 commit into
lance-format:mainfrom
sunyuechi:riscv64-scalar-simd-fallback

Conversation

@sunyuechi

Copy link
Copy Markdown
Contributor

f32x8/f32x16, f64x4/f64x8 and i32x8 only exist on x86_64, aarch64 and loongarch64, so lance-linalg fails to compile elsewhere (riscv64, s390x, ppc64le).

When Ceph enables Lance by default, the RISC-V build fails: ceph/ceph#71935

f32x8/f32x16, f64x4/f64x8 and i32x8 only exist on x86_64, aarch64 and
loongarch64, so lance-linalg fails to compile elsewhere (riscv64,
s390x, ppc64le). Back them with plain arrays under a `simd_fallback`
cfg set by build.rs.

Signed-off-by: Sun Yuechi <[email protected]>
@github-actions github-actions Bot added A-index Vector index, linalg, tokenizer bug Something isn't working labels Sep 21, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Sep 21, 2026
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this pull request Sep 24, 2026
1. Merge lance-format/lance#9446 to fix build
on powerpc64*.
2. Add missing TEST_DEPENDS.
@sunyuechi

Copy link
Copy Markdown
Contributor Author

@Xuanwo @BubbleCal PTAL. Tested on riscv64, and FreeBSD ports already carries it

@lance-gatekeeper lance-gatekeeper Bot removed K-risk Latest Gatekeeper recommendation includes a non-blocking risk. K-approved Latest Gatekeeper recommendation permits acceptance. labels Sep 28, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gate recommendation: approve.

The author reports a successful riscv64 test, and FreeBSD ports carries the same fallback patch for powerpc64. That addresses the cross-target validation concern in my earlier review. The scalar backends preserve the existing SIMD trait behavior and provide a focused fix for unsupported-architecture builds.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 28, 2026
@BubbleCal

Copy link
Copy Markdown
Contributor

I think we should just add the support for riscv if that's what you are using, or this can be super slow.

@BubbleCal
BubbleCal merged commit 3d3fded into lance-format:main Sep 28, 2026
39 of 42 checks passed
luhenry added a commit to riseproject-dev/python-wheels that referenced this pull request Oct 10, 2026
lancedb v0.40.0 pins lance-core/lance-linalg =13.0.0, and lance 13.0.0
ships the portable SIMD fallback the 0002 patch carried
(lance-format/lance#9446, "fix(linalg): build on architectures without SIMD
kernels"): lance-linalg's build.rs now emits `cfg(simd_fallback)` for
every target_arch other than x86_64/aarch64/loongarch64, and
f32x8/f32x16/f64x4/f64x8/i32x8 gain an array-backed struct plus a scalar
arm in each method under that cfg, inserted right after the per-arch
struct definitions -- which is why the 0002 hunks no longer apply there.
Rebasing them would define each type twice on riscv64, so both patches
go: with no local lance fix to point at, the 0001 Cargo.toml redirect is
moot and the crates.io lance 13.0.0 in lancedb's Cargo.lock is used as
released.

The patch-apply and lance-checkout steps now run only when the version
being built has patches under patches/lancedb/<version>/, the same
hashFiles() gate build-fastparquet.yml uses, so the 0.37.1-0.39.0 path
is unchanged.

Checked by type-checking lance v13.0.0's simd/{f32,f64,i32,u8}.rs for
riscv64gc-unknown-linux-gnu: clean with simd_fallback set, and the old
"cannot find type `f32x8`" errors without it.

Signed-off-by: Ludovic Henry <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-index Vector index, linalg, tokenizer bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants