metal: the Metal engine links again; two prompt-path entry points had no Metal stub

The staged prompt walk (3feffd597) calls fused::want_dm_f16, and the few-row
expert path (af5803e4b) calls fewrows_record. Both are defined only in the
CUDA / HIP sources. Prefill::run_impl is linked into the Metal engine but never
runs there, so every entry point it calls needs a stub, and these two had none:
strata failed to link with two undefined symbols.

stubs_prompt_f16.cpp holds both: want_dm_f16 does nothing (the build has no
fused kernels), fewrows_record stops the engine with its name like the other
stubs (it is only reached with the research switch STRATA_PF_FEWROWS set). No
shared source is touched.
This commit is contained in:
Niko1221 committed 2026-11-12 13:53:05 +01:00
1 parent a269d4c82b
commit b1db4ab8e4
1 file changed
+23
+23
View File
@@ -0,0 +1,23 @@
// metal/src/engine/stubs_prompt_f16.cpp - two entry points of the CUDA / HIP prompt path that the Metal engine does not implement:
// the F16 request of the fused expert kernels and the few-row expert plan record. Prefill::run_impl (src/prefill/prefill.cpp) calls
// them but does not run on Metal (the prompt chunks are metal/src/engine/window.cpp, see stubs_df2.cpp); they exist so the shared host
// files link.
// fused::want_dm_f16 asks the fused kernels to write the down rows as FP16 (gfx11): this build has no fused kernels, nothing to ask.
// fewrows_record STRATA_PF_FEWROWS (research switch, off): the plan record of a few-row expert, written by a CUDA kernel;
// stops the engine with its name, like stubs.cpp, if it is ever reached.
#include <cstdint>
#include "strata/prefill/kernels.hpp"
#include "strata/prefill/moe_fused_iq.hpp"
namespace strata::metal_engine { void missing(const char* name); }
namespace strata::prefill {
void fewrows_record(void*, const void*, int, int, void*) {
strata::metal_engine::missing("strata::prefill::fewrows_record");
}
namespace fused {
void want_dm_f16(bool) {}
} // namespace fused
} // namespace strata::prefill