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

+4 -1
View File
@@ -261,7 +261,10 @@ AVX_QB_TARGET static void qb_codes(const QbTab& q, const uint8_t* src, int64_t n
* of the j-th 32 codes. A code minus its zero lies in [-31, 31], exact in bf16: `t` holds bf16(i -
* 32) for i < 64, which one vpermt2w indexes by code - zero + 32. u5 codes are 40 bits for each
* eight, deposited into bytes by pdep (BMI2, which the caller checked). */
AVX_QB_TARGET __attribute__((target("bmi2"))) static void qb_codes_zp(
/* One target list, not AVX_QB_TARGET plus a second attribute: clang keeps only the last target
* attribute on a declaration and would then compile this without the AVX-512 features its
* intrinsics need. GCC merges the two; the combined list is the form both accept. */
__attribute__((target("avx512f,avx512bw,avx512vl,avx512bf16,bmi2"))) static void qb_codes_zp(
const uint8_t* row, int bits, int64_t n, int64_t npad, uint16_t* dst, const int32_t* zr,
const __m512i* t) {
for (int64_t i = 0; i < npad; i += 32) {