feat(sampler): port linear MTP coupling and cooperative verify upstream

Port GitHub PRs #12 and #13 onto Codeberg upstream main, retaining upstream kernel-chain handling. Include the source Clang target-attribute fixes required by the host build; omit the KFD header workaround and unrelated fork work.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
committed 2026-10-22 22:58:08 +02:00
1 parent 123c439684
commit d912c694f3
37 files changed
+3730 -23

No files matched your search

+13 -1
View File
@@ -549,9 +549,21 @@ typedef int (*RadKernelCollectiveFn)(int i);
* - the engine refuses to serve a model with an op only a reference library implements, unless
* given --debug-accept-reference-kernels;
* - rad-kbench checks every other library against it.
* Without the symbol, or with 0, it is an ordinary library. Symbol name: `rad_plugin_reference`. */
* Without the symbol, or with 0, it is an ordinary library. Symbol name: `rad_plugin_reference`.
*
* It is a whole-library answer, because a library is usually one implementation of one thing. A
* plugin that ships a device row AND the host oracle beside it is not: marking the library would
* mark its device rows too, and the engine would refuse to serve an op that has a real kernel.
* Such a plugin exports `rad_kernel_reference` below and leaves this one 0. */
typedef int (*RadPluginReferenceFn)(void);
/* Optional, per row: nonzero says kernel `i` of rad_kernel_at is that row's reference
* implementation. Overrides `rad_plugin_reference` for the rows it is exported for, so one
* library can declare a device row (0) and its host oracle (1) side by side. A plugin that
* exports neither leaves every row classified by `rad_plugin_reference`. Symbol name:
* `rad_kernel_reference`. */
typedef int (*RadKernelReferenceFn)(int i);
#ifdef __cplusplus
} /* extern "C" */
#endif