ashvardanian / ashvardanian/NumKong
Bug: v7.7.1 sdist build misdetects AVX512-FP16 compiler support
- Dominant language
- C
- Stars
- 1.9k
- Forks
- 130
- Avg merge
- 18h 28m
- Merged PRs (30d)
- 3
Description
## Current status
The `numkong==7.7.1` source distribution failed to build on Vercel Linux x86_64 with CPython 3.12.13 because the configuration probe enabled the Sapphire Rapids target, while the compiler later rejected `target("avx512fp16")`.
As of 2026-07-24, `pip index versions numkong` lists 7.7.0 as the latest public PyPI version. AlbumentationsX temporarily excludes 7.7.1 with `numkong!=7.7.1`. This avoids the downstream installation failure. The compiler-probe mismatch remains relevant for source builds from the v7.7.1 tag.
## Environment
- NumKong: 7.7.1 source distribution
- Python: CPython 3.12.13
- Platform: Vercel Linux x86_64
- Compiler executable: `/usr/bin/cc`
- Build frontend: pip / PEP 517
## Failure
```text
[NumKong] Probe NK_TARGET_SAPPHIREAMX: supported
[NumKong] Probe NK_TARGET_TURIN: supported
...
cc1: error: attribute ‘avx512fp16’ argument ‘target’ is unknown
error: command '/usr/bin/cc' failed with exit code 1
ERROR: Failed building wheel for numkong
```
The failing compilation includes `dispatch_bf16.c`.
## Reproduction
```bash
python3.12 -m pip install --no-binary=numkong numkong==7.7.1
```
## Expected behavior
The feature probe should compile the same target attribute used by the dispatch translation units. If the compiler rejects `target("avx512fp16")`, the build should disable that target and continue with supported kernels.
Publishing a compatible CPython 3.12 Linux wheel also avoids this path for ordinary installs. The source build should remain valid independently.
## Suggested regression coverage
- Build with a GCC version that accepts the command-line probe flags but rejects the function target attribute.
- Assert that Sapphire/AVX512-FP16 dispatch is disabled and the extension still builds.
- Keep the probe source and the dispatch attribute spelling synchronized.
Contributor guide
Research direction
Start by reproducing the CPython 3.12 source build with `pip install --no-binary=numkong numkong==7.7.1` and inspect the failing `dispatch_bf16.c` compilation. Locate the feature-probe source, compare its probe with the dispatch target attribute, and add the suggested regression coverage; done means unsupported AVX512-FP16 is disabled while the extension still builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100