Skip to content

Dynamo converter support for torch.ops.aten.erf.default op #2164

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

bowang007
Copy link
Collaborator

Description

This PR support dynamo converter for torch.erf

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

@bowang007 bowang007 requested a review from narendasan August 2, 2023 22:53
@github-actions github-actions bot added component: api [Python] Issues re: Python API component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: tests Issues re: Tests labels Aug 2, 2023
@github-actions github-actions bot requested a review from peri044 August 2, 2023 22:53
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.

There are some changes that do not conform to Python style guidelines:

--- py/torch_tensorrt/dynamo/conversion/impl/unary/ops.py	2023-08-02 22:53:30.255742 +0000
+++ py/torch_tensorrt/dynamo/conversion/impl/unary/ops.py	2023-08-02 22:53:47.940338 +0000
@@ -105,6 +105,6 @@
    name: str,
    input_val: TRTTensor,
) -> TRTTensor:
    return convert_unary(
        network, target, source_ir, name, trt.UnaryOperation.ERF, input_val
-    )
\ No newline at end of file
+    )
--- tests/py/dynamo/converters/test_erf_aten.py	2023-08-02 22:53:30.271743 +0000
+++ tests/py/dynamo/converters/test_erf_aten.py	2023-08-02 22:53:51.635953 +0000
@@ -19,6 +19,6 @@
            expected_ops={torch.ops.aten.erf.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.

There are some changes that do not conform to Python style guidelines:

--- py/torch_tensorrt/dynamo/conversion/impl/unary/ops.py	2023-08-02 22:53:32.723785 +0000
+++ py/torch_tensorrt/dynamo/conversion/impl/unary/ops.py	2023-08-02 22:53:51.305560 +0000
@@ -105,6 +105,6 @@
    name: str,
    input_val: TRTTensor,
) -> TRTTensor:
    return convert_unary(
        network, target, source_ir, name, trt.UnaryOperation.ERF, input_val
-    )
\ No newline at end of file
+    )
--- tests/py/dynamo/converters/test_erf_aten.py	2023-08-02 22:53:32.743787 +0000
+++ tests/py/dynamo/converters/test_erf_aten.py	2023-08-02 22:53:55.515767 +0000
@@ -19,6 +19,6 @@
            expected_ops={torch.ops.aten.erf.default},
        )


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

@narendasan
Copy link
Collaborator

@bowang007 run the linter

Copy link
Collaborator

@gs-olive gs-olive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

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

@bowang007 bowang007 requested a review from gs-olive September 22, 2023 21:55
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

@bowang007 bowang007 merged commit 670d2be into main Sep 22, 2023
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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
cla signed component: api [Python] Issues re: Python API component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: tests Issues re: Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants