Skip to content
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

Reorg for converters in hardtanh(FX Converter Refactor [5/N]) <Target: converter_reorg_proto> #1901

Merged
merged 1 commit into from
May 30, 2023

Conversation

apbose
Copy link
Collaborator

@apbose apbose commented May 10, 2023

No description provided.

Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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/fx/converters/aten_ops_converters.py	2023-05-10 05:48:48.094928 +0000
+++ py/torch_tensorrt/fx/converters/aten_ops_converters.py	2023-05-10 05:49:06.307517 +0000
@@ -216,11 +216,11 @@
        SourceIR.ATEN,
        name,
        args[0],
    )

-    
+
@tensorrt_converter(torch.ops.aten.linear)
def aten_ops_linear(
    network: TRTNetwork,
    target: Target,
    args: Tuple[Argument, ...],
--- py/torch_tensorrt/fx/converters/nn_ops_converters.py	2023-05-10 05:48:48.094928 +0000
+++ py/torch_tensorrt/fx/converters/nn_ops_converters.py	2023-05-10 05:49:06.689486 +0000
@@ -33,6 +33,6 @@
        network=network,
        target="torch.nn.modules.activation.Hardtanh",
        source_ir=SourceIR.NN,
        name=layer_name,
        input_val=kwargs["input"],
-    )
\ No newline at end of file
+    )
--- py/torch_tensorrt/fx/converters/acc_ops_converters.py	2023-05-10 05:48:48.094928 +0000
+++ py/torch_tensorrt/fx/converters/acc_ops_converters.py	2023-05-10 05:49:08.587441 +0000
@@ -3596,11 +3596,11 @@
        target,
        SourceIR.ATEN,
        name,
        args[0],
    )
-    
+

@tensorrt_converter(acc_ops.interpolate)
def acc_ops_interpolate(
    network: TRTNetwork,
    target: Target,
--- py/torch_tensorrt/fx/test/converters/aten_op/test_hard_tanh_aten.py	2023-05-10 05:48:48.098928 +0000
+++ py/torch_tensorrt/fx/test/converters/aten_op/test_hard_tanh_aten.py	2023-05-10 05:49:08.918275 +0000
@@ -48,6 +48,6 @@
            TestModule(), input_specs, expected_ops={torch.ops.aten.hardtanh.default}
        )


if __name__ == "__main__":
-    run_tests()
\ No newline at end of file
+    run_tests()

Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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/fx/converters/aten_ops_converters.py	2023-05-11 23:31:10.187297 +0000
+++ py/torch_tensorrt/fx/converters/aten_ops_converters.py	2023-05-11 23:31:26.881529 +0000
@@ -209,17 +209,11 @@
    kwargs: Dict[str, Argument],
    name: str,
) -> Union[TRTTensor, Sequence[TRTTensor]]:

    return activation.hardtanh(
-        network,
-        target,
-        SourceIR.ATEN,
-        name,
-        args[0],
-        args[1],
-        args[2]
+        network, target, SourceIR.ATEN, name, args[0], args[1], args[2]
    )


@tensorrt_converter(torch.ops.aten.linear)
def aten_ops_linear(
--- py/torch_tensorrt/fx/converters/impl/activation.py	2023-05-11 23:31:10.187297 +0000
+++ py/torch_tensorrt/fx/converters/impl/activation.py	2023-05-11 23:31:27.090627 +0000
@@ -93,11 +93,11 @@
        source_ir,
        name,
        operation_type,
        input_val,
        alpha,
-        beta, 
+        beta,
        dyn_range_fn=hardtanh_dyn_range_fn,
    )


def relu(
--- py/torch_tensorrt/fx/converters/acc_ops_converters.py	2023-05-11 23:31:10.187297 +0000
+++ py/torch_tensorrt/fx/converters/acc_ops_converters.py	2023-05-11 23:31:28.868334 +0000
@@ -3596,11 +3596,11 @@
        target,
        SourceIR.ATEN,
        name,
        kwargs["input"],
        kwargs["min_val"],
-        kwargs["max_val"]
+        kwargs["max_val"],
    )


@tensorrt_converter(acc_ops.interpolate)
def acc_ops_interpolate(

Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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

@apbose apbose requested review from narendasan, frank-wei and wushirong and removed request for yinghai May 12, 2023 16:57
Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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

@narendasan narendasan changed the title Reorg for converters in hardtanh(FX Converter Refactor [2/N]) Reorg for converters in hardtanh(FX Converter Refactor [5/N]) May 12, 2023
@apbose apbose changed the title Reorg for converters in hardtanh(FX Converter Refactor [5/N]) Reorg for converters in hardtanh(FX Converter Refactor [5/N]) <Target: converter_reorg_proto> May 15, 2023
@gs-olive gs-olive force-pushed the converter_reorg_proto branch from 1696cd2 to 12f545c Compare May 15, 2023 21:25
@gs-olive gs-olive force-pushed the converter_reorg_activation_hardtanh branch from e91a5ca to d438eaa Compare May 15, 2023 21:43
Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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

corrections and correcting python linting

correcting linting error

correcting nn_ops_converter.py

Fixing acc op
@narendasan narendasan force-pushed the converter_reorg_activation_hardtanh branch from d438eaa to 5fd8003 Compare May 30, 2023 21:37
@github-actions github-actions bot added component: build system Issues re: Build system component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: partitioning component: tests Issues re: Tests labels May 30, 2023
@narendasan narendasan changed the base branch from converter_reorg_proto to main May 30, 2023 21:37
@narendasan narendasan merged commit 387c2f9 into main May 30, 2023
narendasan pushed a commit that referenced this pull request Jun 2, 2023
narendasan pushed a commit that referenced this pull request Jun 2, 2023
narendasan pushed a commit that referenced this pull request Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: api [Python] Issues re: Python API component: build system Issues re: Build system component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: fx component: partitioning component: tests Issues re: Tests fx Story: ATen Op Support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants