Skip to content

Implementation of the PyTorch Backend API #194

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

Merged
merged 6 commits into from
Oct 22, 2020
Merged

Conversation

narendasan
Copy link
Collaborator

Description

This PR adds support for the PyTorch Backend API (the initial version shipped with PyTorch 1.6.0) and associated tests. It also does some refactoring to make TRTorch more consistent with other backends for PyTorch and some clarification of terms.

Fixes #82

Type of change

Please delete options that are not relevant and/or add your own.

  • 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
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes

with other backends and between APIs in TRTorch

BREAKING CHANGE: This changes the top level api for setting the
specification for compilation, a simple find and replace should allow
users to port forward

Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
PyTorch

Users can now use a direct PyTorch integration by just importing the
trtorch package. The only difference between torch._C._jit_to_tensorrt
and trtorch.compile is that you need to use the
trtorch.TensorRTCompileSpec constructor to build a wrapper around your
spec dictionary

Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
@narendasan narendasan changed the title To backend api Implementation of the PyTorch Backend API Oct 21, 2020
@github-actions github-actions bot added component: api [Python] Issues re: Python API component: api [C++] Issues re: C++ API component: build system Issues re: Build system component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: tests Issues re: Tests documentation Improvements or additions to documentation component: runtime labels Oct 21, 2020
@narendasan narendasan requested a review from andi4191 October 21, 2020 22:40
"refit": false, # enable refit
"debug": false, # enable debuggable engine
"strict_types": false, # kernels should strictly run in operating precision
"allow_gpu_fallback": false, # (DLA only) Allow layers unsupported on DLA to run on GPU
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be set as true? It is set to true by default.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure

Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
@narendasan narendasan merged commit 51a2043 into master Oct 22, 2020
@narendasan narendasan deleted the to_backend_api branch October 22, 2020 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: api [C++] Issues re: C++ API component: api [Python] Issues re: Python API component: build system Issues re: Build system component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: runtime component: tests Issues re: Tests documentation Improvements or additions to documentation hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement to_backend API
2 participants