Skip to content

fix: fall back to AVX2 f16 kernels on AVX-512 CPUs#7428

Open
paramt wants to merge 1 commit into
lance-format:mainfrom
paramt:codex/fix-f16-avx512-fallback
Open

fix: fall back to AVX2 f16 kernels on AVX-512 CPUs#7428
paramt wants to merge 1 commit into
lance-format:mainfrom
paramt:codex/fix-f16-avx512-fallback

Conversation

@paramt

@paramt paramt commented Jun 23, 2026

Copy link
Copy Markdown

Fix f16 SIMD dispatch on x86 CPUs that have AVX-512F but do not have native AVX512-FP16 support.

Today, those CPUs are classified as SimdSupport::Avx512. The f16 dispatch for L2, dot, cosine, and norm L2 handles Avx512FP16 and Avx2, but not plain Avx512, so it falls through to the scalar implementation. This change routes plain Avx512 to the AVX2 f16 kernels while keeping Avx512FP16 on the native AVX512-FP16 kernels.

This matches the existing bf16 behavior:

@github-actions github-actions Bot added A-index Vector index, linalg, tokenizer bug Something isn't working labels Jun 23, 2026
@paramt paramt marked this pull request as ready for review June 23, 2026 19:51
@paramt paramt force-pushed the codex/fix-f16-avx512-fallback branch from d54e2c9 to 8c2c58b Compare June 23, 2026 20:07
@paramt paramt changed the title fix: fall back to AVX2 f16 L2 on AVX-512 CPUs fix: fall back to AVX2 f16 kernels on AVX-512 CPUs Jun 23, 2026

@westonpace westonpace left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense to me. Thanks! Will merge when CI passes

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants