Skip to content

Re-enable the TensorRT integration test - #40139

Open
akshayjadiyanv wants to merge 2 commits into
apache:masterfrom
akshayjadiyanv:tensorrt-reenable-it
Open

akshayjadiyanv wants to merge 2 commits into
apache:masterfrom
akshayjadiyanv:tensorrt-reenable-it

Conversation

@akshayjadiyanv

@akshayjadiyanv akshayjadiyanv commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Re-enables the TensorRT Dataflow integration test, which has been disabled since #33078.

Follow-up to #39922, which raised the handler's minimum to TensorRT 10 and added the script that rebuilds the staged engines. @tvalentyn has now staged the rebuilt engines and pushed the updated test container image, so the last two pieces are in place.

Fixes #33078

What changed

Engine paths. The staged .trt objects are now the TensorRT 11 rebuilds, uploaded alongside the 2022 originals rather than over them:

gs://apache-beam-ml/models/single_tensor_features_engine_trt11.trt
gs://apache-beam-ml/models/multiple_tensor_features_engine_trt11.trt
gs://apache-beam-ml/models/ssd_mobilenet_v2_320x320_coco17_tpu-8_trt11.trt

Six references in tensorrt_inference_test.py and one in common.gradle now point at them. The .onnx sources are untouched — ONNX is not version locked, only serialized engines are.

Driver request. tensorRTtests asked for install-nvidia-driver with no version. The test container is now TensorRT 11 on CUDA 13.3, which needs a 580 or newer driver, so without this the job would fail at CUDA init rather than at engine load. This matches what the vLLM integration tests already request on the neighbouring lines.

Re-enabled the task in the py312 post-commit suite. It moved to py312 in #39922 because the new base image is Python 3.12.

How the engines were produced

With sdks/python/test-suites/containers/tensorrt_runinference/build_test_engines.py, added in #39922. It rebuilds each engine from the ONNX source already staged beside it, and verifies the result by loading it back through TensorRTEngineHandlerNumPy — the two small engines against the exact values the unit tests assert, and the object detection engine against the same COCO images this integration test uses. Nothing is uploaded until verification passes.

On my own run, on a Tesla T4 with TensorRT 11.0.0.114 in nvcr.io/nvidia/tensorrt:26.06-py3:

  • single_tensor_features_engine[2.5, 10.5, -5.5, 20.5]
  • multiple_tensor_features_engine[17.5, 36.5, -27.5, 3.0]
  • ssd_mobilenet_v2_320x320_coco17_tpu-8 → top scores 0.77 and 0.72 on the two COCO images

The staged engines have been rebuilt with TensorRT 11 and uploaded alongside
the 2022 originals, so the tests can be pointed at them and the Dataflow
integration test can come back.

- Point the engine paths at the _trt11 objects. The ONNX sources are
  unchanged, since ONNX is not version locked.
- Request install-nvidia-driver:5xx rather than an unversioned driver. The
  test container is now TensorRT 11 on CUDA 13.3, which needs a 580 or newer
  driver, and would otherwise fail at CUDA init rather than at engine load.
  This matches what the vLLM integration tests already request.
- Re-enable tensorRTtests in the py312 post-commit suite.

Fixes apache#33078
@tvalentyn

Copy link
Copy Markdown
Contributor

Is there post commit trigger file we should trivially modify to kick-off this test in the CI?

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @tvalentyn for label python.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@tvalentyn

Copy link
Copy Markdown
Contributor

exec {
executable 'sh'
args '-c', ". ${envdir}/bin/activate && pip install pillow && python -m apache_beam.examples.inference.tensorrt_object_detection $cmdArgs --experiment='worker_accelerator=type:nvidia-tesla-t4;count:1;install-nvidia-driver' --experiment=no_use_multiple_sdk_containers"
args '-c', ". ${envdir}/bin/activate && pip install pillow && python -m apache_beam.examples.inference.tensorrt_object_detection $cmdArgs --experiment='worker_accelerator=type:nvidia-tesla-t4;count:1;install-nvidia-driver:5xx' --experiment=no_use_multiple_sdk_containers"

@tvalentyn tvalentyn Sep 16, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use 5xx anymore.

https://docs.cloud.google.com/dataflow/docs/gpu/use-gpus#drivers

I would try the default driver without any mods, and if not working, then use 'latest'.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch - thanks! And yes, beam_PostCommit_Python.json looks to be the right trigger file. Made both changes

Dataflow only accepts 'default' and 'latest' for install-nvidia-driver, and
an unrecognized value makes the driver install fail, so the 5xx request this
PR introduced would have broken the test rather than fixed it. Reverted to the
unversioned default per review; 'latest' is the fallback if the default driver
turns out to be too old for TensorRT 11 on CUDA 13.3.

Also bump .github/trigger_files/beam_PostCommit_Python.json so the Python
post-commit runs against this PR. That suite reaches tensorRTtests through
python312PostCommit -> inferencePostCommitITPy312, which is the only way to
exercise the rebuilt engines before merging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Failing Test]: Fix and re-enable the TensorRT integration test

2 participants