-
Notifications
You must be signed in to change notification settings - Fork 364
chore/fix: Restructure Dynamo directory [7 / x] #1981
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
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 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
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
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
a3dd0c8
to
2003b07
Compare
5024e4a
to
4ed3e3f
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.
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
4ed3e3f
to
d48d5c1
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.
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
d48d5c1
to
ea64529
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.
Code conforms to Python 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
@@ -8,10 +8,10 @@ | |||
from torch_tensorrt import EngineCapability, Device | |||
from torch_tensorrt.fx.utils import LowerPrecision | |||
|
|||
from torch_tensorrt.dynamo.backend._settings import CompilationSettings | |||
from torch_tensorrt.dynamo.common import CompilationSettings |
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 you think its worth having dynamo.common.CompilationSettings vs just dynamo.CompilationSettings?
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 think it would be better as dynamo.common.CompilationSettings
until both compile and export use them, since dynamo.CompilationSettings
might imply it is used across dynamo
, whereas common
could just be general purpose utilities.
from torch_tensorrt.dynamo.backend.utils import prepare_inputs, prepare_device | ||
from torch_tensorrt.dynamo.backend.backends import torch_tensorrt_backend | ||
from torch_tensorrt.dynamo.backend._defaults import ( | ||
from torch_tensorrt.dynamo.common._defaults import ( |
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.
same here
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.
This one, I am more open to moving up a level since the necessary changes have been made to both compile and export. I could add from torch_tensorrt.dynamo.common import _defaults
to the torch_tensorrt.dynamo.__init__.py
2003b07
to
9e805d1
Compare
ea64529
to
ece13a7
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.
Code conforms to Python 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
use_experimental_rt=use_experimental_rt, | ||
max_aux_streams=max_aux_streams, | ||
version_compatible=version_compatible, | ||
optimization_level=optimization_level, |
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.
Similar fixes in #1997 - to rebase after merge.
f851dd0
to
c62f30b
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.
Code conforms to Python 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
c62f30b
to
fc85356
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.
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
487ba93
to
49cd3a6
Compare
fc85356
to
d2fcab0
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.
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
49cd3a6
to
e2594b6
Compare
d2fcab0
to
369f442
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.
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
c0f0a22
to
1756b12
Compare
369f442
to
43b18c8
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.
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:
--- py/torch_tensorrt/dynamo/fx_ts_compat/lower.py 2023-07-07 22:21:04.022422 +0000
+++ py/torch_tensorrt/dynamo/fx_ts_compat/lower.py 2023-07-07 22:21:19.929000 +0000
@@ -8,11 +8,15 @@
import torch.fx as fx
import torch.nn as nn
import torch_tensorrt.fx.tracer.dispatch_tracer.aten_tracer as aten_tracer
from torch.fx.passes.splitter_base import SplitResult
-from torch_tensorrt.dynamo.common import TRTInterpreter, TRTInterpreterResult, use_python_runtime_parser
+from torch_tensorrt.dynamo.common import (
+ TRTInterpreter,
+ TRTInterpreterResult,
+ use_python_runtime_parser,
+)
from .lower_setting import LowerSetting
from .passes.lower_pass_manager_builder import LowerPassManagerBuilder
from .passes.pass_utils import PassFunc, validate_inference
from torch_tensorrt.fx.tools.timing_cache_utils import TimingCacheManager
from torch_tensorrt.fx.tools.trt_splitter import TRTSplitter, TRTSplitterSetting
- Add `common` directory which stores code common to both the compile and export path, to reduce code duplication and better organize the repository - Update necessary imports, promote the `_defaults` module to `torch_tensorrt.dynamo._defaults`
43b18c8
to
db3523a
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.
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
Closed in favor of unified restructuring PR. |
Description
common
directory which stores code common to both the compile and export path, to reduce code duplication and better organize the repositoryfx_ts_compat
fx_ts_compat
to agree with those incompile
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: