Skip to content

Commit 55ab61d

Browse files
Merge branch 'main' into expose_start_positions_rope
2 parents f0461ab + 6d2a123 commit 55ab61d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3151
-2283
lines changed

.github/actions/action.yml

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
name: "Test Template"
15-
description: "Template for running NeMo tests in a containerized environment"
14+
name: 'Test Template'
15+
description: 'Template for running NeMo tests in a containerized environment'
1616

1717
inputs:
1818
container-image:
19-
description: "Container image to use for test"
19+
description: 'Container image to use for test'
2020
required: true
2121
timeout:
22-
description: "Max runtime of test in minutes"
22+
description: 'Max runtime of test in minutes'
2323
required: false
24-
default: "30"
24+
default: '30'
2525
script:
26-
description: "Test script to execute"
26+
description: 'Test script to execute'
2727
required: true
2828
is-optional:
29-
description: "Pass this job on failure."
29+
description: 'Pass this job on failure.'
3030
required: false
31-
default: "false"
31+
default: 'false'
3232
is_unit_test:
33-
description: "Upload coverage as unit test"
33+
description: 'Upload coverage as unit test'
3434
required: false
35-
default: "false"
35+
default: 'false'
3636
tag:
3737
description: Latest or legacy test suite
3838
required: true
@@ -43,11 +43,11 @@ inputs:
4343
description: Model to launch
4444
required: false
4545
PAT:
46-
description: "GitHub Personal Access Token"
46+
description: 'GitHub Personal Access Token'
4747
required: true
4848

4949
runs:
50-
using: "composite"
50+
using: 'composite'
5151
steps:
5252
- name: Checkout repository
5353
uses: actions/checkout@v2
@@ -114,6 +114,16 @@ runs:
114114
HAS_RUN_TESTS_LABEL=$(gh pr view $PR_NUMBER --json labels | jq '[.labels[].name] | any(. == "Run tests")') || echo "false"
115115
echo "main=$HAS_RUN_TESTS_LABEL" | tee -a $GITHUB_OUTPUT
116116
117+
- name: Has Run functional tests label
118+
shell: bash -x -e -u -o pipefail {0}
119+
id: has-run-functional-tests-label
120+
env:
121+
GH_TOKEN: ${{ github.token }}
122+
run: |
123+
PR_NUMBER=${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number }}
124+
HAS_RUN_FUNCTIONAL_TESTS_LABEL=$(gh pr view $PR_NUMBER --json labels | jq '[.labels[].name] | any(. == "Run functional tests")') || echo "false"
125+
echo "main=$HAS_RUN_FUNCTIONAL_TESTS_LABEL" | tee -a $GITHUB_OUTPUT
126+
117127
- name: Create run-script (e2e test)
118128
shell: bash -x -e -u -o pipefail {0}
119129
if: inputs.is_unit_test == 'false'
@@ -126,16 +136,19 @@ runs:
126136
set -euxo pipefail
127137
128138
if [ "${{ steps.has-run-tests-label.outputs.main }}" == "true" ]; then
129-
ARGS=(
130-
--scope mr-github
131-
--enable-lightweight-mode
132-
)
133-
else
134-
ARGS=(
135-
--scope mr-slim
136-
--enable-lightweight-mode
137-
)
138-
fi
139+
ARGS=(
140+
--scope mr-github
141+
--enable-lightweight-mode
142+
)
143+
elif [ "${{ steps.has-run-functional-tests-label.outputs.main }}" == "true" ]; then
144+
ARGS=(
145+
--scope mr-github
146+
)
147+
else
148+
ARGS=(
149+
--scope mr-github-slim
150+
)
151+
fi
139152
140153
export PYTHONPATH=$(pwd)
141154
export NEMORUN_HOME=$(pwd)

.github/workflows/cicd-main.yml

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ on:
2020
branches:
2121
- dev
2222
- main
23-
- "pull-request/[0-9]+"
24-
- "deploy-release/*"
23+
- 'pull-request/[0-9]+'
24+
- 'deploy-release/*'
2525
merge_group:
2626
types: [checks_requested]
2727
workflow_dispatch:
@@ -97,7 +97,7 @@ jobs:
9797
with:
9898
issue-number: ${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number }}
9999
repository: ${{ github.repository }}
100-
body-includes: "<!--external-contributor-comment-->"
100+
body-includes: '<!--external-contributor-comment-->'
101101

102102
- name: Delete comment
103103
uses: actions/github-script@v7
@@ -200,6 +200,11 @@ jobs:
200200
&& needs.pre-flight.outputs.is_merge_group == 'false'
201201
&& !cancelled()
202202
steps:
203+
- name: Taint node for job isolation
204+
if: contains(needs.is-not-external-contributor.outputs.selected_runner, 'ephemeral')
205+
shell: bash
206+
run: taint-node.sh
207+
203208
- name: Checkout
204209
uses: actions/checkout@v4
205210

