Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions python/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions rust/lance-linalg/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ fn main() -> Result<(), String> {
println!("cargo:rustc-cfg=feature=\"nightly\"");
}

// Let clippy know about our custom cfg attribute
// Let clippy know about our custom cfg attributes
println!("cargo::rustc-check-cfg=cfg(kernel_support, values(\"avx512\"))");
println!("cargo::rustc-check-cfg=cfg(kernel_support_dist_table, values(\"avx512\"))");

println!("cargo:rerun-if-changed=src/simd/f16.c");
println!("cargo:rerun-if-changed=src/simd/dist_table.c");
Expand Down Expand Up @@ -61,7 +62,9 @@ fn main() -> Result<(), String> {
err
);
} else {
println!("cargo:rustc-cfg=kernel_support=\"avx512\"");
// Use a separate cfg flag for dist_table to avoid symbol mismatch
// when f16 build succeeds but dist_table build fails (or vice versa)
println!("cargo:rustc-cfg=kernel_support_dist_table=\"avx512\"");
};
// Build a version with AVX
// While GCC doesn't have support for _Float16 until GCC 12, clang
Expand Down
4 changes: 2 additions & 2 deletions rust/lance-linalg/src/simd/dist_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn sum_4bit_dist_table(
debug_assert!(n.is_multiple_of(BATCH_SIZE));

match *SIMD_SUPPORT {
#[cfg(all(kernel_support = "avx512", target_arch = "x86_64"))]
#[cfg(all(kernel_support_dist_table = "avx512", target_arch = "x86_64"))]
SimdSupport::Avx512 | SimdSupport::Avx512FP16 => unsafe {
for i in (0..n).step_by(BATCH_SIZE) {
let codes = &codes[i * code_len..(i + BATCH_SIZE) * code_len];
Expand Down Expand Up @@ -162,7 +162,7 @@ unsafe fn sum_dist_table_32bytes_batch_avx2(codes: &[u8], dist_table: &[u8], dis
// We implement the AVX512 version in C because AVX512 is not stable yet in Rust,
// implement it in Rust once we upgrade rust to 1.89.0.
extern "C" {
#[cfg(all(kernel_support = "avx512", target_arch = "x86_64"))]
#[cfg(all(kernel_support_dist_table = "avx512", target_arch = "x86_64"))]
pub fn sum_4bit_dist_table_32bytes_batch_avx512(
codes: *const u8,
code_length: usize,
Expand Down
Loading