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

fix: Change equals-check from reference to value for BERT model not compiling in FX #1539

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

gs-olive
Copy link
Collaborator

@gs-olive gs-olive commented Dec 8, 2022

Description

  • BERT model (https://huggingface.co/bert-base-uncased) failing to compile with TorchDynamo/fx2trt due to string references not being equal, whereas their accompanying values are
  • Updated check in acc_ops_gelu to check for equality by value instead of reference on string keyword arg

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • [ x ] My code follows the style guidelines of this project (You can use the linters)
  • [ x ] I have performed a self-review of my own code
  • [ x ] I have commented my code, particularly in hard-to-understand areas and hacks
  • [ x ] I have made corresponding changes to the documentation
  • [ x ] I have added tests to verify my fix or my feature
  • [ x ] New and existing unit tests pass locally with my changes
  • [ x ] I have added the relevant labels to my PR in so that relevant reviewers are notified

- BERT model failing to compile with TorchDynamo/fx2trt due to string
references not being equal, whereas their accompanying values are
Copy link
Contributor

@frank-wei frank-wei left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the fix.

@@ -3369,7 +3369,7 @@ def acc_ops_gelu(
) -> Union[TRTTensor, Sequence[TRTTensor]]:
input_val = kwargs["input"]
approximate = kwargs["approximate"]
if approximate is not "none":
if approximate != "none":
Copy link

Choose a reason for hiding this comment

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

Wow good catch!

@yinghai yinghai merged commit bef9548 into pytorch:master Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants