Skip to content
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

T5 Translation with torch.compile & TensorRT backend #3223

Merged
merged 7 commits into from
Jul 9, 2024

Conversation

agunapal
Copy link
Collaborator

@agunapal agunapal commented Jul 3, 2024

Description

This PR shows how to serve T5 model for translation with TensorRT using torch.compile

Fixes #(issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Feature/Issue validation/testing

Please describe the Unit or Integration tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.

  • Test A
    Logs for Test A

  • Test B
    Logs for Test B

Checklist:

  • Did you have fun?
  • Have you added tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

@agunapal agunapal changed the title Examples/t5 tensorrt T5 Translation with torch.compile & TensorRT backend Jul 3, 2024
@agunapal agunapal added this to the v0.12.0 milestone Jul 3, 2024
@agunapal agunapal marked this pull request as ready for review July 3, 2024 00:46
@agunapal agunapal requested a review from mreso July 3, 2024 23:56
Copy link
Collaborator

@mreso mreso left a comment

Choose a reason for hiding this comment

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

Left some comments, example discoverability would increase if we start from examples/torch_compile. Otherwise LGTM

- Verified to be working with `torch-tensorrt==2.3.0`
Installation instructions can be found in [pytorch/TensorRT](https://github.com/pytorch/TensorRT)

Change directory to examples directory `cd examples/torch_tensorrt/T5/torchcompile`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we revert the order and do examples/torch_compile/tensor_rt instead? Then we could move all examples/pt2 into there too so people find everything about compile in a single place? I assume there will be no other integration point for TRT in the future other than compile.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For tensorrt, onnx, we actually want the starting point to be tensorrt, onnx, since customers are looking specifically for these. There are github issues where customers are still looking for an onnx example. Will add an example on onnx next

examples/torch_tensorrt/torchcompile/T5/README.md Outdated Show resolved Hide resolved
# read configs for the mode, model_name, etc. from the handler config
model_path = self.model_yaml_config.get("handler", {}).get("model_path", None)
if not model_path:
logger.warning("Missing model path")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be an error

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done. Thanks

agunapal and others added 2 commits July 9, 2024 10:24
Co-authored-by: Matthias Reso <13337103+mreso@users.noreply.github.com>
review comments
@agunapal agunapal enabled auto-merge July 9, 2024 17:28
@agunapal agunapal added this pull request to the merge queue Jul 9, 2024
Merged via the queue into master with commit 9c587d2 Jul 9, 2024
8 of 12 checks passed
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.

2 participants