Skip to content

fix(metal-test): rename test-local fp8_nblk, which quant.h now also declares - #845

Merged
JustVugg merged 1 commit into
devfrom
fix/metal-test-fp8-nblk
Aug 5, 2026
Merged

fix(metal-test): rename test-local fp8_nblk, which quant.h now also declares#845
JustVugg merged 1 commit into
devfrom
fix/metal-test-fp8-nblk

Conversation

@JustVugg

@JustVugg JustVugg commented Aug 5, 2026

Copy link
Copy Markdown
Owner

make metal-test has not compiled on macOS since quant.h gained static inline int64_t fp8_nblk, because tests/test_backend_metal.mm defines its own static int fp8_nblk and includes quant.h further down the same translation unit.

error: functions that differ only in their return type cannot be overloaded

Matching the return type alone does not help — it becomes an inline-vs-non-inline redefinition instead.

This file keeps independent reference implementations on purpose (its own comment: "NOT quant.h's E4M3_LUT"), so the local helper takes the ref_ prefix the other independent helpers here already use, rather than deferring to quant.h and losing the independence the test exists for.

Diagnosed, fixed and verified by @J-Oe-2 on an M5 Max — macOS 26.5.1, Homebrew libomp, command-line tools only: metal-test builds and every case passes, including GEMM, fused attention with grouped-qa, and top-8 select with E ≠ 256. This PR is his patch.

I also checked that no other symbol is defined in both files — this was the only collision.

Timing note: @RDouglasSharp is rebasing #587 tomorrow morning and would have walked straight into this.

Closes #838

…eclares

`make metal-test` has not compiled on macOS since quant.h gained

    static inline int64_t fp8_nblk(int n)

because tests/test_backend_metal.mm defines its own `static int fp8_nblk`
and includes quant.h further down the same translation unit:

    error: functions that differ only in their return type cannot be overloaded

Matching the return type alone does not help — it becomes an inline vs
non-inline redefinition instead. The file keeps independent reference
implementations on purpose (its own comment: "NOT quant.h's E4M3_LUT"), so
the local helper takes the ref_ prefix the other independent helpers here
already use, rather than deferring to quant.h and losing the independence
the test exists for.

Diagnosed, fixed and verified by @J-Oe-2 on an M5 Max (macOS 26.5.1,
Homebrew libomp, command-line tools only): metal-test builds and every case
passes, including GEMM, fused attention with grouped-qa, and top-8 select
with E != 256.

Also checked that no other symbol is defined in both files.

Closes #838

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@JustVugg
JustVugg merged commit 552c2eb into dev Aug 5, 2026
16 checks passed
@JustVugg
JustVugg deleted the fix/metal-test-fp8-nblk branch August 5, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant