Skip to content

fix: properly skip fp16kernels if not enabled and allow building on ios#5866

Closed
chyyran wants to merge 1 commit intolance-format:release/v1.0from
6over3:v1.0.4-ios
Closed

fix: properly skip fp16kernels if not enabled and allow building on ios#5866
chyyran wants to merge 1 commit intolance-format:release/v1.0from
6over3:v1.0.4-ios

Conversation

@chyyran
Copy link
Copy Markdown
Contributor

@chyyran chyyran commented Jan 31, 2026

Previously even if fp16kernels was disabled, the check would still fail and cause a build failure when trying to build lance-linalg.

The motivation was to enable building on aarch64-apple-ios. This PR also adds support for mtune=apple-a13 when building for iOS, which is the earliest supported iOS architecture at time of writing.

This is intended for merge to the 1.0 branch of lance. Let me know if its preferable to PR it to main and backport the change after.

@github-actions github-actions Bot added the bug Something isn't working label Jan 31, 2026
Previously, even if fp16kernels was disabled via no-default-features,
the feature check failed.
@wjones127 wjones127 self-assigned this Feb 3, 2026
Copy link
Copy Markdown
Contributor

@wjones127 wjones127 left a comment

Choose a reason for hiding this comment

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

A similar change was previously suggested in #5747

However, I pointed out we might still want to run build_dist_table_with_flags even if we haven't enabled fp16kernels. We already guard before building the kernels here:

if cfg!(not(feature = "fp16kernels")) {
println!(
"cargo:warning=fp16kernels feature is not enabled, skipping build of fp16 kernels"
);
return Ok(());
}

What was the build failure you were getting?

Copy link
Copy Markdown
Contributor

@wjones127 wjones127 left a comment

Choose a reason for hiding this comment

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

See previous comment.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chyyran
Copy link
Copy Markdown
Contributor Author

chyyran commented Feb 9, 2026

@wjones127 When building the main branch of LanceDB (lance-linalg 2.0.0 last I checked)

error: failed to run custom build command for `lance-linalg v2.0.0`

Caused by:
  process didn't exit successfully: `/Users/ronny/coding/lena/lancedb/target/debug/build/lance-linalg-0bf9b9dda1273bf3/build-script-build` (exit status: 1)
  --- stdout
  cargo::rustc-check-cfg=cfg(kernel_support, values("avx512"))
  cargo:rerun-if-changed=src/simd/f16.c
  cargo:rerun-if-changed=src/simd/dist_table.c

  --- stderr
  Error: "Unable to build f16 kernels on given target_arch.  Please use x86_64 or aarch64 or remove the fp16kernels feature"
warning: build failed, waiting for other jobs to finish...

After #5747 the build error seems to be fixed. I can't rebase this on main so I'll open a new PR for the A13 optimized build on iOS.

@chyyran chyyran closed this Feb 9, 2026
wjones127 pushed a commit that referenced this pull request Feb 10, 2026
This PR also adds support for `mtune=apple-a13` when building
lance-linalg for iOS, which is the earliest supported iOS architecture
at time of writing.

This is pulled out of #5866
after the initial bug was fixed in
#5747 and lancedb updated to
Lance 2.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants