Support new FX Legacy Registry in opset coverage tool#2366
Merged
narendasan merged 4 commits intomainfrom Oct 27, 2023
Merged
Conversation
There was a problem hiding this comment.
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]}",There was a problem hiding this comment.
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}")
There was a problem hiding this comment.
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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The opset_coverage.py tool was failing with the following error:
For some reason, some ATen and Prims ops appear with the registry name "FX Legacy ATen Converters Registry"
Type of change
Checklist: