-
Notifications
You must be signed in to change notification settings - Fork 363
feat: Lazy engine initialization #2997
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
Conversation
@@ -50,13 +50,16 @@ class TorchTensorRTModule(torch.nn.Module): # type: ignore[misc] | |||
output_binding_names (List[str]): List of output TensorRT engine binding names in the order they should be returned | |||
""" | |||
|
|||
defer_engine_setup = False |
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.
Remove
fe2cd6a
to
f2bf073
Compare
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.
LGTM. Could you add a testcase with a model that has fallback ops ?
366ecc6
to
37adede
Compare
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.
LGTM
7c77ffe
to
f976de9
Compare
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:
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/conversion/harness.py 2024-07-31 15:42:55.193957+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/conversion/harness.py 2024-07-31 15:44:51.304037+00:00
@@ -62,11 +62,11 @@
interpreter,
rtol,
atol,
check_dtype=True,
pyt_inputs=None,
- rt_cls=PythonTorchTensorRTModule
+ rt_cls=PythonTorchTensorRTModule,
):
with torch.no_grad():
cuda_inputs = []
for i in inputs:
cuda_inputs.append(i.cuda())
@@ -132,11 +132,11 @@
inputs,
expected_ops,
interpreter,
comparators: List[Tuple[Callable, List]],
fp16_mode=False,
- rt_cls=PythonTorchTensorRTModule
+ rt_cls=PythonTorchTensorRTModule,
):
"""
Runs the test and compares the result using the provided comparators.
The size of comparators must be equal to the number of outputs from 'mod'.
5cf73b4
to
29b5e72
Compare
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.
LGTM, just a few minor comments
db1cc6a
to
9bf1e2b
Compare
2323fe2
to
05543ec
Compare
Allows engines to not be setup immediately after compilation but all at once before the module is returned back to the user. Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
05543ec
to
ac71002
Compare
Description
Allows engines to not be setup immediately after compilation but all at once before the module is returned back to the user.
Fixes #2673
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: