Fix natten
Author: alihassanijr
Pull request: yes

# What does this PR do?

The new NATTEN 0.14.5 supports PyTorch 2.0, but also adds an additional
argument to the QK operation to allow optional RPBs.

This ends up failing NATTEN tests.

This commit adds NATTEN back to circleci and adds the arguments to get
it working again.

Reverts #22218.


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

@sgugger

## Misc

Related issues on NATTEN:

https://github.com/SHI-Labs/NATTEN/issues/23

https://github.com/SHI-Labs/NATTEN/issues/19


Comments:
_The documentation is not available anymore as the PR was closed or merged._

@alihassanijr  Thanks for such a quick fix! Just double checking - is this version of `natten` compatible with later versions of PyTorch, or just >= 2.x.x?

My pleasure, sorry I didn't realize this earlier.
Yes, `0.14.5` still supports torch >= 1.8 and comes with wheels for those:
https://shi-labs.com/natten

So the problem was that we had a pull request a couple of months ago that added an additional argument to one of the C functions. We didn't immediately rebuild and push out a new release at the time.
We did however push out a new build to support PyTorch 2.0, and it included this change, which is why we had to open a PR here as well.

On a different note, we only had to change this here in the first place because we explicitly use the C function calls in the models using NA:

https://github.com/alihassanijr/transformers/blob/6125d62e05aba0bd1f6a53bd3bf44b4d86b58f25/src/transformers/models/dinat/modeling_dinat.py#L350

https://github.com/alihassanijr/transformers/blob/6125d62e05aba0bd1f6a53bd3bf44b4d86b58f25/src/transformers/models/nat/modeling_nat.py#L342

We could try and figure out how we would directly import the nn.Module we typically encourage everyone to use, that way any changes to the signatures would not affect `transformers`.

NATTEN can in theory support future PyTorch versions without any change required (unless PyTorch changes anything in their ATEN backend like they did with the dispatchers in 1.13, which would require us to work those changes into our CPP backend as well.)
The only slight hitch is that if users want to install NATTEN with wheels (and not have to wait for pip to build it locally), we have to build those on our end and upload them.

I've been wanting to set up CircleCI or Travis so that I wouldn't have to set that up manually every time there's a new PyTorch release, but just haven't found the time to do so yet. But we will to the best of our abilities try to build them upon new PyTorch releases and push them out as soon as possible.