We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When compiling an MLP submodule of the HuggingFace GPT2 model from TorchScript to Torch-TRT, the following error is encountered:
GRAPH: [Torch-TensorRT - Debug Build] - Input to node: %self.c_fc.weight.1 : Float(768, 3072, strides=[3072, 1], requires_grad=0, device=cuda:0) = prim::Constant[value=<Tensor>]() GRAPH: [Torch-TensorRT - Debug Build] - Input outputs a Tensor GRAPH: [Torch-TensorRT - Debug Build] - Input is a constant Traceback (most recent call last): File "case_dict.py", line 278, in <module> main2() File "case_dict.py", line 268, in main2 comp = torchtrt.compile(traced, inputs=inp, enabled_precisions={torch.float}, truncate_long_and_double=True) File "~/TensorRT/py/torch_tensorrt/_compile.py", line 125, in compile return torch_tensorrt.ts.compile( File "~/TensorRT/py/torch_tensorrt/ts/_compiler.py", line 136, in compile compiled_cpp_mod = _C.compile_graph(module._c, _parse_compile_spec(spec)) RuntimeError: required keyword attribute 'upscale_factor' is undefined
Steps to reproduce the behavior:
from transformers import GPT2Model model = GPT2Model.from_pretrained("gpt2", use_cache=False, torchscript=True).eval().cuda()
model_portion = model.h[0].mlp
hidden_state = torch.rand((1, 768)).cuda()
traced = torch.jit.trace(model_portion, inp).cuda().eval()
trt_model = torchtrt.compile(traced, inputs=hidden_state, enabled_precisions={torch.float}, truncate_long_and_double=True)
Module should compile via the TorchScript path
python setup.py develop
The full GPT2 model is functional - see #1455. Each of its component modules should be able to compile successfully as a result.
The text was updated successfully, but these errors were encountered:
Fixed by using Torch 2.0.0.dev20230219+cu117
2.0.0.dev20230219+cu117
Sorry, something went wrong.
peri044
Successfully merging a pull request may close this issue.
Bug Description
When compiling an MLP submodule of the HuggingFace GPT2 model from TorchScript to Torch-TRT, the following error is encountered:
To Reproduce
Steps to reproduce the behavior:
model_portion = model.h[0].mlp
hidden_state = torch.rand((1, 768)).cuda()
traced = torch.jit.trace(model_portion, inp).cuda().eval()
Expected behavior
Module should compile via the TorchScript path
Environment
python setup.py develop
Additional Considerations
The full GPT2 model is functional - see #1455. Each of its component modules should be able to compile successfully as a result.
The text was updated successfully, but these errors were encountered: