Restore GPT support for interleaved pipeline parallelism
# What does this PR do ?

This restores support for interleaved pipeline parallelism after https://github.com/NVIDIA/NeMo/pull/6393.

**Collection**: NLP

# Changelog 
- Restore custom synchronization logic to GPT training and validation steps
- Fix bug where all model chunks in first pipeline stage were created with embeddings
- Support dynamic attention masks in pipeline parallelism

# Usage

Set `virtual_pipeline_model_parallel_size > 1`:
https://github.com/NVIDIA/NeMo/blob/5468077f5127be1a4c88065de2544f4268b9a6e4/examples/nlp/language_modeling/conf/megatron_gpt_config.yaml#L51

This requires `pipeline_model_parallel_size > 2`  and `virtual_pipeline_model_parallel_size*pipeline_model_parallel_size` divides `num_layers`.

# Before your PR is "Ready for review"
**Pre checks**:
- [x] Make sure you read and followed [Contributor guidelines](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md)
- [ ] Did you write any new necessary tests?
- [ ] Did you add or update any necessary documentation?
- [ ] Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
  - [ ] Reviewer: Does the PR have correct import guards for all optional libraries?
  
**PR Type**:
- [ ] New Feature
- [x] Bugfix
- [ ] Documentation

If you haven't finished some of the above items you can still open "Draft" PR.


## Who can review?

Anyone in the community is free to review the PR once the checks have passed. 
[Contributor guidelines](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md) contains specific people who can review PRs to various areas.

Pinging @aklife97.

# Additional Information
* Restores functionality broken in https://github.com/NVIDIA/NeMo/pull/6393
* Depends on https://github.com/NVIDIA/Megatron-LM/pull/331