Replies: 2 comments 3 replies
-
Can you open a bug for this? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi, the correct usage of kwarg should be something similar to this:
It might be a bit tricky to get all inputs in the forward function in this scenario. You can also try torch.compile, which is JIT compile and does not need sample input. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to compile a CLIP text encoder model using:
This compiles fine, but the model forward function later fails:
So the text_encoder forward function needs to be compiled with the output_hidden_states as kwarg.
The torch_tensorrt.compile function seems to have a parameter for this (see also https://pytorch.org/TensorRT/py_api/torch_tensorrt.html?highlight=compile):
Which is of type dict[Any,Any]. However if I supply this to compile:
I get the following error at compile time:
So obviously kwarg_inputs is not of type dict[Any,Any] but more restricted which does not make any sense to me.
How to use kwarg_inputs? Or is this a bug?
best
Beta Was this translation helpful? Give feedback.
All reactions