Skip to content

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.

Quick answer

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.
Environment#tensorrt-llm#numpy#abi#container#convert-checkpoint#dependency-pinning

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.

Live diagnosis, no signup

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.

training_logs.txt
No log to hand? Try one:

Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.

3 free cloud diagnoses per day

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.

SymptomPossible explanation
A module that was compiled using NumPy 1.x cannot be run in NumPy 2.x as it may crashCompiled 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 stepThe 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 supportedThe 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 stringCompiled 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 expectedThe 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_nameThe 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

  1. 1Establish what was installed into the container between the last working run and the failure.
  2. 2Compare the installed NumPy against the version the image shipped with.
  3. 3Find the first frame outside NumPy; it names the binary that is incompatible.
  4. 4Reinstall the original NumPy major version; no extension needs rebuilding.
  5. 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.

Use your company email, for example alex@yourcompany.com.

Who qualifies?

Company email domains activate the free 30-day Team evaluation (up to 50 diagnoses a day) after an email and domain check, whatever mail provider you use. If we cannot verify your domain automatically, support reviews it: write to support@denpex.com. Free local diagnosis in the editor extension needs no account.

Using a personal email (Gmail, Outlook, Naver, QQ) or solo cluster? Create a free $0 account (no work email required) to save 7-day history and unlock AI fallback, or send a cluster crash log for a live walkthrough.
Already have an account? Sign in

Searchable error signature

search key
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 build

Use 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 logs

No 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 / StackRecommendationNotes
Container worked, then stoppedPin NumPy back to the image's major versionThe extensions are already built for it.
Installing model requirementsConstrain pip against the image's existing versionsStops a transitive requirement replacing a pinned binary dependency.
Genuinely need newer NumPyRebuild the image, do not mutate the containerExtensions must be compiled against the version that will be present.
Assembling the stack by handUse the official image for the releaseThe matched pinning is the thing the image provides.

With the fix vs without the fix

DimensionWith the fixWithout the fix
What pip checksDeclared version requirementsAssumed to include binary compatibility
What the traceback namesThe first module to import a compiled extensionRead as the component at fault
Correct responseRestore the pinned versionReinstall 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

Why an unrelated install breaks the build
  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
The extensions bind to NumPy's binary interface when they are compiled. Replacing NumPy with a new major version satisfies pip's requirement while invalidating every binary that was built against the old one.

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 extension

Frequently asked questions

Questions engineers and on-call staff commonly ask about this failure.

Why does the traceback point at TensorRT-LLM?
Whatever first imports a compiled extension raises. That is usually a TensorRT-LLM internal module, so the reporter is rarely the cause.
Pip did not warn me about a conflict.
There is none at the metadata level. Pip checks declared version requirements, not which compiled binaries were built against the version it replaced.
Should I reinstall TensorRT-LLM?
No. Its extensions are intact; the foundation under them changed. Restore the pinned NumPy major version instead.
I actually need the newer NumPy.
Rebuild the image so the extensions are compiled against it. Mutating a running container leaves binaries built for the old interface.

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.