-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Add unit-tests for M1 #6111
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
Closed
Closed
Add unit-tests for M1 #6111
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6f63829
Add unit-tests for M1
datumbox 833f214
Remove S3 upload from PRs
datumbox 3bb85fa
Depend on build m1
datumbox f64872a
Switch to conda
datumbox bafae2f
Install test dependencies
datumbox e7394f4
remove scipy
datumbox 2d462f5
Run pytest via conda env
datumbox 1403635
Show output and separate tasks
datumbox 7ec1a71
Remove unnecessary var
datumbox 63f9e62
Restrict to main and nightly branches
datumbox d35029b
Add conda exec
datumbox 2757787
Changing verbosity
datumbox f5678e4
Address review comments.
datumbox 00d2de4
Adding verbosity flag
datumbox 377a0f4
Add more dependencies
datumbox 632cba4
Switch openjpeg to libjpeg
datumbox 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Unit-tests on M1 | ||
datumbox marked this conversation as resolved.
Show resolved
Hide resolved
|
||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/test-m1.yml | ||
push: | ||
branches: | ||
- nightly | ||
- main | ||
workflow_dispatch: | ||
jobs: | ||
tests: | ||
name: "Unit-tests on M1" | ||
runs-on: macos-m1 | ||
strategy: | ||
matrix: | ||
py_vers: [ "3.8"] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Install TorchVision | ||
shell: arch -arch arm64 bash {0} | ||
env: | ||
ENV_NAME: conda-env-${{ github.run_id }} | ||
PY_VERS: ${{ matrix.py_vers }} | ||
run: | | ||
. ~/miniconda3/etc/profile.d/conda.sh | ||
set -ex | ||
conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng libjpeg scipy | ||
conda run -p ${ENV_NAME} python3 -mpip install torch --extra-index-url=https://download.pytorch.org/whl/nightly | ||
conda run -p ${ENV_NAME} python3 setup.py develop | ||
conda run -p ${ENV_NAME} python3 -mpip install pytest pytest-mock av | ||
- name: Run tests | ||
shell: arch -arch arm64 bash {0} | ||
env: | ||
ENV_NAME: conda-env-${{ github.run_id }} | ||
PY_VERS: ${{ matrix.py_vers }} | ||
run: | | ||
. ~/miniconda3/etc/profile.d/conda.sh | ||
set -ex | ||
conda run -p ${ENV_NAME} --no-capture-output python3 -u -mpytest -v --tb=long --durations 20 | ||
conda env remove -p ${ENV_NAME} |
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.
Why do we want to execute this on main ? Since you already compiling vision inside test-m1.yml.
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.
The
test-m1
only tests on py3.8 and executes only part of the checks (no wheel validation). I thought it would be best to do this at least once in each PR on main to be able to catch the issues easier. It's a middle ground tradeoff between executing the tests in every PR/commit and doing so only once a day. Hopefully the volume of commits that get merged every day on TorchVision isn't significant to affect the overall resources.