You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since d0c49c67 ("Default TensorRT transformer trunks to NHWC", #1218) made trtTransformerNHWC = true the default in v1.17, transformer models fail to build a
TensorRT engine when maxBatchSize is large. With numSearchThreads = 576 the build
fails every time, so KataGo cannot start at all unless the user knows to set trtTransformerNHWC = false.
NCHW builds fine at the same batch sizes on the same machine, so this is specific to the
NHWC trunk layout.
Error
IBuilder::buildSerializedNetwork: Error Code 10: Internal Error
(Could not find any implementation for node
{ForeignNode[model.blocks.0.normactconvp.conv.Wnhwc + ONNXTRT_Broadcast...model.act_trunkfinal]}.
In computeCosts at /_src/optimizer/common/tactic/optimizer.cpp:4265)
3/3 runs failed. Same config with trtTransformerNHWC=false: 3/3 succeeded.
The failure depends on maxBatchSize
maxBatchSize is derived from the thread count, and it determines whether the build
succeeds. Evidence from the trtcache directory — NCHW produced plan-cache entries for
every batch size tried, NHWC only for the small ones:
maxBatchSize
NCHW
NHWC
b16
built
built
b64
built
built
b576
built
never builds
This also explains why the failure initially looked intermittent: at 16 NN server threads
it reproduced roughly 1 in 10 runs, which is near a batch-size boundary where success
depends on the exact graph. At b576 it is deterministic.
numNNServerThreadsPerModel = 16, 2 threads per GPU
Notes on what it is not
Not the JIT tactic source restriction. Adding a switch to drop setTacticSources(kJIT_CONVOLUTIONS) did not help: 3/3 runs still failed with
Error Code 10. Those lines are also unchanged since v1.16.5.
Not a startup-concurrency problem. It reproduces with a single NN server thread
building on one GPU.
Not runtime-related. Once a plan cache exists for a batch size that does build, NHWC
inference runs fine — the failure is confined to buildSerializedNetwork.
Suggested handling
The FP32 pinning may be involved: the failing node is a fused region spanning conv.Wnhwc through act_trunkfinal, and the ONNX path sets kOBEY_PRECISION_CONSTRAINTS with RMSNorm/head layers pinned to FP32. A hard constraint
over a fused NHWC region may leave TensorRT with no valid tactic. Possible directions:
Fall back to NCHW automatically when the NHWC build fails, instead of aborting.
Relax the pinned layers from kOBEY to kPREFER for the NHWC path (needs accuracy
validation).
Reconsider NHWC as the default until the large-batch case is resolved, since users
running high thread counts hit this on first startup with no obvious diagnosis.
Summary
Since
d0c49c67("Default TensorRT transformer trunks to NHWC", #1218) madetrtTransformerNHWC = truethe default in v1.17, transformer models fail to build aTensorRT engine when
maxBatchSizeis large. WithnumSearchThreads = 576the buildfails every time, so KataGo cannot start at all unless the user knows to set
trtTransformerNHWC = false.NCHW builds fine at the same batch sizes on the same machine, so this is specific to the
NHWC trunk layout.
Error
The process then aborts (exit code 134).
Reproduction
3/3 runs failed. Same config with
trtTransformerNHWC=false: 3/3 succeeded.The failure depends on maxBatchSize
maxBatchSizeis derived from the thread count, and it determines whether the buildsucceeds. Evidence from the
trtcachedirectory — NCHW produced plan-cache entries forevery batch size tried, NHWC only for the small ones:
This also explains why the failure initially looked intermittent: at 16 NN server threads
it reproduced roughly 1 in 10 runs, which is near a batch-size boundary where success
depends on the exact graph. At b576 it is deterministic.
Environment
b11c768h12nbt3tflrs-fson-silu(nbt transformer, 70.4M params), FP16numNNServerThreadsPerModel = 16, 2 threads per GPUNotes on what it is not
setTacticSources(kJIT_CONVOLUTIONS)did not help: 3/3 runs still failed withError Code 10. Those lines are also unchanged since v1.16.5.
building on one GPU.
inference runs fine — the failure is confined to
buildSerializedNetwork.Suggested handling
The FP32 pinning may be involved: the failing node is a fused region spanning
conv.Wnhwcthroughact_trunkfinal, and the ONNX path setskOBEY_PRECISION_CONSTRAINTSwith RMSNorm/head layers pinned to FP32. A hard constraintover a fused NHWC region may leave TensorRT with no valid tactic. Possible directions:
kOBEYtokPREFERfor the NHWC path (needs accuracyvalidation).
running high thread counts hit this on first startup with no obvious diagnosis.
nhwc_b576_fail_1.log
nhwc_b576_fail_2.log
nhwc_b576_fail_3.log