okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Metal build: stubs for the f-0216-cpu 512-bit entry points (q2_rows_512_ok, iq512f_supported, iq512_fused_gu_rows, iq512_reference_gu_rows, q50_512_down_rows)10831eceb

main
1.8 KiB33 linesraw
1// metal/src/engine/stubs_025.cpp - 0.2.5: native_expert.cpp (shared with the PC engine) now asks whether the 512-bit i-quant rows may take a
2// one-token expert and whether their grid lookups are gathers.  Those rows live in src/kernels/cpu/iq_avx512.cpp, an x86 AVX-512 file the
3// Apple build does not compile.  Here they answer "not available"; native_expert.cpp only calls iq512x_rows behind cpu_avx512_ok() and
4// iq512x_supported(), both false on arm64, so the stopping stub below is never reached.
5
6#include <cstddef>
7#include <cstdint>
8
9namespace strata::metal_engine { void missing(const char* name); }
10
11namespace strata::kernels::cpu {
12
13bool iq512_gather_on() noexcept { return false; }
14bool iq512x_supported(int) noexcept { return false; }
15void iq512x_rows(int, const uint8_t*, size_t, int, const void* const*, int, float* const*, int, int) {
16    strata::metal_engine::missing("strata::kernels::cpu::iq512x_rows");
17}
18
19// round 0216 (f-0216-cpu): the fused gate/up, reference gate/up, Q5_0 down and Q2_0 512-bit rows; the callers ask cpu_vnni_ok() /
20// iq512f_supported() first, and both answer no on arm64, so the stopping stubs are never reached.
21bool q2_rows_512_ok() { return false; }
22bool iq512f_supported(int) noexcept { return false; }
23void iq512_fused_gu_rows(int, const uint8_t*, size_t, size_t, int, const void* const*, int, float* const*, int, int) {
24    strata::metal_engine::missing("strata::kernels::cpu::iq512_fused_gu_rows");
25}
26void iq512_reference_gu_rows(int, const uint8_t*, size_t, size_t, int, const void* const*, int, float* const*, int, int) {
27    strata::metal_engine::missing("strata::kernels::cpu::iq512_reference_gu_rows");
28}
29void q50_512_down_rows(const uint8_t*, size_t, int, const void* const*, int, float* const*, int, int) {
30    strata::metal_engine::missing("strata::kernels::cpu::q50_512_down_rows");
31}
32
33}  // namespace strata::kernels::cpu