Skip to content

Conversation

@kamalkraj
Copy link
Contributor

@kamalkraj kamalkraj commented Aug 17, 2021

What does this PR do?

Removes never executed branch from deberta-v2 code

discussed in #13120 (comment)

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@LysandreJik @patrickvonplaten @Rocketknight1

@kamalkraj kamalkraj changed the title remove unwanted code remove unwanted control-flow code from DeBERTa-V2 Aug 17, 2021
@kamalkraj kamalkraj mentioned this pull request Aug 17, 2021
5 tasks
r_pos = relative_pos

p2c_pos = torch.clamp(-r_pos + att_span, 0, att_span * 2 - 1)
if query_layer.size(-2) != key_layer.size(-2):
Copy link
Contributor

Choose a reason for hiding this comment

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

All

  ``` self.query_proj = nn.Linear(config.hidden_size, self.all_head_size, bias=True)
    self.key_proj = nn.Linear(config.hidden_size, self.all_head_size, bias=True)
    self.value_proj = nn.Linear(config.hidden_size, self.all_head_size, bias=True)```

have the same dim which is why this control flow is never true no?

LGTM to remove for me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

have the same dim which is why this control flow is never true no?

Yes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deberta-v2 same dim always. so the control flow is never true

Copy link
Member

@LysandreJik LysandreJik 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 @kamalkraj

cc @BigBird01

@LysandreJik LysandreJik merged commit 0b54046 into huggingface:master Aug 23, 2021
@kamalkraj kamalkraj deleted the deberta-v2-fix branch September 11, 2021 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants