-
Notifications
You must be signed in to change notification settings - Fork 370
feat: Autocast #3878
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
base: main
Are you sure you want to change the base?
feat: Autocast #3878
Conversation
| enable_autocast: bool = _defaults.ENABLE_AUTOCAST, | ||
| low_precision_type: Optional[ | ||
| Union[torch.dtype, dtype] | ||
| ] = _defaults.LOW_PRECISION_TYPE, | ||
| nodes_to_exclude: Collection[str] = _defaults.NODES_TO_EXCLUDE, | ||
| targets_to_exclude: Collection[Target] = _defaults.TARGETS_TO_EXCLUDE, | ||
| data_max: float = _defaults.DATA_MAX, | ||
| max_depth_of_reduction: Optional[int] = _defaults.MAX_DEPTH_OF_REDUCTION, |
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.
Before merging, these args should be added to other compile functions in this file.
| ]: | ||
| # GEMM: A (M, K) @ B (K, N) = C (M, N) | ||
| self.reduction_depth = input_0_dims[-1] | ||
| # TODO: Add more reduction ops 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.
Should any more reduction targets be added?
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.
How are these reduction targets chosen?
py/torch_tensorrt/dynamo/lowering/passes/rule_based_autocast.py
Outdated
Show resolved
Hide resolved
peri044
left a comment
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.
Can you also update the documentation at https://github.com/pytorch/TensorRT/blob/main/docsrc/user_guide/mixed_precision.rst
py/torch_tensorrt/dynamo/lowering/passes/rule_based_autocast.py
Outdated
Show resolved
Hide resolved
py/torch_tensorrt/dynamo/lowering/passes/rule_based_autocast.py
Outdated
Show resolved
Hide resolved
py/torch_tensorrt/dynamo/lowering/passes/rule_based_autocast.py
Outdated
Show resolved
Hide resolved
|
For Tests
L1 or L2 tests |
narendasan
left a comment
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.
Nice its looking good, some final polishing details then I think its good to go
Description
Weak typing behavior in TensorRT is deprecated. However it is a good way to maximize performance. Therefore, we want to create similar PyTorch native system to use with Torch-TensorRT that recovers some of this behavior.
Fixes #3869
Type of change
Checklist: