Skip to content

Loop Conversion #164

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

Closed
wants to merge 1 commit into from
Closed

Loop Conversion #164

wants to merge 1 commit into from

Conversation

abhi-iyer
Copy link
Contributor

Description

Dynamic loop conversion from PyTorch to TRT. A few limitations with this approach, as of now:

  • all recurrent values inside loop can be Tensors only
  • works with for loops, albeit with a comparative threshold (i.e. TRT vs JIT) that is greater than the set limit of 2e-5
  • breaks converter contract: all primitive types (e.g. int, float, etc.) could potentially be Tensors when processed inside the converter

Type of change

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

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation and have regenerated the documentation (make html in docsrc)
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes

@abhi-iyer
Copy link
Contributor Author

For more information on Loop Conversion, please see:

TensorRT Loops - A Rundown.pdf

@@ -35,7 +35,7 @@ void LowerGraph(std::shared_ptr<torch::jit::Graph>& g) {
passes::Conv2DToConvolution(g);
passes::FuseAddMMBranches(g);
torch::jit::EliminateCommonSubexpression(g);
torch::jit::UnrollLoops(g);
//torch::jit::UnrollLoops(g);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the unroll loops behavior still not work even with the non compliant converters?

@narendasan narendasan linked an issue Aug 3, 2020 that may be closed by this pull request
@abhi-iyer
Copy link
Contributor Author

TRT has no guarantee about output binding order.

e.g. an RNN loop that outputs hidden state hx and cell state cx might be reversed when outputs are processed, even if they were marked as inputs in the right order

Signed-off-by: Abhiram Iyer <[email protected]>

Signed-off-by: Abhiram Iyer <[email protected]>
@github-actions
Copy link

This PR has not seen activity for 30 days, Remove stale label or comment or this will be closed in 5 days

@github-actions
Copy link

This PR has not seen activity for 30 days, Remove stale label or comment or this will be closed in 5 days

@narendasan narendasan marked this pull request as draft November 11, 2020 21:09
@narendasan narendasan added the WIP Work is in progress, pull request should not be merged yet label Nov 30, 2020
@github-actions
Copy link

This PR has not seen activity for 30 days, Remove stale label or comment or this will be closed in 5 days

@github-actions
Copy link

github-actions bot commented Apr 5, 2021

This PR has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

@github-actions
Copy link

This PR has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

@facebook-github-bot
Copy link
Contributor

Hi @abhi-iyer!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@github-actions
Copy link

This PR has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@github-actions
Copy link

github-actions bot commented Jan 2, 2023

This PR has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed No Activity WIP Work is in progress, pull request should not be merged yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Loop Translation to TensorRT
3 participants