engine: host-domain binding for weightless host-only ops

bind_ops falls back to the host domain when an op is host-only and carries no
weight tensors: a plugin declaring host-only math gets the same binding path as
device ops, with no model-specific quirk. Adds the R4D_DIAG kernel-selection
trace in plugin selection (default off).
This commit is contained in:
sfjes committed 2026-10-10 00:36:08 -07:00
1 parent 73bfc310aa
commit 61cf8b7b1a
2 files changed
+17 -1

No files matched your search

+8
View File
@@ -11,6 +11,7 @@
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <utility>
#include <vector>
@@ -139,6 +140,13 @@ const KernelRow* Registry::select(std::string_view op, const Geometry& g, int do
}
}
static const int seldbg = std::getenv("R4D_DIAG") ? 1 : 0; /* kernel-selection trace; R4D_DIAG=1 */
if (seldbg && std::string(op) == "attn_paged" && domain == RAD_DOMAIN_DEVICE) {
std::fprintf(stderr, "[SELDBG] %s | best=%s\n", t.query.c_str(), best ? best->info->name : "(none)");
for (const auto& c : t.candidates)
std::fprintf(stderr, " %-28s prio=%-3d ok=%d why=%s\n", c.kernel.c_str(),
c.priority, (int)c.ok, c.why.c_str());
}
if (best) {
t.kernel = best->info->name;
t.plugin = best->plugin;