Develop and verify required kernels
Derive kernel, shape, layout and precision coverage from real call sites, including projection dimensions, tails, padding, live context and execution modes. Read the applicable verification contract. Reuse evidence only when its dependencies and coverage match.
A registry reference can guide an applicable primitive check, but standalone tile choices, numerical receipts and timings do not automatically transfer to an embedded fused operator. Establish arithmetic, ABI/packing, producer/consumer and resource compatibility, and verify the affected implementation. Reuse unchanged internal kernels and matching evidence; missing isolated coverage remains missing, without introducing a mandatory decomposition step.
- Select from the actual implementation path. Identify whether the production caller consumes registry configuration or uses a custom fused implementation. For registry-backed primitives, read the datapath, tunables, constraints, reference, harness and measured rows; GEMM lookup matches exact shape, output dtype and precision. For current Q4NX fused decode, start from its existing builder/C++/packing/runtime and analyze the affected mapping. Follow registry scope and hit/miss guidance: a miss in a required primitive lookup needs bounded development/tuning, but an absent standalone row does not require replacing or rebuilding the fused implementation. A hit can include a documented
NUMFAILrow; neither lookup success nor a mean-error statistic establishes numerical PASS. - Develop and optimize. Use Optimization at kernel scope for implementation, tiling, layout, storage or supply choices. This can precede a complete model. Check divisibility, tail coverage, strides, independent allocations, staging and transfer counts against source and hardware facts.
- Obtain staged evidence. Use static, compile-time and runtime checks. Compilation success is not a numerical verdict; preserve unsupported and missing properties explicitly.
- Apply the kernel gate. Run the applicable harness against its registry reference and compare the full required output elementwise with its fixed
rtolandatol:abs(actual - reference) <= atol + rtol * abs(reference). Use the harness's dtype conversion and nonfinite policy. Select the threshold for the actual precision/output path before the candidate run; do not relax it after failure. Reference and tolerance details explain the relation to GPU/framework testing and the inspected representative values. Any required state outputs or interface cases belong to that kernel/task contract, not a new global verification stage. - Compare and hand off. Rank only passing candidates. Measure the caller-required output boundary, including conversion when needed, under the task's repeat/stability policy. Return implementation/configuration, arithmetic/layout, ABI, packing/weight assumptions, complete comparison receipt, thresholds, coverage, scoped timing and integration obligations to model verification. Propose only validated/measured registry rows within the authorized scope; frozen evaluations keep them local.
Read the actual harness/Makefile before selecting commands; targets and flags vary. Bind source/build/artifact/input/reference identities. If no isolated harness covers a kernel, report that missing verification coverage explicitly. In-context observations or layer cosine cannot be relabeled a full-output kernel PASS; optional integration diagnosis can help build a targeted check or localize a failure.
For small outputs or silent corruption, inspect divisibility, packing, address coverage and lowered execution. Use resource diagnosis, merge debug, attention debug or BO debug according to the evidence.
Do not exhaust tuning before useful integration or force a kernel-only task through a full model. A kernel handoff covers its listed cases; a model deployment separately needs the full-model gate and its complete performance boundary.