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 workflow for syncing #76

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/sync_branch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: sync main with dev
on:
push:
branches:
- main

jobs:
sync-branches:
runs-on: ubuntu-latest
name: syncing main with dev
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 12
- name: Opening pull request
id: pull
uses: tretuna/[email protected]
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
FROM_BRANCH: "main"
TO_BRANCH: "dev"
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ Thanks for the interest in contributing to NeMo-Aligner. We do all of NeMo-Align

# Pull Requests (PR) Guidelines

**Send your PRs to the `main` branch**
**Send your PRs to the `main` or `dev` branch**

1) Make sure your PR does one thing. Have a clear answer to "What does this PR do?".
2) Read General Principles and style guide below
3) Make sure you sign your commits. E.g. use ``git commit -sS`` when committing.
4) Make sure all unittests finish successfully before sending PR ``pytest`` or (if your dev box does not have GPU) ``pytest --cpu`` from the root folder
5) Send your PR and request a review

**NOTE**: The `main` branch uses a fixed NeMo version which we will update on every release. The `dev` branch is the branch that has all commits from `main` but uses NeMo's main branch: this branch is less stable but we run nightly tests on it to make sure everything works. We only provide the dockerfile that works with `main`, which is the branch most PRs should target unless they require the latest NeMo main (in which case they should target `dev`).

Every release `dev` and `main` will sync to be the same.

## Unit tests
Quick unit tests (locally, while developing)
```
Expand Down
2 changes: 1 addition & 1 deletion nemo_aligner/models/nlp/gpt/megatron_gpt_reward_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def on_load_checkpoint(self, checkpoint) -> None:
"""
# mcore uses distributed checkpointing
if "state_dict" in checkpoint and checkpoint["state_dict"]:
for index, module in enumerate(self.get_gpt_module_list()):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

whoops: will remove once everything else looks good to you

for index, module in enumerate(self.get_model_module_list()):
if parallel_state.get_virtual_pipeline_model_parallel_world_size() is not None:
checkpoint_state_dict = checkpoint["state_dict"][f"model_{index}"]
else:
Expand Down
2 changes: 1 addition & 1 deletion nemo_aligner/utils/train_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def set_sync_funcs(ptl_model, forward_only):
param_sync_func = ptl_model.sync_overlap_parameters

# pipeline schedules will get these from ptl_model.model.config
for module in ptl_model.get_gpt_module_list():
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

whoops again: will remove once everything else looks good to you

for module in ptl_model.get_model_module_list():
module.config.no_sync_func = no_sync_func
module.config.grad_sync_func = grad_sync_func
module.config.param_sync_func = param_sync_func
Expand Down
Loading