Support new FX Legacy Registry in opset coverage tool by laikhtewari · Pull Request #2366 · pytorch/TensorRT (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation11 Commits4 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Description
The opset_coverage.py tool was failing with the following error:
Traceback (most recent call last):
File "/opt/torch_tensorrt/py/torch_tensorrt/dynamo/tools/opset_coverage.py", line 213, in <module>
find_coverage_status(ATEN_OPS, "ATen")
File "/opt/torch_tensorrt/py/torch_tensorrt/dynamo/tools/opset_coverage.py", line 199, in find_coverage_status
coverage = opset_coverage(opset)
File "/opt/torch_tensorrt/py/torch_tensorrt/dynamo/tools/opset_coverage.py", line 147, in opset_coverage
elif registry_data["FX ATen Converters Registry"] >= 1:
KeyError: 'FX ATen Converters Registry'
For some reason, some ATen and Prims ops appear with the registry name "FX Legacy ATen Converters Registry"
Type of change
- Bug fix (non-breaking change which fixes an issue)
Checklist:
- My code follows the style guidelines of this project (You can use the linters)
- 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
- I have added the relevant labels to my PR in so that relevant reviewers are notified
[](/apps/github-actions)
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
[](/apps/github-actions)
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/py/torch_tensorrt/dynamo/tools/opset_coverage.py 2023-10-06 01:35:27.859438+00:00 +++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/tools/opset_coverage.py 2023-10-06 01:38:03.371191+00:00 @@ -144,14 +144,23 @@ _, registry_data = c_registry.get_all_converters_with_target( target, return_registry_info=True )
if registry_data is not None:
if DYNAMO_REGISTRY_NAME in registry_data and registry_data[DYNAMO_REGISTRY_NAME] >= 1:
if (
DYNAMO_REGISTRY_NAME in registry_data
and registry_data[DYNAMO_REGISTRY_NAME] >= 1
): status = SupportStatus.CONVERTED support_count += 1
elif (FX_REGISTRY_NAME in registry_data and registry_data[FX_REGISTRY_NAME] >= 1) or (FX_LEGACY_REGISTRY_NAME in registry_data and registry_data[FX_LEGACY_REGISTRY_NAME] >= 1):
elif (
FX_REGISTRY_NAME in registry_data
and registry_data[FX_REGISTRY_NAME] >= 1
) or (
FX_LEGACY_REGISTRY_NAME in registry_data
and registry_data[FX_LEGACY_REGISTRY_NAME] >= 1
): status = SupportStatus.LEGACY_CONVERTED legacy_count += 1 support_status[target_str] = { "schema": f"{target_str.split('.')[0]}.{opset_schemas[target_str]}",
[](/apps/github-actions)
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
[](/apps/github-actions)
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/py/torch_tensorrt/dynamo/tools/opset_coverage.py 2023-10-06 01:38:34.264390+00:00 +++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/tools/opset_coverage.py 2023-10-06 01:41:34.649301+00:00 @@ -144,14 +144,23 @@ _, registry_data = c_registry.get_all_converters_with_target( target, return_registry_info=True )
if registry_data is not None:
if DYNAMO_REGISTRY_NAME in registry_data and registry_data[DYNAMO_REGISTRY_NAME] >= 1:
if (
DYNAMO_REGISTRY_NAME in registry_data
and registry_data[DYNAMO_REGISTRY_NAME] >= 1
): status = SupportStatus.CONVERTED support_count += 1
elif (FX_REGISTRY_NAME in registry_data and registry_data[FX_REGISTRY_NAME] >= 1) or (FX_LEGACY_REGISTRY_NAME in registry_data and registry_data[FX_LEGACY_REGISTRY_NAME] >= 1):
elif (
FX_REGISTRY_NAME in registry_data
and registry_data[FX_REGISTRY_NAME] >= 1
) or (
FX_LEGACY_REGISTRY_NAME in registry_data
and registry_data[FX_LEGACY_REGISTRY_NAME] >= 1
): status = SupportStatus.LEGACY_CONVERTED legacy_count += 1 else: raise Exception(f"Op belongs to unknown registry: {registry_data}")
[](/apps/github-actions)
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
[](/apps/github-actions)
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/py/torch_tensorrt/dynamo/tools/opset_coverage.py 2023-10-06 01:41:32.426768+00:00 +++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/tools/opset_coverage.py 2023-10-06 01:44:53.379336+00:00 @@ -145,18 +145,18 @@ target, return_registry_info=True )
if registry_data is not None:
if (
DYNAMO_REGISTRY_NAME in registry_data
and registry_data[DYNAMO_REGISTRY_NAME] >= 1
DYNAMO_REGISTRY_NAME in registry_data
and registry_data[DYNAMO_REGISTRY_NAME] >= 1 ): status = SupportStatus.CONVERTED support_count += 1 elif (
FX_REGISTRY_NAME in registry_data
and registry_data[FX_REGISTRY_NAME] >= 1
FX_REGISTRY_NAME in registry_data
and registry_data[FX_REGISTRY_NAME] >= 1 ) or ( FX_LEGACY_REGISTRY_NAME in registry_data and registry_data[FX_LEGACY_REGISTRY_NAME] >= 1 ): status = SupportStatus.LEGACY_CONVERTED
[](/apps/github-actions)
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
[](/apps/github-actions)
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
[](/apps/github-actions)
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
[](/apps/github-actions)
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
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM