Skip to content

Commit

Permalink
Merge branch 'main' into xren/nsys_profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
xrennvidia committed Aug 16, 2024
2 parents 31ac853 + 7916269 commit 795fb97
Show file tree
Hide file tree
Showing 36 changed files with 2,683 additions and 223 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/changelog-build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: 'Changelog Build (Release)'

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
changelog:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
ignorePreReleases: "false"
failOnError: "false"
fromTag: ${{ steps.previous_tag.outputs.tag_name }}
toTag: ${{ github.ref_name }}
toTag: ${{ github.ref_name || github.sha }}

- name: Print Changelog
run: |
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/cicd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,34 @@ jobs:

# rm -rf llama2_qat_results

L2_Distill_Llama2:
needs: [cicd-test-container-setup]
uses: ./.github/workflows/_test_template.yml
with:
RUNNER: self-hosted-azure
SCRIPT: |
python examples/nlp/language_modeling/megatron_gpt_distillation.py \
trainer.devices=2 \
trainer.num_nodes=1 \
trainer.precision=bf16 \
trainer.max_steps=5 \
trainer.log_every_n_steps=5 \
trainer.val_check_interval=5 \
trainer.limit_val_batches=2 \
model.restore_from_path=/home/TestData/nlp/megatron_llama/llama_ci.nemo \
model.kd_teacher_restore_from_path=/home/TestData/nlp/megatron_llama/llama_ci.nemo \
model.tensor_model_parallel_size=2 \
model.pipeline_model_parallel_size=1 \
model.micro_batch_size=1 \
model.global_batch_size=4 \
model.optim.name=distributed_fused_adam \
model.optim.sched.warmup_steps=1 \
model.data.data_prefix=[1.0,/home/TestData/nlp/megatron_gpt/data/gpt/simple_wiki_gpt_preproc_text_document] \
model.data.index_mapping_dir=examples/nlp/language_modeling/gpt_index_mappings \
exp_manager.exp_dir=examples/nlp/megatron_llama_distill
AFTER_SCRIPT: |
rm -rf examples/nlp/megatron_llama_distill
# L2: ASR dev run
ASR_dev_run_Speech_to_Text:
needs: [cicd-test-container-setup]
Expand Down
155 changes: 38 additions & 117 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,119 +1,69 @@
name: "NeMo Code release"

on:
issue_comment:
types: [created]

workflow_dispatch:
inputs:
branch:
description: Branch to release
required: true
type: string
jobs:
main:
if: >
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/release-please') &&
contains(fromJSON('["ko3n1g"]'), github.actor)
if: contains(fromJSON('["ko3n1g"]'), github.actor)
runs-on: ubuntu-latest
environment:
name: main
steps:
- name: Update PR issue comment
shell: bash
env:
message: ${{ github.event.comment.body }}
run: |
message="$message
---
Releasebot 🤖: Release processes started...
"
message="${message//$'\n'/<br>}"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }} \
-d '{"body":"'"$message"'"}'
- name: Get PR number
shell: bash
id: get-pr-num
run: |
PR_URL="${{ github.event.issue.pull_request.url }}"
PR_NUM=${PR_URL##*/}
echo "pr_number=$PR_NUM" >> $GITHUB_OUTPUT
- name: Get Pull Request Information
uses: actions/github-script@v6
id: get-pr-branch
with:
result-encoding: string
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: ${{ steps.get-pr-num.outputs.pr_number }}
});
console.log('Pull Request Information:', pr.data);
return pr.data.head.ref;

- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ github.run_id }}
ref: ${{ steps.get-pr-branch.outputs.result }}
ref: ${{ inputs.branch }}

- name: Get version number
- name: Create release
id: version-number
run: |
cd ${{ github.run_id }}
VERSION=$(python -c "import nemo; print(nemo.__version__)")
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
- name: Extract changelog
id: extract-changelog
uses: peter-evans/find-comment@v3
with:
issue-number: ${{ steps.get-pr-num.outputs.pr_number }}
body-includes: '# Detailed Changelogs'

- name: Extract summary
id: extract-summary
uses: peter-evans/find-comment@v3
with:
issue-number: ${{ steps.get-pr-num.outputs.pr_number }}
body-includes: '# Highlights'

- name: Create Release doc
id: create-release-doc
env:
SUMMARY: ${{ steps.extract-summary.outputs.comment-body }}
CHANGELOG: ${{ steps.extract-changelog.outputs.comment-body }}
run: |
echo "TITLE<<EOF" >> $GITHUB_ENV
echo "NVIDIA Neural Modules ${{ steps.version-number.outputs.VERSION }}" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
NAME="NVIDIA Neural Modules ${VERSION}"
CHANGELOG=$(awk '/^## '"$NAME"'/{flag=1; next} /^## /{flag=0} flag' CHANGELOG.md)
CHANGELOG=$(echo "$CHANGELOG" | sed '/./,$!d' | sed ':a;N;$!ba;s/\n$//')
PAYLOAD=$(jq \
-n \
-c \
--arg CI_COMMIT_BRANCH "${{ inputs.branch }}" \
--arg NAME "$NAME" \
--arg BODY "$CHANGELOG" \
'{
"tag_name": $CI_COMMIT_BRANCH,
"target_commitish": $CI_COMMIT_BRANCH,
"name": $NAME,
"body": $BODY,
"draft": false,
"prerelease": false,
"generate_release_notes": false
}'
)
echo "BODY<<EOF" >> $GITHUB_ENV
echo "$SUMMARY" >> $GITHUB_ENV
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: ${{ env.TITLE }}
tag_name: ${{ steps.version-number.outputs.VERSION }}
body: ${{ env.BODY }}
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/NVIDIA/NeMo/releases \
-d "$PAYLOAD"
- name: Build, test, and release wheel
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
cd ${{ github.run_id }}
EXPECTED_VERSION=$(python -c 'import nemo; print(nemo.__version__)')
python3 -m pip install --upgrade build
python3 -m build
Expand All @@ -122,7 +72,6 @@ jobs:
cd ../
INSTALLED_VERSION=$(python -c 'import nemo; print(nemo.__version__)')
EXPECTED_VERSION=${{ steps.version-number.outputs.VERSION }}
if [[ "$INSTALLED_VERSION" != "$EXPECTED_VERSION" ]]; then
echo 'Wheel has an outdated version, mission abort immediately!'
Expand All @@ -134,34 +83,6 @@ jobs:
python3 -m pip install --upgrade twine
python3 -m twine upload --repository pypi dist/*
- name: Update PR issue comment
shell: bash
env:
message: ${{ github.event.comment.body }}
run: |
message="$message
---
Releasebot 🤖: Release done 🎉
"
message="${message//$'\n'/<br>}"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }} \
-d '{"body":"'"$message"'"}'
- name: Close Pull
run: |
cd ${{ github.run_id }}
gh pr close --comment "Releasebot 🤖: Closing PR" "${{ steps.get-pr-num.outputs.pr_number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: notify
run: |
MESSAGE='{
Expand Down
Loading

0 comments on commit 795fb97

Please sign in to comment.