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

Add more HF models with bug fixes. #13

Merged
merged 52 commits into from
Jul 2, 2024
Merged

Add more HF models with bug fixes. #13

merged 52 commits into from
Jul 2, 2024

Conversation

garrett4wade
Copy link
Contributor

  1. Add a manual PPO script example.
  2. Add deterministic seeding in pytorch dataloader to increase reproducibility.
  3. Fix a bug in partitioning micro-batches of paired preference data in the pipe runner. (Related to RW and DPO training).
  4. Support several new models: QWen2, Gemma, and GPT-2. ReaLModel and its configuration are changed correspondingly to support tied embeddings .
  5. Support loading safetensor HF checkpoints.
  6. Fix the mapping of contiguous parameters to make the Megatron backend happy.
  7. Fix the finalize_grad function of the Megatron backend to avoid blocking when training with a partition of all GPUs.
  8. Fix gradient all-reduce for LayerNorm and tied embeddings.
  9. Add inference tests for new models.
  10. Add a parameter reallocation test.

Known issues:

  • The correctness of parameter reallocation is ensured with more assertions at the cost of efficiency. The issue should be resolved with further profiling and implementation.
  • Should check and update the docs.

@garrett4wade garrett4wade requested a review from nuzant July 1, 2024 08:53
Copy link
Collaborator

@nuzant nuzant left a comment

Choose a reason for hiding this comment

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

LGTM, only some minor changes required.

realhf/impl/model/conversion/hf_registry.py Outdated Show resolved Hide resolved
realhf/impl/model/nn/real_llm_api.py Outdated Show resolved Hide resolved
tests/test_distributed_load_hf.py Show resolved Hide resolved
tests/test_param_realloc.py Show resolved Hide resolved
realhf/api/core/model_api.py Outdated Show resolved Hide resolved
realhf/impl/model/nn/flatten_param.py Show resolved Hide resolved
realhf/impl/model/nn/flatten_param.py Show resolved Hide resolved
@nuzant nuzant merged commit 84a2f5e into main Jul 2, 2024
2 checks passed
@garrett4wade garrett4wade deleted the fix-contiguous-param branch July 4, 2024 06:49
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.

2 participants