@@ -230,11 +235,9 @@ jobs:
230235
231236
- name: Download test data
232237
shell: bash
233-
env:
234-
GH_TOKEN: ${{ secrets.PAT }}
235238
run: |
236239
echo "::group::Download test data"
237-
pip install --no-cache-dir pygithub click
240+
pip install --no-cache-dir click requests
238241
python tests/test_utils/python_scripts/download_unit_tests_dataset.py --assets-dir ./assets
239242
echo "::endgroup::"
240243
@@ -345,7 +348,7 @@ jobs:
345348
- cicd-container-build
346349
- cicd-parse-unit-tests
347350
runs-on: ${{ needs.is-not-external-contributor.outputs.selected_runner }}
348-
name: "${{ matrix.bucket }} - latest"
351+
name: '${{ matrix.bucket }} - latest'
349352
if: |
350353
(
351354
success()
@@ -359,6 +362,11 @@ jobs:
359362
PIP_NO_PYTHON_VERSION_WARNING: 1
360363
PIP_ROOT_USER_ACTION: ignore
361364
steps:
365+
- name: Taint node for job isolation
366+
if: contains(needs.is-not-external-contributor.outputs.selected_runner, 'ephemeral')
367+
shell: bash
368+
run: taint-node.sh
369+
362370
- name: Checkout
363371
uses: actions/checkout@v4
364372
- name: main
@@ -367,7 +375,7 @@ jobs:
367375
test_case: ${{ matrix.bucket }}
368376
tag: latest
369377
timeout: ${{ matrix.timeout || 30 }}
370-
is_unit_test: "true"
378+
is_unit_test: 'true'
371379
PAT: ${{ secrets.PAT }}
372380
container-image: ${{ env.container-registry }}/megatron-lm:${{ github.sha }}
373381

@@ -406,10 +414,20 @@ jobs:
406414
HAS_RUN_TESTS_LABEL=$(gh pr view $PR_NUMBER --json labels | jq '[.labels[].name] | any(. == "Run tests")') || echo "false"
407415
echo "main=$HAS_RUN_TESTS_LABEL" | tee -a $GITHUB_OUTPUT
408416
417+
- name: Has Run functional tests label
418+
id: has-run-functional-tests-label
419+
env:
420+
GH_TOKEN: ${{ secrets.PAT }}
421+
run: |
422+
PR_NUMBER=${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number }}
423+
HAS_RUN_FUNCTIONAL_TESTS_LABEL=$(gh pr view $PR_NUMBER --json labels | jq '[.labels[].name] | any(. == "Run functional tests")') || echo "false"
424+
echo "main=$HAS_RUN_FUNCTIONAL_TESTS_LABEL" | tee -a $GITHUB_OUTPUT
425+
409426
- name: Parse functional tests
410427
id: main
411428
env:
412429
HAS_RUN_TESTS_LABEL: ${{ steps.has-run-tests-label.outputs.main }}
430+
HAS_RUN_FUNCTIONAL_TESTS_LABEL: ${{ steps.has-run-functional-tests-label.outputs.main }}
413431
run: |
414432
export PYTHONPATH=$(pwd)
415433
@@ -418,10 +436,13 @@ jobs:
418436
--scope mr-github
419437
--enable-lightweight-mode
420438
)
439+
elif [ "$HAS_RUN_FUNCTIONAL_TESTS_LABEL" == "true" ]; then
440+
ARGS=(
441+
--scope mr-github
442+
)
421443
else
422444
ARGS=(
423-
--scope mr-slim
424-
--enable-lightweight-mode
445+
--scope mr-github-slim
425446
)
426447
fi
427448
@@ -458,7 +479,7 @@ jobs:
458479
- cicd-parse-integration-tests
459480
- cicd-unit-tests-latest
460481
runs-on: ${{ needs.is-not-external-contributor.outputs.selected_runner }}
461-
name: "${{ matrix.model }}/${{ matrix.test_case }} - latest"
482+
name: '${{ matrix.model }}/${{ matrix.test_case }} - latest'
462483
env:
463484
PIP_DISABLE_PIP_VERSION_CHECK: 1
464485
PIP_NO_PYTHON_VERSION_WARNING: 1
@@ -472,6 +493,11 @@ jobs:
472493
&& needs.pre-flight.outputs.is_merge_group == 'false'
473494
&& !cancelled()
474495
steps:
496+
- name: Taint node for job isolation
497+
if: contains(needs.is-not-external-contributor.outputs.selected_runner, 'ephemeral')
498+
shell: bash
499+
run: taint-node.sh
500+
475501
- name: Checkout
476502
uses: actions/checkout@v4
477503
- name: main
@@ -481,7 +507,7 @@ jobs:
481507
model: ${{ matrix.model }}
482508
tag: latest
483509
timeout: ${{ matrix.timeout || 30 }}
484-
is_unit_test: "false"
510+
is_unit_test: 'false'
485511
PAT: ${{ secrets.PAT }}
486512
container-image: ${{ env.container-registry }}/megatron-lm:${{ github.sha }}
487513

0 commit comments

Comments
 (0)