-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: Invalid input type <class 'bool'> encountered when compiling FLUX.1-dev model with Torch-TensorRT #3446
Comments
@peri044 @cehongwang Can you please take a look? |
Appreciate it, thank you! |
@yachty66 Did you try with the latest main branch or the release 2.6 ? |
I did |
@peri044 it's not possible to install the nightly version: When running the install command for the nightly version
|
@zewenli98 Can you take a look at this dependency issue? |
This has already been solved in the latest main branch. You can upgrade to the latest version of Torch-TRT. Alternatively, you can change the last entry of dummy inputs to: |
When trying W0321 23:52:56.241000 1367 torch/fx/experimental/symbolic_shapes.py:6307] failed during evaluate_expr(Eq(u0, 1), hint=None, size_oblivious=False, forcing_spec=False
E0321 23:52:56.242000 1367 torch/fx/experimental/recording.py:299] failed while running evaluate_expr(*(Eq(u0, 1), None), **{'fx_node': False})
---------------------------------------------------------------------------
GuardOnDataDependentSymNode Traceback (most recent call last)
[<ipython-input-8-232d7c3393f5>](https://yrohqbkz7ib-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20250320-060136_RC00_738743873#) in <cell line: 0>()
35 }
36 # This will create an exported program which is going to be compiled with Torch-TensorRT
---> 37 ep = _export(
38 backbone,
39 args=(),
26 frames
[/usr/local/lib/python3.11/dist-packages/torch/fx/experimental/symbolic_shapes.py](https://yrohqbkz7ib-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20250320-060136_RC00_738743873#) in _evaluate_expr(self, orig_expr, hint, fx_node, size_oblivious, forcing_spec)
6491
6492 if not ok:
-> 6493 raise self._make_data_dependent_error(
6494 expr.xreplace(self.var_to_val),
6495 expr,
GuardOnDataDependentSymNode: Could not guard on data-dependent expression Eq(u0, 1) (unhinted: Eq(u0, 1)). (Size-like symbols: none)
Caused by: (_subclasses/functional_tensor.py:294 in __bool__)
For more information, run with TORCH_LOGS="dynamic"
For extended logs when we create symbols, also add TORCHDYNAMO_EXTENDED_DEBUG_CREATE_SYMBOL="u0"
If you suspect the guard was triggered from C++, add TORCHDYNAMO_EXTENDED_DEBUG_CPP=1
For more debugging help, see https://docs.google.com/document/d/1HSuTTVvYH1pTew89Rtpeu84Ht3nQEFTYhAX3Ypa_xJs/edit?usp=sharing
For C++ stack trace, run with TORCHDYNAMO_EXTENDED_DEBUG_CPP=1 |
❓ Question
When trying to compile the FLUX.1-dev model using Torch-TensorRT following the official example/blog post, I'm encountering a
ValueError
during thetorch_tensorrt.dynamo.compile()
step. The error suggests there's an issue with input parsing where it's encountering a boolean value that it doesn't know how to handle.What you have already tried
I'm following the exact steps from the example provided in the documentation (https://pytorch.org/TensorRT/tutorials/_rendered_examples/dynamo/torch_export_flux_dev.html). I've:
_export
The error occurs specifically at the compilation step:
Environment
conda
,pip
,libtorch
, source):Additional context
The error message specifically points to an issue with boolean input types:
It looks like the
return_dict=False
parameter in my dummy inputs is causing the issue since it's a boolean value. The example shows that this should be supported, but the error suggests that booleans aren't handled correctly in the input parsing logic.Full traceback:
The text was updated successfully, but these errors were encountered: