From ba5df2f4017e273366482e2d4aeba59b0242ebda Mon Sep 17 00:00:00 2001 From: Filipe Martins <293984334+filipemartinsubrobotics@users.noreply.github.com> Date: Fri, 11 Sep 2026 14:26:03 -0700 Subject: [PATCH] fix: say why Int4GroupwiseGemmPluginV2 cannot execute when its kernels are absent ENABLE_CUTE_DSL defaults to "fmha", which omits int4_fp16_gemm. An INT4 model built that way compiles the plugin with CUTE_DSL_INT4_FP16_GEMM_ENABLED undefined, so enqueue() returns -1 from the #else branch with no message. Nothing upstream of that point fails: the CuTe DSL archive builds, the plugin compiles and registers, the ONNX graph parses, the engine builds and serialises, and the runtime loads it. The first and only symptom appears at inference as [E] Error Code: 2: int4_groupwise_gemm_v2_4: Failed to enqueue status -1 [E] IExecutionContext::enqueueV3: Error Code 1: Myelin ... Custom layer callback failed which names a tactic and a Myelin callback, and points at the kernel rather than at the build configuration that omitted it. Working back to a cmake default took a while; instrumenting the module loader and getting no output at all was what finally showed the whole block had been compiled out. Log once, naming the flag that fixes it. std::call_once keeps it off the per-enqueue path, is already included, and LOG_ERROR is already used in this file, so no new includes. Behaviour is unchanged: the branch still returns -1. A configure-time check would catch this earlier still -- cmake knows both whether the INT4 plugin is being built and whether the group is in ENABLE_CUTE_DSL -- but that touches the build system, so this is the smaller change. Happy to add it if you would prefer it there. Found while bringing up an INT4-AWQ Cosmos3-Edge checkpoint on a DGX B300 during the NVIDIA / OpenHackathons / Oracle Open Models Codefest 2026. Signed-off-by: Filipe Martins <293984334+filipemartinsubrobotics@users.noreply.github.com> --- .../int4GroupwiseGemmPluginV2.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cpp/plugins/int4GroupwiseGemmPluginV2/int4GroupwiseGemmPluginV2.cpp b/cpp/plugins/int4GroupwiseGemmPluginV2/int4GroupwiseGemmPluginV2.cpp index 00b891d3c..b4905e601 100644 --- a/cpp/plugins/int4GroupwiseGemmPluginV2/int4GroupwiseGemmPluginV2.cpp +++ b/cpp/plugins/int4GroupwiseGemmPluginV2/int4GroupwiseGemmPluginV2.cpp @@ -408,6 +408,19 @@ int32_t Int4GroupwiseGemmPluginV2::enqueue(PluginTensorDesc const* inputDesc, Pl return cuteDslInt4GemmLaunch(v, inputs[0], inputs[1], inputs[2], outputs[0], (v.splitK > 1) ? mLockWorkspace : nullptr, M, mGemmN, mGemmK, /*swizzle=*/1, stream); #else + // The CuTe DSL INT4 kernels are not in this build, so there is nothing to dispatch to. + // Without a message the only symptom is "Failed to enqueue status -1" at inference time, + // long after the plugin registered, the engine built and the runtime loaded -- none of + // which fail. Log once rather than per enqueue. + static std::once_flag disabledKernelsWarning; + std::call_once(disabledKernelsWarning, + [] + { + LOG_ERROR( + "Int4GroupwiseGemmPluginV2: this build has no CuTe DSL INT4 kernels, so the plugin cannot " + "execute. Reconfigure with -DENABLE_CUTE_DSL=\"fmha;int4_fp16_gemm\" -- the default is " + "\"fmha\" alone, which omits the INT4 GEMM group -- and rebuild."); + }); return -1; #endif }