pytorch / pytorch/TensorRT

πŸ› [Bug] flux Examples are broken in thor platform

Open
#4,068 3 comments 0 reactions 1 assignee View on GitHub

@lanluo-nvidia is already working on this.

Since Feb 4, 2026.

bug story: LLM & Generative AI
Dominant language
Python
Stars
3k
Forks
410
Avg merge
3d 18h
Merged PRs (30d)
78

Description

Bug Description


File "/workspace/TensorRT/tools/perf/Flux/flux_perf.py", line 111, in <module>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 9.95G/9.95G [04:10<00:00, 87.5MB/s]
    main(args)
  File "/workspace/TensorRT/tools/perf/Flux/flux_perf.py", line 53, in main
    pipe, backbone, trt_gm = compile_model(args)
  File "/workspace/TensorRT/tools/perf/Flux/../../../examples/apps/flux_demo.py", line 144, in compile_model
    image = pipe(
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 124, in decorate_context
    return func(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/diffusers/pipelines/flux/pipeline_flux.py", line 828, in __call__
    ) = self.encode_prompt(
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/diffusers/pipelines/flux/pipeline_flux.py", line 363, in encode_prompt
    pooled_prompt_embeds = self._get_clip_prompt_embeds(
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/diffusers/pipelines/flux/pipeline_flux.py", line 299, in _get_clip_prompt_embeds
    prompt_embeds = self.text_encoder(text_input_ids.to(device), output_hidden_states=False)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1776, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1787, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/transformers/utils/generic.py", line 943, in wrapper
    output = func(self, *args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/transformers/models/clip/modeling_clip.py", line 717, in forward
    return self.text_model(
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1776, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1787, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/transformers/utils/generic.py", line 943, in wrapper
    output = func(self, *args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/transformers/models/clip/modeling_clip.py", line 628, in forward
    encoder_outputs: BaseModelOutput = self.encoder(
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1776, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1787, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/transformers/utils/generic.py", line 943, in wrapper
    output = func(self, *args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/transformers/models/clip/modeling_clip.py", line 557, in forward
    layer_outputs = encoder_layer(
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/transformers/modeling_layers.py", line 83, in __call__
    return super().__call__(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1776, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1787, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/transformers/models/clip/modeling_clip.py", line 404, in forward
    hidden_states, attn_weights = self.self_attn(
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1776, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1787, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/transformers/models/clip/modeling_clip.py", line 313, in forward
    queries = self.q_proj(hidden_states)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1776, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1787, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/torch/nn/modules/linear.py", line 134, in forward
    return F.linear(input, self.weight, self.bias)
RuntimeError: CUDA error: CUBLAS_STATUS_NOT_INITIALIZED when calling `cublasLtMatmulAlgoGetHeuristic( ltHandle, computeDesc.descriptor(), Adesc.descriptor(), Bdesc.descriptor(), Cdesc.descriptor(), Cdesc.descriptor(), preference.descriptor(), 1, &heuristicResult, &returnedResult)`

To Reproduce

Steps to reproduce the behavior:

Expected behavior

Environment

Build information about Torch-TensorRT can be found by turning on debug messages

  • Torch-TensorRT Version (e.g. 1.0.0):
  • PyTorch Version (e.g. 1.0):
  • CPU Architecture:
  • OS (e.g., Linux):
  • How you installed PyTorch (conda, pip, libtorch, source):
  • Build command you used (if compiling from source):
  • Are you using local sources or building from archives:
  • Python version:
  • CUDA version:
  • GPU models and configuration:
  • Any other relevant information:

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up β€” it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.