YaLM Implementation
Author: BlackSamorez
Pull request: yes

# What does this PR do?

Implementation of YaLM model (https://github.com/yandex/YaLM-100B). Model weights are available [here](https://huggingface.co/yandex/yalm-100b). Weight conversion will be included.

### Sources 
The code is based on the [original model code](https://github.com/yandex/YaLM-100B) which is an old and heavily modified [Megatron-LM](https://github.com/NVIDIA/Megatron-LM) fork. I also borrowed some code from [gpt_neox transformers implementation](https://github.com/huggingface/transformers/tree/main/src/transformers/models/gpt_neox).

### Licences
The model weights [were published under the Apache 2.0 license](https://github.com/yandex/YaLM-100B/blob/main/LICENSE). Megatron-LM is licensed under the [Megatron-LM license](https://github.com/yandex/YaLM-100B/blob/main/megatron_lm/LICENSE). Not sure what the latter is.

### Correctness

The model works but I can't verify it's correctness since I don't have access to 200GB of VRAM.
A smaller model of same architecture should be created for testing purposes.
Tokenizer and conversion script are not done yet.

## 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](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?

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.

@ArthurZucker @younesbelkada

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- text models: @ArthurZucker and @younesbelkada
- vision models: @amyeroberts
- speech models: @sanchit-gandhi
- graph models: @clefourrier

Library:

- flax: @sanchit-gandhi
- generate: @gante
- pipelines: @Narsil
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @sgugger

Integrations:

- deepspeed: HF Trainer: @stas00, Accelerate: @pacman100
- ray/raytune: @richardliaw, @amogkam

Documentation: @sgugger, @stevhliu and @MKhalusova

HF projects:

- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Maintained examples (not research project or legacy):

- Flax: @sanchit-gandhi
- PyTorch: @sgugger
- TensorFlow: @Rocketknight1

 -->


Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_22629). All of your documentation changes will be reflected on that endpoint.

Hey! How do you feel about maybe adding this to the hub rather than on transformers? Should be easier to do following this [tutorial](https://huggingface.co/docs/transformers/custom_models). WDYT? 

Wow, didn't know this was an option. I'll definitely look into this since it's unlikely we'll be getting more models based on this architecture anyway.

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.