TensorRT-LLM conversion and build scripts fail after NumPy is upgraded inside a pinned container
NGC containers ship a set of extensions compiled against a specific NumPy major version. Installing anything that pulls a newer NumPy replaces the runtime those extensions were built for, and the next conversion or build script fails inside a TensorRT-LLM module that has nothing to do with the package that was installed.
Something upgraded NumPy inside the image. Pin it back to the major version the container shipped with; the extensions are already compiled for it, so nothing has to be rebuilt.
- Symptom
A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.1 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0.- Root cause
- Compiled Python extensions bind to NumPy's binary interface at build time, not at import time. A major NumPy release changes that interface, so an extension built against the previous one is no longer loadable even though the Python-level API looks unchanged and pip records no conflict. The container's value is that its extensions, CUDA libraries and NumPy were built and pinned together.
- Recommended fix
- Pin NumPy back to the major version the image shipped with before doing anything else; the extensions are already built for it and nothing needs recompiling.
- How Denpex helps
- Denpex investigates TensorRT-LLM conversion and build scripts fail after NumPy is upgraded inside a pinned container using the evidence you provide or your connected workload collects. Earlier rank, host or application evidence is needed to distinguish an initiating failure from a downstream report.
What this failure is
A binary-interface incompatibility in which compiled extensions bundled with a TensorRT-LLM container are loaded against a NumPy major version different from the one they were built for, failing inside TensorRT-LLM rather than in the package that triggered the change.
Is this what broke your run? Paste your log.
You're reading about TensorRT-LLM conversion and build scripts fail after NumPy is upgraded inside a pinned container. Paste your own traceback and relevant evidence for an investigation of your workload, with a next action or a specific missing fact. A reference entry does not establish your cause. No account or card for the free diagnosis. Review data handling before submitting sensitive logs.
Before uploading, review cloud data handling and local options.
Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.
Why it happens (the mechanism)
The container is a matched set of binaries and the versions they were compiled against. Pip understands version requirements but not which compiled artefacts depend on the version it is satisfying, so an unrelated requirements file can replace a foundation that other binaries are standing on. Nothing reports a conflict because, at the metadata level, there is none.
What you'll observe
- The container is the official one and the command is from the documentation, and it still fails
- The traceback points into tensorrt_llm rather than at anything that was installed
- It worked in a fresh container and stopped after an unrelated pip install
- Reinstalling TensorRT-LLM does not help, because the incompatibility is with a dependency
Common symptoms and what they mean
Check possible explanations against the incident evidence. A matching symptom alone does not establish its cause.
| Symptom | Possible explanation |
|---|---|
| A module that was compiled using NumPy 1.x cannot be run in NumPy 2.x as it may crash | Compiled Python extensions bind to NumPy's binary interface at build time, not at import time. A major NumPy release changes that interface, so an extension built against the previous one is no longer loadable even though the Python-level API looks unchanged and pip records no conflict. |
| Traceback ending in tensorrt_llm/_common.py or tensorrt_llm/builder.py during a conversion or build step | The container's value is that its extensions, CUDA libraries and NumPy were built and pinned together. Installing a package whose metadata merely asks for a newer NumPy is enough to break that set, because pip resolves the request without knowing which binaries depend on the version it is replacing. |
| TypeError: set_weights_name(): incompatible function arguments. The following argument types are supported | The traceback misleads because the first thing to import a compiled extension is what raises. That is usually a TensorRT-LLM internal module, so the component that reports the failure is rarely the component whose installation caused it. |
| Invoked with: an INetworkDefinition, a raw array with a dtype and shape, and a weight name string | Compiled Python extensions bind to NumPy's binary interface at build time, not at import time. A major NumPy release changes that interface, so an extension built against the previous one is no longer loadable even though the Python-level API looks unchanged and pip records no conflict. |
| A pybind11 overload resolution failure where a numpy array is passed where tensorrt.Weights is expected | The container's value is that its extensions, CUDA libraries and NumPy were built and pinned together. Installing a package whose metadata merely asks for a newer NumPy is enough to break that set, because pip resolves the request without knowing which binaries depend on the version it is replacing. |
| Traceback through tensorrt_llm/parameter.py set_name into network.trt_network.set_weights_name | The traceback misleads because the first thing to import a compiled extension is what raises. That is usually a TensorRT-LLM internal module, so the component that reports the failure is rarely the component whose installation caused it. |
Which systems are affected
- NGC TensorRT-LLM and Triton containers, whose extensions are compiled against a pinned NumPy
- Model conversion scripts shipped as source in the examples directory, run against an installed wheel
- Any environment where a requirements file for a model or dataset is installed on top of the image
- Long-lived container images that accumulate packages rather than being rebuilt
How to confirm this is the problem
Use this checklist to test the hypothesis against a small reproduction. No single line proves the root cause, so preserve the preceding events and compare one variable at a time.
- ✓Print the installed NumPy version and compare it against the version the image shipped with; a major-version difference is the whole explanation.
- ✓Read the traceback upward to the first frame that is not inside NumPy. That names the incompatible binary.
- ✓Run the identical command in a freshly started container from the same image. Success there confirms the environment was mutated rather than the command being wrong.
Root cause
- Compiled Python extensions bind to NumPy's binary interface at build time, not at import time. A major NumPy release changes that interface, so an extension built against the previous one is no longer loadable even though the Python-level API looks unchanged and pip records no conflict.
- The container's value is that its extensions, CUDA libraries and NumPy were built and pinned together. Installing a package whose metadata merely asks for a newer NumPy is enough to break that set, because pip resolves the request without knowing which binaries depend on the version it is replacing.
- The traceback misleads because the first thing to import a compiled extension is what raises. That is usually a TensorRT-LLM internal module, so the component that reports the failure is rarely the component whose installation caused it.
The fix and how to prevent it
How to fix it
- Pin NumPy back to the major version the image shipped with before doing anything else; the extensions are already built for it and nothing needs recompiling.
- Read the traceback from the bottom upward to the first frame outside NumPy itself. That frame names the package whose binary is incompatible, which is the one to align.
- Install model or dataset requirements with the container's pinned versions constrained, so a transitive dependency cannot move a package the image's binaries depend on.
- Rebuild the image rather than mutating a running container when a newer NumPy is genuinely required, so the extensions are compiled against the version that will be present.
- Prefer the official image for the TensorRT-LLM release in use over assembling the stack by hand, since the pinning is the thing being bought.
Step-by-step remediation
- 1Establish what was installed into the container between the last working run and the failure.
- 2Compare the installed NumPy against the version the image shipped with.
- 3Find the first frame outside NumPy; it names the binary that is incompatible.
- 4Reinstall the original NumPy major version; no extension needs rebuilding.
- 5Re-run the same command in a fresh container from the same image.
How to prevent it
- Treat the container's dependency set as part of the release: record what was installed on top of it, and rebuild rather than patch when that set has to change.
- Run conversion and build steps in a container that receives no ad-hoc installs, separately from experimentation.
- Constrain pip against the image's existing versions so an unrelated requirement cannot silently upgrade a pinned binary dependency.
Save this diagnosis and catch the next crash automatically
All root cause, fix, and prevention steps above are free to read. Create a free account with any email or GitHub to keep your saved diagnosis history across the encyclopedia and run cloud checks, or use a work email below for the 30-day Team evaluation. No card required.
Or start a 30-day free Team trial (work email)
Verified work email unlocks all 14 fleet diagnostic tools, Slack alerts, and team history for 30 days. No card and no automatic charge.
Searchable error signature
A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.1 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0.
File "/opt/venv-tritonserver/lib/python3.12/site-packages/tensorrt_llm/_common.py", line 224, in decorated
File "/opt/venv-tritonserver/lib/python3.12/site-packages/tensorrt_llm/builder.py", line 1267, in buildUse this text as a lookup key in logs and upstream issue trackers. It is not presented as a captured customer log. Confirm the cause from your own preceding events, versions, configuration and the cited references.
Diagnose your own log automatically
The root cause and fix steps above stay free. Create a free account to analyze full job logs, attribute the first failed rank, and keep saved incident history.
Sign up free. Analyze your cluster logsNo credit card. Daily allowance follows verified trust tier. Instant access.
Why the recommended fix works
Restoring the original major version returns the binary interface the extensions expect, so they load again with no recompilation. It is a faster and more reliable fix than upgrading the extensions, because the container already contains a consistent set and the only thing that changed was one member of it.
Best practices by model family
| Model / Stack | Recommendation | Notes |
|---|---|---|
| Container worked, then stopped | Pin NumPy back to the image's major version | The extensions are already built for it. |
| Installing model requirements | Constrain pip against the image's existing versions | Stops a transitive requirement replacing a pinned binary dependency. |
| Genuinely need newer NumPy | Rebuild the image, do not mutate the container | Extensions must be compiled against the version that will be present. |
| Assembling the stack by hand | Use the official image for the release | The matched pinning is the thing the image provides. |
With the fix vs without the fix
| Dimension | With the fix | Without the fix |
|---|---|---|
| What pip checks | Declared version requirements | Assumed to include binary compatibility |
| What the traceback names | The first module to import a compiled extension | Read as the component at fault |
| Correct response | Restore the pinned version | Reinstall TensorRT-LLM |
Diagnostic note
“The traceback is actively misleading and costs the most time here. It points into TensorRT-LLM, so the instinct is to reinstall TensorRT-LLM or blame the conversion script, when the offending change was a pip install performed minutes earlier for something unrelated. If a container worked and then stopped without the command changing, reconstruct what was installed into it before reading the traceback at all.”
Visual fingerprint
image as shipped extensions compiled against NumPy 1.x + NumPy 1.x -> works pip install <thing> requirement asks for NumPy >= 2 -> NumPy 2.x installed next build extensions compiled against NumPy 1.x + NumPy 2.x -> fails pip reports no conflict: the requirement was satisfiable
Diagnose this failure in VS Code
Select the traceback or open the failed terminal, then run Denpex locally to inspect matched failure patterns, supporting evidence and next checks without uploading the log. Verify recommendations against your workload before changing production.
Install the free VS Code extensionRelated failures to investigate next
Frequently asked questions
Questions engineers and on-call staff commonly ask about this failure.
Why does the traceback point at TensorRT-LLM?
Pip did not warn me about a conflict.
Should I reinstall TensorRT-LLM?
I actually need the newer NumPy.
Don't just read the fix, diagnose your run
The encyclopedia explains documented failure patterns. Denpex investigates your logs, configuration and stack, shows the supporting evidence, and asks for missing details when needed.