-
Notifications
You must be signed in to change notification settings - Fork 352
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
Include bin and headers to packaging and provide option to ensure tests can use precompiled trtorch libs #670
Conversation
tarball so that users can just load it as an HTTP archive 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]>
Signed-off-by: Dheeraj Peri <[email protected]>
Signed-off-by: Dheeraj Peri <[email protected]>
Signed-off-by: Dheeraj Peri <[email protected]>
Signed-off-by: Dheeraj Peri <[email protected]>
Signed-off-by: Dheeraj Peri <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to Python style guidelines:
Reformatting /workspace/py/trtorch/logging.py
Reformatting /workspace/py/trtorch/_compile_spec.py
Reformatting /workspace/py/trtorch/__init__.py
Reformatting /workspace/py/trtorch/ptq.py
Reformatting /workspace/py/trtorch/Input.py
Reformatting /workspace/py/trtorch/_types.py
Reformatting /workspace/py/trtorch/_compiler.py
Reformatting /workspace/py/trtorch/Device.py
--- /workspace/py/setup.py (original)
+++ /workspace/py/setup.py (reformatted)
@@ -105,6 +105,7 @@
with open(dir_path + '/trtorch/_version.py', 'w') as f:
print("creating version file")
f.write("__version__ = \"" + __version__ + '\"')
+
def copy_libtrtorch(multilinux=False):
if not os.path.exists(dir_path + '/trtorch/lib'):
@@ -257,27 +258,16 @@
python_requires='>=3.6',
include_package_data=True,
package_data={
- 'trtorch': ['lib/*',
- 'include/trtorch/*.h',
- 'include/trtorch/core/*.h',
- 'include/trtorch/core/conversion/*.h',
- 'include/trtorch/core/conversion/conversionctx/*.h',
- 'include/trtorch/core/conversion/converters/*.h',
- 'include/trtorch/core/conversion/evaluators/*.h',
- 'include/trtorch/core/conversion/tensorcontainer/*.h',
- 'include/trtorch/core/conversion/var/*.h',
- 'include/trtorch/core/ir/*.h',
- 'include/trtorch/core/lowering/*.h',
- 'include/trtorch/core/lowering/passes/*.h',
- 'include/trtorch/core/partitioning/*.h',
- 'include/trtorch/core/plugins/*.h',
- 'include/trtorch/core/plugins/impl/*.h',
- 'include/trtorch/core/runtime/*.h',
- 'include/trtorch/core/util/*.h',
- 'include/trtorch/core/util/logging/*.h',
- 'bin/*',
- 'BUILD',
- 'WORKSPACE'],
+ 'trtorch': [
+ 'lib/*', 'include/trtorch/*.h', 'include/trtorch/core/*.h', 'include/trtorch/core/conversion/*.h',
+ 'include/trtorch/core/conversion/conversionctx/*.h', 'include/trtorch/core/conversion/converters/*.h',
+ 'include/trtorch/core/conversion/evaluators/*.h', 'include/trtorch/core/conversion/tensorcontainer/*.h',
+ 'include/trtorch/core/conversion/var/*.h', 'include/trtorch/core/ir/*.h',
+ 'include/trtorch/core/lowering/*.h', 'include/trtorch/core/lowering/passes/*.h',
+ 'include/trtorch/core/partitioning/*.h', 'include/trtorch/core/plugins/*.h',
+ 'include/trtorch/core/plugins/impl/*.h', 'include/trtorch/core/runtime/*.h',
+ 'include/trtorch/core/util/*.h', 'include/trtorch/core/util/logging/*.h', 'bin/*', 'BUILD', 'WORKSPACE'
+ ],
},
exclude_package_data={
'': ['*.cpp'],
Reformatting /workspace/py/setup.py
ERROR: Some files do not conform to style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to Python style guidelines:
Reformatting /workspace/py/trtorch/logging.py
Reformatting /workspace/py/trtorch/_compile_spec.py
Reformatting /workspace/py/trtorch/__init__.py
Reformatting /workspace/py/trtorch/ptq.py
Reformatting /workspace/py/trtorch/Input.py
Reformatting /workspace/py/trtorch/_types.py
Reformatting /workspace/py/trtorch/_compiler.py
Reformatting /workspace/py/trtorch/Device.py
--- /workspace/py/setup.py (original)
+++ /workspace/py/setup.py (reformatted)
@@ -105,6 +105,7 @@
with open(dir_path + '/trtorch/_version.py', 'w') as f:
print("creating version file")
f.write("__version__ = \"" + __version__ + '\"')
+
def copy_libtrtorch(multilinux=False):
if not os.path.exists(dir_path + '/trtorch/lib'):
@@ -257,27 +258,16 @@
python_requires='>=3.6',
include_package_data=True,
package_data={
- 'trtorch': ['lib/*',
- 'include/trtorch/*.h',
- 'include/trtorch/core/*.h',
- 'include/trtorch/core/conversion/*.h',
- 'include/trtorch/core/conversion/conversionctx/*.h',
- 'include/trtorch/core/conversion/converters/*.h',
- 'include/trtorch/core/conversion/evaluators/*.h',
- 'include/trtorch/core/conversion/tensorcontainer/*.h',
- 'include/trtorch/core/conversion/var/*.h',
- 'include/trtorch/core/ir/*.h',
- 'include/trtorch/core/lowering/*.h',
- 'include/trtorch/core/lowering/passes/*.h',
- 'include/trtorch/core/partitioning/*.h',
- 'include/trtorch/core/plugins/*.h',
- 'include/trtorch/core/plugins/impl/*.h',
- 'include/trtorch/core/runtime/*.h',
- 'include/trtorch/core/util/*.h',
- 'include/trtorch/core/util/logging/*.h',
- 'bin/*',
- 'BUILD',
- 'WORKSPACE'],
+ 'trtorch': [
+ 'lib/*', 'include/trtorch/*.h', 'include/trtorch/core/*.h', 'include/trtorch/core/conversion/*.h',
+ 'include/trtorch/core/conversion/conversionctx/*.h', 'include/trtorch/core/conversion/converters/*.h',
+ 'include/trtorch/core/conversion/evaluators/*.h', 'include/trtorch/core/conversion/tensorcontainer/*.h',
+ 'include/trtorch/core/conversion/var/*.h', 'include/trtorch/core/ir/*.h',
+ 'include/trtorch/core/lowering/*.h', 'include/trtorch/core/lowering/passes/*.h',
+ 'include/trtorch/core/partitioning/*.h', 'include/trtorch/core/plugins/*.h',
+ 'include/trtorch/core/plugins/impl/*.h', 'include/trtorch/core/runtime/*.h',
+ 'include/trtorch/core/util/*.h', 'include/trtorch/core/util/logging/*.h', 'bin/*', 'BUILD', 'WORKSPACE'
+ ],
},
exclude_package_data={
'': ['*.cpp'],
Reformatting /workspace/py/setup.py
ERROR: Some files do not conform to style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to Python style guidelines:
Reformatting /workspace/py/trtorch/logging.py
Reformatting /workspace/py/trtorch/_compile_spec.py
Reformatting /workspace/py/trtorch/__init__.py
Reformatting /workspace/py/trtorch/ptq.py
Reformatting /workspace/py/trtorch/Input.py
Reformatting /workspace/py/trtorch/_types.py
Reformatting /workspace/py/trtorch/_compiler.py
Reformatting /workspace/py/trtorch/Device.py
--- /workspace/py/setup.py (original)
+++ /workspace/py/setup.py (reformatted)
@@ -105,6 +105,7 @@
with open(dir_path + '/trtorch/_version.py', 'w') as f:
print("creating version file")
f.write("__version__ = \"" + __version__ + '\"')
+
def copy_libtrtorch(multilinux=False):
if not os.path.exists(dir_path + '/trtorch/lib'):
@@ -257,27 +258,16 @@
python_requires='>=3.6',
include_package_data=True,
package_data={
- 'trtorch': ['lib/*',
- 'include/trtorch/*.h',
- 'include/trtorch/core/*.h',
- 'include/trtorch/core/conversion/*.h',
- 'include/trtorch/core/conversion/conversionctx/*.h',
- 'include/trtorch/core/conversion/converters/*.h',
- 'include/trtorch/core/conversion/evaluators/*.h',
- 'include/trtorch/core/conversion/tensorcontainer/*.h',
- 'include/trtorch/core/conversion/var/*.h',
- 'include/trtorch/core/ir/*.h',
- 'include/trtorch/core/lowering/*.h',
- 'include/trtorch/core/lowering/passes/*.h',
- 'include/trtorch/core/partitioning/*.h',
- 'include/trtorch/core/plugins/*.h',
- 'include/trtorch/core/plugins/impl/*.h',
- 'include/trtorch/core/runtime/*.h',
- 'include/trtorch/core/util/*.h',
- 'include/trtorch/core/util/logging/*.h',
- 'bin/*',
- 'BUILD',
- 'WORKSPACE'],
+ 'trtorch': [
+ 'lib/*', 'include/trtorch/*.h', 'include/trtorch/core/*.h', 'include/trtorch/core/conversion/*.h',
+ 'include/trtorch/core/conversion/conversionctx/*.h', 'include/trtorch/core/conversion/converters/*.h',
+ 'include/trtorch/core/conversion/evaluators/*.h', 'include/trtorch/core/conversion/tensorcontainer/*.h',
+ 'include/trtorch/core/conversion/var/*.h', 'include/trtorch/core/ir/*.h',
+ 'include/trtorch/core/lowering/*.h', 'include/trtorch/core/lowering/passes/*.h',
+ 'include/trtorch/core/partitioning/*.h', 'include/trtorch/core/plugins/*.h',
+ 'include/trtorch/core/plugins/impl/*.h', 'include/trtorch/core/runtime/*.h',
+ 'include/trtorch/core/util/*.h', 'include/trtorch/core/util/logging/*.h', 'bin/*', 'BUILD', 'WORKSPACE'
+ ],
},
exclude_package_data={
'': ['*.cpp'],
Reformatting /workspace/py/setup.py
ERROR: Some files do not conform to style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
Signed-off-by: Dheeraj Peri <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to Python style guidelines:
Reformatting /workspace/py/trtorch/logging.py
Reformatting /workspace/py/trtorch/_compile_spec.py
Reformatting /workspace/py/trtorch/__init__.py
Reformatting /workspace/py/trtorch/ptq.py
Reformatting /workspace/py/trtorch/Input.py
Reformatting /workspace/py/trtorch/_types.py
Reformatting /workspace/py/trtorch/_compiler.py
Reformatting /workspace/py/trtorch/Device.py
--- /workspace/py/setup.py (original)
+++ /workspace/py/setup.py (reformatted)
@@ -105,6 +105,7 @@
with open(dir_path + '/trtorch/_version.py', 'w') as f:
print("creating version file")
f.write("__version__ = \"" + __version__ + '\"')
+
def copy_libtrtorch(multilinux=False):
if not os.path.exists(dir_path + '/trtorch/lib'):
@@ -257,27 +258,16 @@
python_requires='>=3.6',
include_package_data=True,
package_data={
- 'trtorch': ['lib/*',
- 'include/trtorch/*.h',
- 'include/trtorch/core/*.h',
- 'include/trtorch/core/conversion/*.h',
- 'include/trtorch/core/conversion/conversionctx/*.h',
- 'include/trtorch/core/conversion/converters/*.h',
- 'include/trtorch/core/conversion/evaluators/*.h',
- 'include/trtorch/core/conversion/tensorcontainer/*.h',
- 'include/trtorch/core/conversion/var/*.h',
- 'include/trtorch/core/ir/*.h',
- 'include/trtorch/core/lowering/*.h',
- 'include/trtorch/core/lowering/passes/*.h',
- 'include/trtorch/core/partitioning/*.h',
- 'include/trtorch/core/plugins/*.h',
- 'include/trtorch/core/plugins/impl/*.h',
- 'include/trtorch/core/runtime/*.h',
- 'include/trtorch/core/util/*.h',
- 'include/trtorch/core/util/logging/*.h',
- 'bin/*',
- 'BUILD',
- 'WORKSPACE'],
+ 'trtorch': [
+ 'lib/*', 'include/trtorch/*.h', 'include/trtorch/core/*.h', 'include/trtorch/core/conversion/*.h',
+ 'include/trtorch/core/conversion/conversionctx/*.h', 'include/trtorch/core/conversion/converters/*.h',
+ 'include/trtorch/core/conversion/evaluators/*.h', 'include/trtorch/core/conversion/tensorcontainer/*.h',
+ 'include/trtorch/core/conversion/var/*.h', 'include/trtorch/core/ir/*.h',
+ 'include/trtorch/core/lowering/*.h', 'include/trtorch/core/lowering/passes/*.h',
+ 'include/trtorch/core/partitioning/*.h', 'include/trtorch/core/plugins/*.h',
+ 'include/trtorch/core/plugins/impl/*.h', 'include/trtorch/core/runtime/*.h',
+ 'include/trtorch/core/util/*.h', 'include/trtorch/core/util/logging/*.h', 'bin/*', 'BUILD', 'WORKSPACE'
+ ],
},
exclude_package_data={
'': ['*.cpp'],
Reformatting /workspace/py/setup.py
ERROR: Some files do not conform to style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
py/setup.py
Outdated
@@ -258,9 +257,29 @@ def run(self): | |||
python_requires='>=3.6', | |||
include_package_data=True, | |||
package_data={ | |||
'trtorch': ['lib/*.so'], | |||
'trtorch': ['lib/*', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to list every directory, can we not glob?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably can use python glob library (glob.glob(pattern) - requires 3/4 patterns).
Naive globbing (eg: providing directly include/**/*.h
, include/**/**/*.h
etc in trtorch
key doesn't work. Referred to pytorch setup.py which included all directories https://github.com/pytorch/pytorch/blob/master/setup.py#L918
@@ -76,7 +76,6 @@ cc_test( | |||
"//tests/modules:jit_models", | |||
], | |||
deps = [ | |||
"//cpp:trtorch", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did we not have to replace any of these dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get your question. We replaced //cpp:trtorch
with //tests/util
which adds //cpp:trtorch
based on the trtorch_src flag
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to Python style guidelines:
Reformatting /workspace/py/trtorch/logging.py
Reformatting /workspace/py/trtorch/_compile_spec.py
Reformatting /workspace/py/trtorch/__init__.py
Reformatting /workspace/py/trtorch/ptq.py
Reformatting /workspace/py/trtorch/Input.py
Reformatting /workspace/py/trtorch/_types.py
Reformatting /workspace/py/trtorch/_compiler.py
Reformatting /workspace/py/trtorch/Device.py
--- /workspace/py/setup.py (original)
+++ /workspace/py/setup.py (reformatted)
@@ -106,6 +106,7 @@
print("creating version file")
f.write("__version__ = \"" + __version__ + '\"')
+
def copy_libtrtorch(multilinux=False):
if not os.path.exists(dir_path + '/trtorch/lib'):
os.makedirs(dir_path + '/trtorch/lib')
@@ -171,15 +172,8 @@
class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
PY_CLEAN_FILES = [
- './build',
- './dist',
- './trtorch/__pycache__',
- './trtorch/lib',
- './trtorch/include',
- './trtorch/bin',
- './*.pyc',
- './*.tgz',
- './*.egg-info'
+ './build', './dist', './trtorch/__pycache__', './trtorch/lib', './trtorch/include', './trtorch/bin', './*.pyc',
+ './*.tgz', './*.egg-info'
]
description = "Command to tidy up the project root"
user_options = []
@@ -265,27 +259,16 @@
python_requires='>=3.6',
include_package_data=True,
package_data={
- 'trtorch': ['lib/*',
- 'include/trtorch/*.h',
- 'include/trtorch/core/*.h',
- 'include/trtorch/core/conversion/*.h',
- 'include/trtorch/core/conversion/conversionctx/*.h',
- 'include/trtorch/core/conversion/converters/*.h',
- 'include/trtorch/core/conversion/evaluators/*.h',
- 'include/trtorch/core/conversion/tensorcontainer/*.h',
- 'include/trtorch/core/conversion/var/*.h',
- 'include/trtorch/core/ir/*.h',
- 'include/trtorch/core/lowering/*.h',
- 'include/trtorch/core/lowering/passes/*.h',
- 'include/trtorch/core/partitioning/*.h',
- 'include/trtorch/core/plugins/*.h',
- 'include/trtorch/core/plugins/impl/*.h',
- 'include/trtorch/core/runtime/*.h',
- 'include/trtorch/core/util/*.h',
- 'include/trtorch/core/util/logging/*.h',
- 'bin/*',
- 'BUILD',
- 'WORKSPACE'],
+ 'trtorch': [
+ 'lib/*', 'include/trtorch/*.h', 'include/trtorch/core/*.h', 'include/trtorch/core/conversion/*.h',
+ 'include/trtorch/core/conversion/conversionctx/*.h', 'include/trtorch/core/conversion/converters/*.h',
+ 'include/trtorch/core/conversion/evaluators/*.h', 'include/trtorch/core/conversion/tensorcontainer/*.h',
+ 'include/trtorch/core/conversion/var/*.h', 'include/trtorch/core/ir/*.h',
+ 'include/trtorch/core/lowering/*.h', 'include/trtorch/core/lowering/passes/*.h',
+ 'include/trtorch/core/partitioning/*.h', 'include/trtorch/core/plugins/*.h',
+ 'include/trtorch/core/plugins/impl/*.h', 'include/trtorch/core/runtime/*.h',
+ 'include/trtorch/core/util/*.h', 'include/trtorch/core/util/logging/*.h', 'bin/*', 'BUILD', 'WORKSPACE'
+ ],
},
exclude_package_data={
'': ['*.cpp'],
Reformatting /workspace/py/setup.py
ERROR: Some files do not conform to style guidelines
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
Description
Include bin and headers to packaging and provide option to ensure tests can use precompiled trtorch libs
Type of change
Checklist: