Skip to content

Commit

Permalink
Move to bare Windows GPU VMs and fix build issues (#475)
Browse files Browse the repository at this point in the history
* Updating AzureDevOps pipeline agent pool to use a barebones Windows GPU VM.

* Added a AzureDevOps pipeline for windows.

* Added a conda init step for powershell.

* Adding conda to PATH as a separate step

* Pinning pillow to 6.1 to fix issues listed in: python-pillow/Pillow#4130

* chained powershell commands

* Updated AzureDevOps yml file to use the inline powershell script syntax.

* Moved to using inline commands + Invoke-Expression syntax

* Adding indentation for chained commands.

* Moving to the literal block style indicator for yaml for chained commands.

* Using call activate instead of source activate when activating the conda environment through powershell.

* Switching to script steps instead of using powershell steps for conda operations.

* Fixed the numpy.float64 issue by moving to a fork with the upstream fixes for the issue.

* Fixed the numpy.float64 issue in utils/cv/detection/plot.py
  • Loading branch information
youngpark committed Jan 23, 2020
1 parent d76274e commit 39d839f
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 6 deletions.
4 changes: 3 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ channels:
dependencies:
- python==3.6.8
- pytorch==1.2.0
# pinning pillow to 6.1 to fix issue: https://github.com/python-pillow/Pillow/issues/4130
- pillow==6.1
- torchvision==0.4.0
- fastai==1.0.57
- ipykernel>=4.6.1
Expand All @@ -38,4 +40,4 @@ dependencies:
- nvidia-ml-py3
- nteract-scrapbook
- azureml-sdk[notebooks,contrib]>=1.0.30
- git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
- git+https://github.com/youngpark/cocoapi.git#subdirectory=PythonAPI
4 changes: 2 additions & 2 deletions tests/.ci/azure-pipeline-windows-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ trigger:
jobs:
- job: WindowsCPU
pool:
name: cvbpwinpool
name: cvbp-win-bare

steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH

- template: templates/unit-test-steps-not-linuxgpu.yml # Template reference
- template: templates/unit-test-steps-windows.yml # Template reference

- script: |
call conda env remove -n cv -y
Expand Down
4 changes: 2 additions & 2 deletions tests/.ci/azure-pipeline-windows-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ trigger:
jobs:
- job: WindowsGPU
pool:
name: cvbpwinpool
name: cvbp-win-bare

steps:
- template: templates/unit-test-steps-not-linuxgpu.yml # Template reference
- template: templates/unit-test-steps-windows.yml # Template reference

- script: |
call conda env remove -n cv -y
Expand Down
46 changes: 46 additions & 0 deletions tests/.ci/templates/unit-test-steps-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Unit and integration test steps
steps:

- powershell: |
Write-Host '##vso[task.prependpath]$env:CONDA\Scripts'
displayName: Add conda to PATH

- script: |
conda remove --name cv --all --force -y
displayName: 'Remove conda env in case it was not created correctly'

- script: |
conda env create -f environment.yml
displayName: 'Create and activate conda environment'

- script: |
conda env list
displayName: 'List conda environments to ensure one was created'

- script: |
call activate cv
pytest --durations 100 tests --junitxml=junit/test-unitttest.xml -m "not azuremlnotebooks and not linuxgpu"
displayName: 'Run unit and (only on Linux GPU) integration tests'

- script: |
echo Remove Conda Environment
conda remove -n cv --all -q --force -y
echo Done Cleanup
displayName: 'Clean up the newly created environment'
condition: always()

- script: |
conda env list
displayName: 'List conda environments to verify cleanup of the new environment'

- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-unitttest.xml'
testRunTitle: 'Test results for PyTest'

- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'

2 changes: 1 addition & 1 deletion utils_cv/detection/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def _plot_pr_curve_iou_range(
x = np.arange(0.0, 1.01, 0.01)
iou_thrs_idx = range(0, 10)
iou_thrs = np.linspace(
0.5, 0.95, np.round((0.95 - 0.5) / 0.05) + 1, endpoint=True
0.5, 0.95, int(np.round((0.95 - 0.5) / 0.05)) + 1, endpoint=True
)

# get_cmap() - a function that maps each index in 0, 1, ..., n-1 to a distinct
Expand Down

0 comments on commit 39d839f

Please sign in to comment.