forked from explosion/spaCy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up GPU CI testing (explosion#7293)
* Set up CI for tests with GPU agent * Update tests for enabled GPU * Fix steps filename * Add parallel build jobs as a setting * Fix test requirements * Fix install test requirements condition * Fix pipeline models test * Reset current ops in prefer/require testing * Fix more tests * Remove separate test_models test * Fix regression 5551 * fix StaticVectors for GPU use * fix vocab tests * Fix regression test 5082 * Move azure steps to .github and reenable default pool jobs * Consolidate/rename azure steps Co-authored-by: svlandeg <[email protected]>
- Loading branch information
1 parent
bdb485c
commit 36ecba2
Showing
16 changed files
with
239 additions
and
138 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,57 @@ | ||
parameters: | ||
python_version: '' | ||
architecture: '' | ||
prefix: '' | ||
gpu: false | ||
num_build_jobs: 1 | ||
|
||
steps: | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: ${{ parameters.python_version }} | ||
architecture: ${{ parameters.architecture }} | ||
|
||
- script: | | ||
${{ parameters.prefix }} python -m pip install -U pip setuptools | ||
${{ parameters.prefix }} python -m pip install -U -r requirements.txt | ||
displayName: "Install dependencies" | ||
- script: | | ||
${{ parameters.prefix }} python setup.py build_ext --inplace -j ${{ parameters.num_build_jobs }} | ||
${{ parameters.prefix }} python setup.py sdist --formats=gztar | ||
displayName: "Compile and build sdist" | ||
- task: DeleteFiles@1 | ||
inputs: | ||
contents: "spacy" | ||
displayName: "Delete source directory" | ||
|
||
- script: | | ||
${{ parameters.prefix }} python -m pip freeze --exclude torch --exclude cupy-cuda110 > installed.txt | ||
${{ parameters.prefix }} python -m pip uninstall -y -r installed.txt | ||
displayName: "Uninstall all packages" | ||
- bash: | | ||
${{ parameters.prefix }} SDIST=$(python -c "import os;print(os.listdir('./dist')[-1])" 2>&1) | ||
${{ parameters.prefix }} python -m pip install dist/$SDIST | ||
displayName: "Install from sdist" | ||
- script: | | ||
${{ parameters.prefix }} python -m pip install -U -r requirements.txt | ||
displayName: "Install test requirements" | ||
- script: | | ||
${{ parameters.prefix }} python -m pip install -U cupy-cuda110 | ||
${{ parameters.prefix }} python -m pip install "torch==1.7.1+cu110" -f https://download.pytorch.org/whl/torch_stable.html | ||
displayName: "Install GPU requirements" | ||
condition: eq(${{ parameters.gpu }}, true) | ||
- script: | | ||
${{ parameters.prefix }} python -m pytest --pyargs spacy | ||
displayName: "Run CPU tests" | ||
condition: eq(${{ parameters.gpu }}, false) | ||
- script: | | ||
${{ parameters.prefix }} python -m pytest --pyargs spacy -p spacy.tests.enable_gpu | ||
displayName: "Run GPU tests" | ||
condition: eq(${{ parameters.gpu }}, true) |
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 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,3 @@ | ||
from spacy import require_gpu | ||
|
||
require_gpu() |
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 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 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
Oops, something went wrong.