okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
df44bcb71
main
1// metal/src/engine/stubs_144.cpp - the 0.1.44 PC entry points the Metal engine does not implement (merge of the Mac branch 2// with the PC release): new overloads / new functions that stubs.cpp (generated) does not know. Each either stops the engine 3// with its name (like stubs.cpp) or, where the caller has a documented fallback, answers "not available". None is reached 4// with the Metal defaults: STRATA_COMMIT_BATCH is off on Metal, the NVFP4 CPU rows need AVX2 / AVX-512, and the K-quant / 5// NVFP4 prompt paths are CUDA / HIP only. 6 7#include <cstddef> 8#include <cstdint> 9 10#include "strata/kernels/cpu/nvfp4_avx2.hpp" 11#include "strata/kernels/cpu/nvfp4_avx512.hpp" 12#include "strata/kernels/iq_kernels.hpp" 13#include "strata/kernels/native_qsa_indexer.hpp" 14#include "strata/kernels/qsa_decode_attn.hpp" 15#include "strata/kernels/qsa_select.hpp" 16#include "strata/kernels/verify_kernels.hpp" 17#include "strata/prefill/kernels.hpp" 18 19namespace strata::metal_engine { 20void missing (const char * name ); 21} 22 23namespace strata::kernels { 24void iq_dequant_f16 (int ,const void * ,int64_t ,uint16_t * ,void * ,const float * ) { strata::metal_engine::missing ("strata::kernels::iq_dequant_f16(scale)" ); } 25void iq_dequant_gu_f16 (int ,const void * ,const void * ,int64_t ,int64_t ,uint16_t * ,void * ,const float * ) { strata::metal_engine::missing ("strata::kernels::iq_dequant_gu_f16(tail)" ); } 26bool gdn_commit_layers (float * ,int64_t ,int64_t ,const float * ,int64_t ,const float * ,int64_t ,const float * ,const float * ,int64_t , 27int ,int ,int ,int ,int ,const int32_t * ,void * ) {return false; }// "nothing launched: keep the per-layer loop" 28void native_qsa_indexer_append_steps_layers (const float * ,int64_t ,const int32_t * ,int ,int ,int32_t ,float ,const QsaIndexerLayers & ,int , 29const QsaShapes & ,int64_t ,const RopeScaling & ,void * ) { 30 strata::metal_engine::missing ("strata::kernels::native_qsa_indexer_append_steps_layers" ); 31} 32}// namespace strata::kernels 33 34namespace strata::prefill { 35void moe_combine (const float * ,const int32_t * ,const float * ,const float * ,const float * ,float * ,int64_t ,void * ,const float * ) { 36 strata::metal_engine::missing ("strata::prefill::moe_combine(row_sd)" ); 37} 38}// namespace strata::prefill 39 40namespace strata::kernels::cpu { 41bool nvfp4_256_fits (int ) {return false; } 42bool nvfp4_512_fits (int ) {return false; } 43void nvfp4_256_gu_rows (const uint8_t * ,size_t ,size_t ,int ,const void * const * ,int ,float * const * ,int ,int ,float ,float ) { 44 strata::metal_engine::missing ("strata::kernels::cpu::nvfp4_256_gu_rows" ); 45} 46void nvfp4_256_rows (const uint8_t * ,size_t ,int ,const void * const * ,int ,float * const * ,int ,int ,float ) { 47 strata::metal_engine::missing ("strata::kernels::cpu::nvfp4_256_rows" ); 48} 49void nvfp4_512_gu_rows (const uint8_t * ,size_t ,size_t ,int ,const void * const * ,int ,float * const * ,int ,int ,float ,float ) { 50 strata::metal_engine::missing ("strata::kernels::cpu::nvfp4_512_gu_rows" ); 51} 52void nvfp4_512_rows (const uint8_t * ,size_t ,int ,const void * const * ,int ,float * const * ,int ,int ,float ) { 53 strata::metal_engine::missing ("strata::kernels::cpu::nvfp4_512_rows" ); 54} 55}// namespace strata::kernels::cpu 56 57// STRATA_QSA_SLOTS (PR #2364): the one-launch-over-the-rows QSA launchers have no Metal kernel; false = "run the per-row calls", 58// which is what Verifier::record_window does on a decline. 59namespace strata::kernels { 60bool qsa_block_scores_slots (const float * const * ,const float * const * ,const float * ,const int32_t * ,int64_t ,int64_t , 61const QsaShapes & ,float * ,void * ) {return false; } 62bool qsa_decode_attn_slots (const float * ,const QsaAttnSlotPools & ,const int32_t * ,const int32_t * ,int64_t ,const QsaShapes & , 63float * ,float * ,int64_t ,void * ) {return false; } 64}// namespace strata::kernels