-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the ci by separating CPU and CUDA tests (#2327)
Summary: We are separating CPU and CUDA tests using different runners. Pull Request resolved: #2327 Reviewed By: huydhn Differential Revision: D58902378 Pulled By: xuzhao9 fbshipit-source-id: 6c2598dc2cd5c94105f1eb15862da924ae25894c
- Loading branch information
1 parent
d910b8a
commit 1f98239
Showing
8 changed files
with
122 additions
and
168 deletions.
There are no files selected for viewing
This file contains 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,29 @@ | ||
. ${HOME}/miniconda3/etc/profile.d/conda.sh | ||
|
||
if [ -z "${BASE_CONDA_ENV}" ]; then | ||
echo "ERROR: BASE_CONDA_ENV is not set" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${CONDA_ENV}" ]; then | ||
echo "ERROR: CONDA_ENV is not set" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${SETUP_SCRIPT}" ]; then | ||
echo "ERROR: SETUP_SCRIPT is not set" | ||
exit 1 | ||
fi | ||
|
||
CONDA_ENV=${BASE_CONDA_ENV} . "${SETUP_SCRIPT}" | ||
conda activate "${BASE_CONDA_ENV}" | ||
# Remove the conda env if exists | ||
conda remove --name "${CONDA_ENV}" -y --all || true | ||
conda create --name "${CONDA_ENV}" -y --clone "${BASE_CONDA_ENV}" | ||
conda activate "${CONDA_ENV}" | ||
|
||
parent_dir=$(dirname "$(readlink -f "$0")")/../.. | ||
cd ${parent_dir} | ||
|
||
python -c "import torch; print(torch.__version__); print(torch.version.git_version)" | ||
python install.py |
This file contains 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,31 @@ | ||
. ${HOME}/miniconda3/etc/profile.d/conda.sh | ||
|
||
if [ -z "${CONDA_ENV}" ]; then | ||
echo "ERROR: CONDA_ENV is not set" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${TEST_CONFIG}" ]; then | ||
echo "ERROR: TEST_CONFIG is not set" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${SETUP_SCRIPT}" ]; then | ||
echo "ERROR: SETUP_SCRIPT is not set" | ||
exit 1 | ||
fi | ||
|
||
. "${SETUP_SCRIPT}" | ||
conda activate "${CONDA_ENV}" | ||
|
||
parent_dir=$(dirname "$(readlink -f "$0")")/../.. | ||
cd ${parent_dir} | ||
|
||
# Test subprocess worker | ||
if [[ "$TEST_CONFIG" == 'cpu' ]]; then | ||
python -m torchbenchmark._components.test.test_subprocess | ||
python -m torchbenchmark._components.test.test_worker | ||
fi | ||
|
||
# Test models | ||
python test.py -v -k "$TEST_CONFIG" |
This file contains 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 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 was deleted.
Oops, something went wrong.
This file contains 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,21 @@ | ||
name: TorchBench PR Test | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
cpu-test: | ||
uses: ./.github/workflows/_linux-test-cpu.yml | ||
secrets: | ||
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} | ||
cuda-test: | ||
uses: ./.github/workflows/_linux-test-cuda.yml | ||
secrets: | ||
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} | ||
cancel-in-progress: true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.