-
Notifications
You must be signed in to change notification settings - Fork 340
Add v1 nightly CI workflow #407
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
Merged
+101
−23
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7a23446
Adding torchbench v1 workflow.
xuzhao9 0e6c171
Adding the v1 workflow
xuzhao9 a6ab854
Fixed upload to scribe.
xuzhao9 b8535c5
Remove s3 upload for now.
xuzhao9 003b3f8
Add rename of score result.
xuzhao9 65e558f
Add comment to v1 score.
xuzhao9 deb6e18
Remove the cron, add it in the formal release.
xuzhao9 59279b9
Add result sanity check in upload score.
xuzhao9 650174c
Fix upload scribe error.
xuzhao9 162f017
Fix another upload scribe error.
xuzhao9 a35e3bb
Fix field in upload scribe.
xuzhao9 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| name: TorchBench nightly ci v1.0 | ||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| run-benchmark: | ||
| env: | ||
| # Set to "v1-alpha" for testing. Will set it to "v1" in release. | ||
| TORCHBENCH_VER: "v1-alpha" | ||
| CONFIG_VER: "v1" | ||
| CONDA_ENV_NAME: "v1-nightly-ci" | ||
| OUTPUT_DIR: $(echo ${HOME})/.torchbench/v1-nighlty-ci | ||
| if: ${{ github.repository_owner == 'pytorch' }} | ||
| runs-on: [self-hosted, bm-runner] | ||
| env: | ||
| CONDA_ENV_NAME: torchbench-v1-nightly-ci | ||
| SCRIBE_GRAPHQL_ACCESS_TOKEN: ${{ secrets.SCRIBE_GRAPHQL_ACCESS_TOKEN }} | ||
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| ref: v1.0 | ||
| - name: Create conda env | ||
| run: | | ||
| conda create -y -q --name "${CONDA_ENV_NAME}" python=3.7 | ||
| - name: Install PyTorch nightly | ||
| run: | | ||
| . activate "$CONDA_ENV_NAME" | ||
| # Check if nightly builds are available | ||
| NIGHTLIES=$(python torchbenchmark/util/torch_nightly.py --packages torch) | ||
| # If failed, the script will generate empty result | ||
| if [ -z $NIGHTLIES ]; then | ||
| echo "Torch nightly build failed. Cancel the workflow." | ||
| exit 1 | ||
| fi | ||
| # Install PyTorch nightly from pip | ||
| pip install --pre torch \ | ||
| -f https://download.pytorch.org/whl/nightly/${CUDA_VERSION}/torch_nightly.html | ||
| - name: Run benchmark | ||
| run: | | ||
| . activate "$CONDA_ENV_NAME" | ||
| bash ./.github/scripts/run.sh "${OUTPUT_DIR}" | ||
| - name: Copy artifact and upload to scribe | ||
| run: | | ||
| LATEST_RESULT=$(find ${OUTPUT_DIR}/gh${GITHUB_RUN_ID}/ -name "*.json" | sort -r | head -1) | ||
| echo "Benchmark result file: $LATEST_RESULT" | ||
| TODAY=$(date "+%Y%m%d%H%M%S") | ||
| CONFIG_NORM_FILE=${CONFIG_DIR}/${CONFIG_FILE} | ||
| SCORE_FILE="./benchmark-result-v1-score-${TODAY}.json" | ||
| # Generate score | ||
| python compute_score.py --score_version v1 --benchmark_data_file $LATEST_RESULT > $SCORE_FILE | ||
| # Upload result to Scribe | ||
| python scripts/upload_scribe.py --pytest_bench_json $LATEST_RESULT --torchbench_score_file $SCORE_FILE | ||
| cp ${LATEST_RESULT} ./benchmark-result-v1-${TODAY}.json | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: Benchmark result | ||
| path: benchmark-result-v1-*.json | ||
| - name: Remove conda env | ||
| run: | | ||
| conda env remove --name "${CONDA_ENV_NAME}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will add the cron run later in the release.