mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-26 16:44:54 +08:00
Compare commits
82 Commits
nightly-bi
...
v1.7.1-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
| 1d9b64d126 | |||
| 62d6dfce58 | |||
| 351b85d758 | |||
| a828009bb6 | |||
| 76c9339ce9 | |||
| 716adbe598 | |||
| ea62bc80bd | |||
| 1dd1eb1cb6 | |||
| 78ff7e83c8 | |||
| 45b4b5dcdd | |||
| 1814d1a43f | |||
| bf72312cf3 | |||
| 4dc175346a | |||
| 22dfccbbad | |||
| 9977885235 | |||
| b6d4dc1ee6 | |||
| 45739e02af | |||
| b902c31a6a | |||
| ee4dfe12cb | |||
| 30bf257970 | |||
| 7e71a98367 | |||
| 36263cecba | |||
| cc406a98ba | |||
| 3a98163fd2 | |||
| 87bab09b26 | |||
| e85d494707 | |||
| a6e96b190e | |||
| f9df694843 | |||
| 6394982d13 | |||
| 56166c18f5 | |||
| 3957268bf7 | |||
| eed8d7e3cb | |||
| 33c17636b9 | |||
| cf77b0845c | |||
| 9aecf70533 | |||
| e882c748b0 | |||
| 26cf795f80 | |||
| 1fbedeac57 | |||
| 49405e710d | |||
| 03ed8cbf58 | |||
| 286647bc9f | |||
| 2a23023428 | |||
| ee6ddd38e0 | |||
| c52a61fe13 | |||
| 1c28571358 | |||
| ffa4b787d5 | |||
| 03d1c01db7 | |||
| 55d93b95b3 | |||
| 9fa9a37576 | |||
| a06d19b321 | |||
| 7548f458f5 | |||
| 992d57b9fa | |||
| 440b7bd451 | |||
| 203bc58942 | |||
| a0a65a9e27 | |||
| b234d94541 | |||
| 36fe7882ba | |||
| 445ba03a2c | |||
| 305515de09 | |||
| ff9e56575b | |||
| 379d62469b | |||
| 2c7c13b2dd | |||
| e93ae1ef32 | |||
| 653d766f4a | |||
| 333daf0815 | |||
| 65a1827c19 | |||
| 173a719d36 | |||
| 8f8da6097b | |||
| 9927825829 | |||
| bf638d5ebf | |||
| ebe8b21b08 | |||
| 7d0c7b38b5 | |||
| 30d41faf3b | |||
| 8107dba211 | |||
| d728e234cb | |||
| 1ffcdd000b | |||
| 543d09736d | |||
| fc8f987c1a | |||
| 07e66d7ca5 | |||
| e8cea53b85 | |||
| 43404c4141 | |||
| cf07ba50fe |
@ -1,63 +0,0 @@
|
||||
# PyTorch CI Builds Pipeline on Azure DevOps
|
||||
#
|
||||
# This pipeline:
|
||||
# 1) builds PyTorch on select configurations
|
||||
# 2) runs only TestTorch unit tests.
|
||||
|
||||
stages:
|
||||
- stage: 'Build'
|
||||
displayName: 'Build PyTorch'
|
||||
jobs:
|
||||
- template: job_templates/build-verify-publish-template-unix.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_CPU_docker
|
||||
pool: 'PyTorch-Linux-CPU'
|
||||
container_endpoint: pytorchms.azurecr.io
|
||||
build_stage: True
|
||||
is_ci_build: True
|
||||
os: ubuntu
|
||||
cuda: cpu
|
||||
customMatrixes:
|
||||
Py_38:
|
||||
configuration: ubuntu_1804_py_38_cpu
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_38_cpu_dev
|
||||
|
||||
- template: job_templates/build-verify-publish-template-unix.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_GPU_docker
|
||||
pool: 'PyTorch-Linux-GPU'
|
||||
container_endpoint: pytorchms.azurecr.io
|
||||
build_stage: True
|
||||
is_ci_build: True
|
||||
os: ubuntu
|
||||
cuda: gpu
|
||||
customMatrixes:
|
||||
Py_39_CUDA_112_cuDNN_810:
|
||||
configuration: ubuntu_1804_py_39_cuda_112_cudnn_810
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_39_cuda_112_cudnn_8_dev
|
||||
CUDA_VERSION: 112
|
||||
|
||||
- template: job_templates/build-verify-publish-template-win.yml
|
||||
parameters:
|
||||
name: windows_2019_CPU
|
||||
pool: 'PyTorch-Win-CPU'
|
||||
build_stage: True
|
||||
is_ci_build: True
|
||||
os: windows
|
||||
cuda: cpu
|
||||
customMatrixes:
|
||||
Py_37:
|
||||
configuration: windows_2019_py_37_cpu
|
||||
|
||||
- template: job_templates/build-verify-publish-template-win.yml
|
||||
parameters:
|
||||
name: windows_2019_GPU
|
||||
pool: 'PyTorch-Win-GPU'
|
||||
build_stage: True
|
||||
is_ci_build: True
|
||||
os: windows
|
||||
cuda: gpu
|
||||
customMatrixes:
|
||||
Py_38_CUDA_102_cuDNN_765:
|
||||
configuration: windows_2019_py_38_cuda_102_cudnn_765
|
||||
CUDA_VERSION: 102
|
||||
@ -1,82 +0,0 @@
|
||||
# PyTorch Daily Builds Pipeline on Azure DevOps
|
||||
#
|
||||
# This pipeline:
|
||||
# 1) builds PyTorch on all available configurations
|
||||
# 2) runs all PyTorch unit tests
|
||||
|
||||
stages:
|
||||
- stage: 'BuildTest'
|
||||
displayName: 'Build and Test PyTorch'
|
||||
jobs:
|
||||
- template: job_templates/build-verify-publish-template-unix.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_CPU_docker
|
||||
pool: 'PyTorch-Linux-CPU'
|
||||
container_endpoint: pytorchms.azurecr.io
|
||||
build_stage: True
|
||||
is_daily_build: True
|
||||
os: ubuntu
|
||||
cuda: cpu
|
||||
customMatrixes:
|
||||
Py_38:
|
||||
configuration: ubuntu_1804_py_38_cpu
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_38_cpu_dev
|
||||
Py_37:
|
||||
configuration: ubuntu_1804_py_37_cpu
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_37_cpu_dev
|
||||
|
||||
- template: job_templates/build-verify-publish-template-unix.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_GPU_docker
|
||||
pool: 'PyTorch-Linux-GPU'
|
||||
container_endpoint: pytorchms.azurecr.io
|
||||
build_stage: True
|
||||
is_daily_build: True
|
||||
os: ubuntu
|
||||
cuda: gpu
|
||||
customMatrixes:
|
||||
Py_39_CUDA_112_cuDNN_810:
|
||||
configuration: ubuntu_1804_py_39_cuda_112_cudnn_810
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_39_cuda_112_cudnn_8_dev
|
||||
CUDA_VERSION: 112
|
||||
Py_38_CUDA_102_cuDNN_810:
|
||||
configuration: ubuntu_1804_py_38_cuda_102_cudnn_810
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_38_cuda_102_cudnn_8_dev
|
||||
CUDA_VERSION: 102
|
||||
Py_37_CUDA_101_cuDNN_765:
|
||||
configuration: ubuntu_1804_py_37_cuda_101_cudnn_765
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_37_cuda_101_cudnn_7_dev
|
||||
CUDA_VERSION: 101
|
||||
|
||||
- template: job_templates/build-verify-publish-template-win.yml
|
||||
parameters:
|
||||
name: windows_2019_CPU
|
||||
pool: 'PyTorch-Win-CPU'
|
||||
build_stage: True
|
||||
is_daily_build: True
|
||||
os: windows
|
||||
cuda: cpu
|
||||
customMatrixes:
|
||||
Py_38:
|
||||
configuration: windows_2019_py_38_cpu
|
||||
Py_37:
|
||||
configuration: windows_2019_py_37_cpu
|
||||
|
||||
- template: job_templates/build-verify-publish-template-win.yml
|
||||
parameters:
|
||||
name: windows_2019_GPU
|
||||
pool: 'PyTorch-Win-GPU'
|
||||
build_stage: True
|
||||
is_daily_build: True
|
||||
os: windows
|
||||
cuda: gpu
|
||||
customMatrixes:
|
||||
Py_39_CUDA_112_cuDNN_810:
|
||||
configuration: windows_2019_py_39_cuda_112_cudnn_810
|
||||
CUDA_VERSION: 112
|
||||
Py_38_CUDA_102_cuDNN_765:
|
||||
configuration: windows_2019_py_38_cuda_102_cudnn_765
|
||||
CUDA_VERSION: 102
|
||||
Py_37_CUDA_101_cuDNN_764:
|
||||
configuration: windows_2019_py_37_cuda_101_cudnn_764
|
||||
CUDA_VERSION: 101
|
||||
@ -1,134 +0,0 @@
|
||||
# PyTorch build steps template with Unix images Azure DevOps Instances
|
||||
#
|
||||
# This build depends on 3 parameters set as environment variables in the pipeline:
|
||||
# - AZURE_DEVOPS_CLI_PAT: Secret var for authenticating to Azure DevOps
|
||||
# - AZURE_DEVOPS_ARTIFACTS_ORGANIZATION: Azure Artifacts Organization name to publish artifacts
|
||||
# - AZURE_DEVOPS_ARTIFACTS_PROJECT: Azure Artifacts Project name to publish artifacts
|
||||
|
||||
parameters:
|
||||
name: ''
|
||||
pool: ''
|
||||
container_endpoint: ''
|
||||
os: ''
|
||||
cuda: ''
|
||||
is_ci_build: False
|
||||
is_official_build: False
|
||||
is_daily_build: False
|
||||
build_stage: False
|
||||
verify_stage: False
|
||||
publish_stage: False
|
||||
customMatrixes: ''
|
||||
|
||||
jobs:
|
||||
- job: ${{parameters.name}}
|
||||
timeoutInMinutes: 300
|
||||
strategy:
|
||||
matrix:
|
||||
${{ insert }}: ${{parameters.customMatrixes}}
|
||||
pool:
|
||||
name: ${{ parameters.pool}}
|
||||
variables:
|
||||
DECODE_PERCENTS: false
|
||||
container:
|
||||
image: $[variables['container_image']]
|
||||
endpoint: ${{parameters.container_endpoint}}
|
||||
|
||||
steps:
|
||||
# Build stage
|
||||
- ${{ if eq(parameters.build_stage, 'True') }}:
|
||||
# Set up environment variables for specific pipeline build
|
||||
- template: set-environment-variables.yml
|
||||
parameters:
|
||||
os: ${{ parameters.os}}
|
||||
cuda: ${{ parameters.cuda}}
|
||||
is_official_build: ${{ parameters.is_official_build}}
|
||||
|
||||
# Sync and update PyTorch submodules
|
||||
- bash: git submodule update --init --recursive --jobs 0
|
||||
displayName: Update PyTorch submodules
|
||||
|
||||
# Build PyTorch and run unit tests - no packaging
|
||||
- ${{ if or(eq(parameters.is_ci_build, 'True'), eq(parameters.is_daily_build, 'True')) }}:
|
||||
# Build PyTorch from source in develop mode
|
||||
- bash: python setup.py develop
|
||||
displayName: Build PyTorch from source
|
||||
|
||||
- ${{ if eq(parameters.is_ci_build, 'True') }}:
|
||||
# Run TestTorch unit tests to demonstrate successful PyTorch build
|
||||
- bash: python test/test_torch.py TestTorch
|
||||
displayName: Run TestTorch unit tests
|
||||
|
||||
- ${{ if eq(parameters.is_daily_build, 'True') }}:
|
||||
# Run all unit tests to demonstrate successful PyTorch build
|
||||
- bash: python test/run_test.py --continue-through-error --exclude-jit-executor --verbose
|
||||
displayName: Run all unit tests
|
||||
|
||||
# Run ComponentGovernance
|
||||
- task: ComponentGovernanceComponentDetection@0
|
||||
inputs:
|
||||
scanType: 'Register'
|
||||
verbosity: 'Verbose'
|
||||
alertWarningLevel: 'High'
|
||||
|
||||
# Build PyTorch and produce artifacts for verification stage
|
||||
- ${{ if eq(parameters.is_official_build, 'True') }}:
|
||||
# Build PyTorch from source in install mode and exclude test binaries
|
||||
- bash: python setup.py install
|
||||
displayName: Build PyTorch from source without test binaries
|
||||
|
||||
# Package PyTorch Wheel
|
||||
- bash: python setup.py bdist_wheel
|
||||
displayName: Package PyTorch Wheel
|
||||
|
||||
# Publish PyTorch Wheel
|
||||
- task: PublishPipelineArtifact@1
|
||||
inputs:
|
||||
targetPath: $(Build.SourcesDirectory)/dist/
|
||||
artifactName: Build_$(Build.BuildNumber)_$(configuration)
|
||||
displayName: Publish PyTorch Wheel to Pipeline Artifacts
|
||||
|
||||
# Verification stage
|
||||
- ${{ if eq(parameters.verify_stage, 'True') }}:
|
||||
# Download PyTorch Wheel
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
artifact: Build_$(Build.BuildNumber)_$(configuration)
|
||||
path: $(Build.SourcesDirectory)/verify
|
||||
displayName: Download PyTorch Wheel
|
||||
|
||||
# Install PyTorch Wheel on Windows
|
||||
- bash: python -m pip install $(Build.SourcesDirectory)/verify/torch*linux*.whl
|
||||
displayName: Install PyTorch Wheel
|
||||
|
||||
# Ensure PyTorch installed correctly from produced wheel
|
||||
- bash: |
|
||||
cd $(Build.SourcesDirectory)/verify
|
||||
python -c "import torch; print('Installed Torch version: ' + torch.__version__)"
|
||||
displayName: Check PyTorch correctly installed from wheel
|
||||
|
||||
# Publishing stage
|
||||
- ${{ if eq(parameters.publish_stage, 'True') }}:
|
||||
# Download PyTorch Wheel
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
artifact: Build_$(Build.BuildNumber)_$(configuration)
|
||||
path: $(Build.SourcesDirectory)/publish
|
||||
displayName: Download PyTorch Wheel
|
||||
|
||||
# Publish wheel to Azure Artifacts
|
||||
# The flag continueOnError=true is needed as the artifact to be published
|
||||
# may already exist, because the artifact is differentiated based on the
|
||||
# last commit date.
|
||||
- bash: |
|
||||
export TORCH_VERSION=$(head -c 5 ./version.txt)
|
||||
export LAST_COMMIT=$(git rev-parse --short HEAD)
|
||||
export LAST_COMMIT_DATE=$(git log -1 --pretty=%ad --date=format:%Y%m%d)
|
||||
cd $(Build.SourcesDirectory)/publish
|
||||
export TORCH_WHEEL=$(echo torch*linux*whl)
|
||||
az extension add -n azure-devops
|
||||
echo $ADOTOKEN | az devops login
|
||||
az artifacts universal publish --organization $AZURE_DEVOPS_ARTIFACTS_ORGANIZATION --project $AZURE_DEVOPS_ARTIFACTS_PROJECT --scope project --feed "PyTorch" --name $TORCH_WHEEL --description "PyTorch Official Build Artifact" --version $TORCH_VERSION-$LAST_COMMIT_DATE-$LAST_COMMIT --path .
|
||||
env:
|
||||
ADOTOKEN: $(AZURE_DEVOPS_CLI_PAT)
|
||||
continueOnError: true
|
||||
displayName: Upload PyTorch Official Build package to Azure Artifacts
|
||||
@ -1,150 +0,0 @@
|
||||
# PyTorch build steps template with Windows images Azure DevOps Instances
|
||||
#
|
||||
# This build depends on 3 parameters set as environment variables in the pipeline:
|
||||
# - AZURE_DEVOPS_CLI_PAT: Secret var for authenticating to Azure DevOps
|
||||
# - AZURE_DEVOPS_ARTIFACTS_ORGANIZATION: Azure Artifacts Organization name to publish artifacts
|
||||
# - AZURE_DEVOPS_ARTIFACTS_PROJECT: Azure Artifacts Project name to publish artifacts
|
||||
|
||||
parameters:
|
||||
name: ''
|
||||
pool: ''
|
||||
os: ''
|
||||
cuda: ''
|
||||
is_ci_build: False
|
||||
is_official_build: False
|
||||
is_daily_build: False
|
||||
build_stage: False
|
||||
verify_stage: False
|
||||
publish_stage: False
|
||||
customMatrixes: ''
|
||||
|
||||
jobs:
|
||||
- job: ${{parameters.name}}
|
||||
timeoutInMinutes: 300
|
||||
strategy:
|
||||
matrix:
|
||||
${{ insert }}: ${{parameters.customMatrixes}}
|
||||
pool:
|
||||
name: ${{ parameters.pool}}
|
||||
variables:
|
||||
CMAKE_GENERATOR: Ninja
|
||||
PACKAGE_PDBS: 0
|
||||
|
||||
steps:
|
||||
# Prepare for PyTorch build on Windows
|
||||
- template: prepare-build-template.yml
|
||||
parameters:
|
||||
configuration: $(configuration)
|
||||
build_stage: ${{ parameters.build_stage}}
|
||||
|
||||
# Build Stage
|
||||
- ${{ if eq(parameters.build_stage, 'True') }}:
|
||||
# Set up environment variables for specific pipeline build
|
||||
- template: set-environment-variables.yml
|
||||
parameters:
|
||||
os: ${{ parameters.os}}
|
||||
cuda: ${{ parameters.cuda}}
|
||||
is_official_build: ${{ parameters.is_official_build}}
|
||||
|
||||
# Sync and update PyTorch submodules
|
||||
- script: git submodule update --init --recursive --jobs 0
|
||||
displayName: Update PyTorch submodules
|
||||
|
||||
# Build PyTorch and run unit tests - no packaging
|
||||
- ${{ if or(eq(parameters.is_ci_build, 'True'), eq(parameters.is_daily_build, 'True')) }}:
|
||||
# Build PyTorch from source in develop mode with Ninja
|
||||
- script: call activate $(configuration) && python setup.py develop
|
||||
displayName: Build PyTorch from source
|
||||
|
||||
- ${{ if eq(parameters.is_ci_build, 'True') }}:
|
||||
# Run TestTorch unit tests to demonstrate successful PyTorch build
|
||||
- script: call activate $(configuration) && python test\test_torch.py TestTorch
|
||||
displayName: Run TestTorch unit tests
|
||||
|
||||
- ${{ if eq(parameters.is_daily_build, 'True') }}:
|
||||
# Run all unit tests to demonstrate successful PyTorch build
|
||||
- script: call activate $(configuration) && python test/run_test.py --continue-through-error --exclude-jit-executor --verbose
|
||||
displayName: Run all unit tests
|
||||
|
||||
# Run ComponentGovernance
|
||||
- task: ComponentGovernanceComponentDetection@0
|
||||
inputs:
|
||||
scanType: 'Register'
|
||||
verbosity: 'Verbose'
|
||||
alertWarningLevel: 'High'
|
||||
|
||||
# Build PyTorch and produce artifacts for verification stage
|
||||
- ${{ if eq(parameters.is_official_build, 'True') }}:
|
||||
# Build PyTorch from source in install mode with Ninja and exclude test binaries
|
||||
- script: call activate $(configuration) && python setup.py install
|
||||
displayName: Build PyTorch from source without test binaries
|
||||
|
||||
# Package PyTorch Wheel
|
||||
- script: call activate $(configuration) && python setup.py bdist_wheel
|
||||
displayName: Package PyTorch Wheel
|
||||
|
||||
# Publish PyTorch Wheel
|
||||
- task: PublishPipelineArtifact@1
|
||||
inputs:
|
||||
targetPath: $(Build.SourcesDirectory)\dist\
|
||||
artifactName: Build_$(Build.BuildNumber)_$(configuration)
|
||||
displayName: Publish PyTorch Wheel to Pipeline Artifacts
|
||||
|
||||
# Verification Stage
|
||||
- ${{ if eq(parameters.verify_stage, 'True') }}:
|
||||
# Download PyTorch Wheel
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
artifact: Build_$(Build.BuildNumber)_$(configuration)
|
||||
path: $(Build.SourcesDirectory)\verify
|
||||
displayName: Download PyTorch Wheel
|
||||
|
||||
# Install PyTorch Wheel on Windows
|
||||
- script: |
|
||||
call activate $(configuration)
|
||||
cd $(Build.SourcesDirectory)\verify
|
||||
dir torch*win*.whl /b > whl.txt
|
||||
set /p whl= < whl.txt
|
||||
python -m pip install %whl%
|
||||
displayName: Install PyTorch Wheel
|
||||
|
||||
# Ensure PyTorch installed correctly from produced wheel
|
||||
- script: |
|
||||
call activate $(configuration)
|
||||
cd $(Build.SourcesDirectory)\verify
|
||||
python -c "import torch; print('Installed Torch version: ' + torch.__version__)"
|
||||
displayName: Check PyTorch correctly installed from wheel
|
||||
|
||||
# Publishing stage
|
||||
- ${{ if eq(parameters.publish_stage, 'True') }}:
|
||||
# Download PyTorch Wheel
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
artifact: Build_$(Build.BuildNumber)_$(configuration)
|
||||
path: $(Build.SourcesDirectory)\publish
|
||||
displayName: Download PyTorch Wheel
|
||||
|
||||
# Set up Azure Artifacts for Windows
|
||||
# The pip install --upgrade command is a bug fix for Azure CLI on Windows
|
||||
# More info: https://github.com/Azure/azure-cli/issues/16858
|
||||
- script: |
|
||||
pip install --upgrade pip --target \opt\az\lib\python3.6\site-packages\
|
||||
az extension add -n azure-devops
|
||||
displayName: Set up Azure Artifacts download on Windows
|
||||
|
||||
# Publish wheel to Azure Artifacts
|
||||
# The flag continueOnError=true is needed as the artifact to be published
|
||||
# may already exist, because the artifact is differentiated based on the
|
||||
# last commit date.
|
||||
- script: |
|
||||
set /p TORCH_VERSION= < version.txt
|
||||
cd $(Build.SourcesDirectory)\publish
|
||||
git rev-parse --short HEAD > last_commit.txt && set /p LAST_COMMIT= < last_commit.txt
|
||||
git log -1 --pretty=%ad --date=format:%Y%m%d > last_commit_date.txt && set /p LAST_COMMIT_DATE= < last_commit_date.txt
|
||||
dir torch*win*.whl /b > whl.txt && set /p TORCH_WHEEL= < whl.txt
|
||||
echo %ADOTOKEN% | az devops login
|
||||
az artifacts universal publish --organization %AZURE_DEVOPS_ARTIFACTS_ORGANIZATION% --project %AZURE_DEVOPS_ARTIFACTS_PROJECT% --scope project --feed "PyTorch" --name %TORCH_WHEEL% --description "PyTorch Official Build Artifact" --version %TORCH_VERSION:~0,5%-%LAST_COMMIT_DATE%-%LAST_COMMIT% --path .
|
||||
env:
|
||||
ADOTOKEN: $(AZURE_DEVOPS_CLI_PAT)
|
||||
continueOnError: true
|
||||
displayName: Upload PyTorch nigthly package to Azure Artifacts
|
||||
@ -1,17 +0,0 @@
|
||||
dependencies:
|
||||
- python=PYTHON_VERSION
|
||||
- numpy
|
||||
- ninja
|
||||
- pyyaml
|
||||
- mkl
|
||||
- mkl-include
|
||||
- setuptools
|
||||
- cmake
|
||||
- cffi
|
||||
- typing_extensions
|
||||
- future
|
||||
- six
|
||||
- requests
|
||||
- dataclasses
|
||||
- pip:
|
||||
- -r ../../requirements.txt
|
||||
@ -1,26 +0,0 @@
|
||||
parameters:
|
||||
name: ''
|
||||
pool: ''
|
||||
customMatrixes: ''
|
||||
|
||||
jobs:
|
||||
- job: ${{parameters.name}}
|
||||
timeoutInMinutes: 600
|
||||
strategy:
|
||||
matrix:
|
||||
${{ insert }}: ${{parameters.customMatrixes}}
|
||||
pool:
|
||||
name: ${{ parameters.pool}}
|
||||
steps:
|
||||
# Clone PyTorch Tests repository
|
||||
- bash: |
|
||||
B64_PAT=$(echo -n ":$_ADOTOKEN" | base64)
|
||||
git -c http.extraHeader="Authorization: Basic ${B64_PAT}" clone $(AZURE_DEVOPS_PYTORCH_TESTS_REPO_URL)
|
||||
cd pytorch_tests
|
||||
git checkout $(PYTORCH_TESTS_CHECKOUT_BRANCH)
|
||||
env:
|
||||
_ADOTOKEN: $(AZURE_DEVOPS_CLI_PAT)
|
||||
displayName: Clone PyTorch Tests repo
|
||||
- bash: |
|
||||
bash $(Build.SourcesDirectory)/pytorch_tests/webapp/notify_webapp.sh
|
||||
displayName: Notify Webapp
|
||||
@ -1,62 +0,0 @@
|
||||
# Build prepare steps for PyTorch on Azure DevOps to build from source.
|
||||
# These steps share between normal build process and semmle security scan tasks
|
||||
|
||||
parameters:
|
||||
build_stage: False
|
||||
configuration: ''
|
||||
|
||||
steps:
|
||||
# End Python tasks that may be lingering over from previous runs
|
||||
# Note: If python.exe isn't currently running, exit code becomes 128,
|
||||
# which fails the run. Here exit code is set to 0 to avoid failed run.
|
||||
- script: |
|
||||
taskkill /f /im python.exe
|
||||
IF %ERRORLEVEL% EQU 128 exit 0
|
||||
displayName: End previous Python processes
|
||||
|
||||
# Clean up env directory in conda for fresh builds and set up conda environment YAML
|
||||
- powershell: |
|
||||
Remove-Item 'C:\Miniconda\envs' -Recurse -ErrorAction Ignore
|
||||
$env:PYTHON_VERSION = $env:SYSTEM_JOBNAME.Substring(3,1) + '.' + $env:SYSTEM_JOBNAME.Substring(4,1)
|
||||
(Get-Content .azure_pipelines\job_templates\common-packages.yml) -replace 'PYTHON_VERSION', $env:PYTHON_VERSION | Out-File -encoding ASCII .azure_pipelines\job_templates\common-packages.yml
|
||||
displayName: Clean up previous environments and Set up conda environment YAML
|
||||
|
||||
# Make conda environment and install required packages
|
||||
- script: |
|
||||
call conda clean --all -y
|
||||
call conda env create -n $(configuration) --file .azure_pipelines\job_templates\common-packages.yml
|
||||
call activate $(configuration)
|
||||
call conda install -c conda-forge libuv=1.39
|
||||
displayName: Set up conda environment for building from source
|
||||
|
||||
- ${{ if eq(parameters.build_stage, 'True') }}:
|
||||
# Install MKL
|
||||
- script: |
|
||||
rmdir /s /q mkl
|
||||
del mkl_2020.2.254.7z
|
||||
curl https://s3.amazonaws.com/ossci-windows/mkl_2020.2.254.7z -k -O
|
||||
7z x -aoa mkl_2020.2.254.7z -omkl
|
||||
displayName: Install MKL
|
||||
|
||||
# Install sccache and randomtemp
|
||||
# Related PyTorch GitHub issue: https://github.com/pytorch/pytorch/issues/25393
|
||||
# Related fix: https://github.com/pytorch/builder/pull/448/
|
||||
- script: |
|
||||
mkdir .\tmp_bin
|
||||
curl -k https://s3.amazonaws.com/ossci-windows/sccache.exe --output .\tmp_bin\sccache.exe
|
||||
curl -k https://s3.amazonaws.com/ossci-windows/sccache-cl.exe --output .\tmp_bin\sccache-cl.exe
|
||||
copy .\tmp_bin\sccache.exe .\tmp_bin\nvcc.exe
|
||||
curl -kL https://github.com/peterjc123/randomtemp-rust/releases/download/v0.4/randomtemp.exe --output .\tmp_bin\randomtemp.exe
|
||||
displayName: Install sccache and randomtemp
|
||||
condition: not(eq(variables.CUDA_VERSION, ''))
|
||||
|
||||
# CUDA 11.2's CUB directory conflicts with CUDA 10.2 and 10.1
|
||||
# builds, where CUDA 11.2's CUB is injected into non-CUDA
|
||||
# 11.2 builds.
|
||||
- powershell: Remove-Item "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cub" -Recurse -ErrorAction Ignore
|
||||
displayName: Remove conflicting CUB from CUDA installation
|
||||
condition: not(eq(variables.CUDA_VERSION, ''))
|
||||
|
||||
- powershell: Copy-Item -Path "F:\cuda_11_2\cub\" -Destination "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include" -Recurse
|
||||
displayName: Copy CUDA CUB for CUDA 11.2 build
|
||||
condition: eq(variables.CUDA_VERSION, '112')
|
||||
@ -1,61 +0,0 @@
|
||||
# PyTorch build steps template with Unix images Azure DevOps Instances
|
||||
#
|
||||
# This build depends on 5 parameters set as an environment variables in the pipeline:
|
||||
# - AZURE_DEVOPS_CLI_PAT: Secret var for authenticating to Azure DevOps
|
||||
# - AZURE_STORAGE_KEY: Secret var for authenticating to Azure Storage
|
||||
# - _TS_CLONE_P, _TS_P, _TS_SM_P: Secret vars for specific unit tests
|
||||
|
||||
parameters:
|
||||
name: ''
|
||||
pool: ''
|
||||
container_endpoint: ''
|
||||
customMatrixes: ''
|
||||
|
||||
jobs:
|
||||
- job: ${{parameters.name}}
|
||||
timeoutInMinutes: 600
|
||||
strategy:
|
||||
matrix:
|
||||
${{ insert }}: ${{parameters.customMatrixes}}
|
||||
pool:
|
||||
name: ${{ parameters.pool}}
|
||||
variables:
|
||||
DECODE_PERCENTS: false
|
||||
|
||||
steps:
|
||||
# Don't checkout repo contents to save time and CPU compute. Environment variables
|
||||
# related to checkout branch such as $(BUILD_SOURCEBRANCH) are still available.
|
||||
- checkout: none
|
||||
|
||||
# Delete pytorch_tests repo from previous builds if exists
|
||||
- bash: rm -rf pytorch_tests/
|
||||
displayName: Delete pytorch_tests repo from previous builds if exists
|
||||
|
||||
# Clone PyTorch Tests repository
|
||||
- bash: |
|
||||
B64_PAT=$(echo -n ":$_ADOTOKEN" | base64)
|
||||
git -c http.extraHeader="Authorization: Basic ${B64_PAT}" clone $(AZURE_DEVOPS_PYTORCH_TESTS_REPO_URL)
|
||||
cd pytorch_tests
|
||||
git checkout $(PYTORCH_TESTS_CHECKOUT_BRANCH)
|
||||
env:
|
||||
_ADOTOKEN: $(AZURE_DEVOPS_CLI_PAT)
|
||||
displayName: Clone PyTorch Tests repo
|
||||
|
||||
# Run PyTorch Unit Tests
|
||||
- bash: bash $(Build.SourcesDirectory)/pytorch_tests/scripts/linux/run.sh
|
||||
env:
|
||||
_AZURE_STORAGE_KEY: $(AZURE_STORAGE_KEY)
|
||||
_TS_CLONE_P: $(TS_CLONE_PASSWORD)
|
||||
_TS_P: $(TS_PAT)
|
||||
_TS_SM_P: $(TS_SM_PAT)
|
||||
_AZUREML_CLONE_PASSWORD: $(AZUREML_CLONE_PASSWORD)
|
||||
_SPPASSWORD: $(SPPASSWORD)
|
||||
displayName: Run PyTorch Unit Tests
|
||||
|
||||
# Tests results are available outside the docker container since
|
||||
# the current directory is mounted as a volume of the container.
|
||||
- task: PublishTestResults@2
|
||||
condition: always()
|
||||
inputs:
|
||||
testResultsFiles: '**/test-*.xml'
|
||||
testRunTitle: 'Publish test results for Python'
|
||||
@ -1,57 +0,0 @@
|
||||
# PyTorch build steps template with Windows images Azure DevOps Instances
|
||||
#
|
||||
# This build depends on 5 parameters set as an environment variables in the pipeline:
|
||||
# - AZURE_DEVOPS_CLI_PAT: Secret var for authenticating to Azure DevOps
|
||||
# - AZURE_STORAGE_KEY: Secret var for authenticating to Azure Storage
|
||||
# - _TS_CLONE_P, _TS_P, _TS_SM_P: Secret vars for specific unit tests
|
||||
|
||||
parameters:
|
||||
name: ''
|
||||
pool: ''
|
||||
customMatrixes: ''
|
||||
|
||||
jobs:
|
||||
- job: ${{parameters.name}}
|
||||
timeoutInMinutes: 600
|
||||
strategy:
|
||||
matrix:
|
||||
${{ insert }}: ${{parameters.customMatrixes}}
|
||||
pool:
|
||||
name: ${{ parameters.pool}}
|
||||
|
||||
steps:
|
||||
# Don't checkout repo contents to save time and CPU compute. Environment variables
|
||||
# related to checkout branch such as $(BUILD_SOURCEBRANCH) are still available.
|
||||
- checkout: none
|
||||
|
||||
# Delete pytorch_tests repo from previous builds if exists
|
||||
- script: if exist "pytorch_tests/" rmdir "pytorch_tests/" /q /s
|
||||
displayName: Delete pytorch_tests repo from previous builds if exists
|
||||
|
||||
# Clone PyTorch Tests repository
|
||||
- powershell: |
|
||||
$env:B64Pat = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(":$env:_ADOTOKEN"))
|
||||
git -c http.extraHeader="Authorization: Basic $env:B64Pat" clone $env:AZURE_DEVOPS_pytorch_tests_REPO_URL
|
||||
cd pytorch_tests
|
||||
git checkout $(PYTORCH_TESTS_CHECKOUT_BRANCH)
|
||||
env:
|
||||
_ADOTOKEN: $(AZURE_DEVOPS_CLI_PAT)
|
||||
displayName: Clone PyTorch Tests repo
|
||||
|
||||
# Run PyTorch Unit Tests
|
||||
- script: call $(Build.SourcesDirectory)\pytorch_tests\scripts\windows\run.bat
|
||||
env:
|
||||
_ADOTOKEN: $(AZURE_DEVOPS_CLI_PAT)
|
||||
_AZURE_STORAGE_KEY: $(AZURE_STORAGE_KEY)
|
||||
_TS_CLONE_P: $(TS_CLONE_PASSWORD)
|
||||
_TS_P: $(TS_PAT)
|
||||
_TS_SM_P: $(TS_SM_PAT)
|
||||
displayName: Run PyTorch Unit Tests
|
||||
|
||||
# Tests results are available outside the docker container since
|
||||
# the current directory is mounted as a volume of the container.
|
||||
- task: PublishTestResults@2
|
||||
condition: always()
|
||||
inputs:
|
||||
testResultsFiles: '**\test-*.xml'
|
||||
testRunTitle: 'Publish test results for Python'
|
||||
@ -1,129 +0,0 @@
|
||||
# Set environment variables for specific configurations
|
||||
|
||||
parameters:
|
||||
is_official_build: False
|
||||
os: ''
|
||||
cuda: ''
|
||||
|
||||
steps:
|
||||
# Environment configuration steps for Ubuntu builds
|
||||
- ${{ if contains(parameters.os, 'ubuntu') }}:
|
||||
# Set configuration specific build flags
|
||||
- ${{ if eq(parameters.is_official_build, True) }}:
|
||||
- bash: |
|
||||
echo "##vso[task.setvariable variable=INSTALL_TEST;]0"
|
||||
echo "##vso[task.setvariable variable=PYTORCH_BUILD_NUMBER;]1"
|
||||
export PYTORCH_VERSION=$(head -c 5 ./version.txt)
|
||||
echo "##vso[task.setvariable variable=PYTORCH_BUILD_VERSION;]$PYTORCH_VERSION.dev"
|
||||
displayName: Set configuration-specific build flags
|
||||
|
||||
# Set PyTorch CPU/GPU build flags.
|
||||
- ${{ if contains(parameters.cuda, 'cpu') }}:
|
||||
- bash: |
|
||||
echo "##vso[task.setvariable variable=USE_CUDA;]0"
|
||||
echo "##vso[task.setvariable variable=PYTORCH_BUILD_VERSION;]$(PYTORCH_BUILD_VERSION).cpu"
|
||||
displayName: Set CUDA-specific build flag for CPU builds
|
||||
|
||||
- ${{ if contains(parameters.cuda, 'gpu') }}:
|
||||
- bash: |
|
||||
echo "##vso[task.setvariable variable=USE_CUDA;]1"
|
||||
echo "##vso[task.setvariable variable=PYTORCH_BUILD_VERSION;]$(PYTORCH_BUILD_VERSION).cu$(CUDA_VERSION)"
|
||||
displayName: Set CUDA-specific build flag for GPU builds
|
||||
|
||||
# Set MKL environment variables
|
||||
- bash: |
|
||||
echo "##vso[task.setvariable variable=CMAKE_LIBRARY_PATH;]/opt/intel/lib:$CMAKE_LIBRARY_PATH"
|
||||
echo "##vso[task.setvariable variable=CMAKE_INCLUDE_PATH;]/opt/intel/include:$CMAKE_INCLUDE_PATH"
|
||||
displayName: Set MKL paths
|
||||
|
||||
# View current environment variables
|
||||
- bash:
|
||||
printenv
|
||||
displayName: Show environment variables
|
||||
|
||||
# Environment configuration steps for Windows builds
|
||||
- ${{ if contains(parameters.os, 'windows') }}:
|
||||
# Set Conda Lib Path
|
||||
- powershell: Write-Host "##vso[task.setvariable variable=CONDA_LIB_PATH;]C:\Miniconda\envs\$(configuration)\Library\bin"
|
||||
displayName: Set Conda Lib Path
|
||||
|
||||
# Set configuration specific build flags
|
||||
- ${{ if eq(parameters.is_official_build, True) }}:
|
||||
- powershell: |
|
||||
Write-Host "##vso[task.setvariable variable=INSTALL_TEST;]0"
|
||||
Write-Host "##vso[task.setvariable variable=PYTORCH_BUILD_NUMBER;]1"
|
||||
Set-Variable -Name PYTORCH_VERSION -Value (Get-Content .\version.txt).Substring(0,5)
|
||||
Write-Host "##vso[task.setvariable variable=PYTORCH_BUILD_VERSION;]$PYTORCH_VERSION.dev"
|
||||
displayName: Set configuration-specific build flags
|
||||
|
||||
# Set PyTorch CPU/GPU build flags..
|
||||
- ${{ if contains(parameters.cuda, 'cpu') }}:
|
||||
- powershell: |
|
||||
Write-Host "##vso[task.setvariable variable=USE_CUDA;]0"
|
||||
Write-Host "##vso[task.setvariable variable=PYTORCH_BUILD_VERSION;]$(PYTORCH_BUILD_VERSION).cpu"
|
||||
displayName: Set CUDA-specific build flag for CPU build
|
||||
|
||||
- ${{ if contains(parameters.cuda, 'gpu') }}:
|
||||
- powershell: |
|
||||
Write-Host "##vso[task.setvariable variable=USE_CUDA;]1"
|
||||
Write-Host "##vso[task.setvariable variable=PYTORCH_BUILD_VERSION;]$(PYTORCH_BUILD_VERSION).cu$(CUDA_VERSION)"
|
||||
displayName: Set CUDA-specific build flag for GPU build
|
||||
|
||||
# Set CUDA 11.2, 10.2 or 10.1 specific build flags
|
||||
- ${{ if eq(parameters.cuda, 'gpu') }}:
|
||||
- powershell: |
|
||||
Write-Host "##vso[task.setvariable variable=TORCH_CUDA_ARCH_LIST;]3.7+PTX;5.0;6.0;6.1;7.0;7.5;8.0;8.6"
|
||||
Write-Host "##vso[task.setvariable variable=CUDA_PATH;]C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\"
|
||||
displayName: Set CUDA 11.2 specific build flags
|
||||
condition: eq(variables.CUDA_VERSION, '112')
|
||||
|
||||
- powershell: |
|
||||
Write-Host "##vso[task.setvariable variable=TORCH_CUDA_ARCH_LIST;]3.7+PTX;5.0;6.0;6.1;7.0;7.5"
|
||||
Write-Host "##vso[task.setvariable variable=CUDA_PATH;]C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\"
|
||||
displayName: Set CUDA 10.2 specific build flags
|
||||
condition: eq(variables.CUDA_VERSION, '102')
|
||||
|
||||
- powershell: |
|
||||
Write-Host "##vso[task.setvariable variable=TORCH_CUDA_ARCH_LIST;]3.7+PTX;5.0;6.0;6.1;7.0;7.5"
|
||||
Write-Host "##vso[task.setvariable variable=CUDA_PATH;]C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\"
|
||||
displayName: Set CUDA 10.1 specific build flags
|
||||
condition: eq(variables.CUDA_VERSION, '101')
|
||||
|
||||
- powershell: |
|
||||
Write-Host "##vso[task.setvariable variable=CUDA_BIN_PATH;]$env:CUDA_PATH\bin\"
|
||||
Write-Host "##vso[task.setvariable variable=CUDNN_ROOT;]$env:CUDA_PATH"
|
||||
Write-Host "##vso[task.setvariable variable=CUDNN_INCLUDE_DIR;]$env:CUDA_PATH\include\"
|
||||
Write-Host "##vso[task.setvariable variable=CUDNN_LIBRARY;]$env:CUDA_PATH\lib\x64\"
|
||||
Write-Host "##vso[task.prependpath]$env:CUDA_PATH\bin"
|
||||
Write-Host "##vso[task.setvariable variable=TORCH_NVCC_FLAGS;]-Xfatbin -compress-all --no-host-device-move-forward"
|
||||
Write-Host "##vso[task.setvariable variable=THRUST_IGNORE_CUB_VERSION_CHECK;]1"
|
||||
Write-Host "##vso[task.setvariable variable=NVTOOLSEXT_PATH;]C:\Program Files\NVIDIA Corporation\NvToolsExt\"
|
||||
displayName: Set CUDA environment variables
|
||||
|
||||
- powershell: |
|
||||
copy "$(CUDA_BIN_PATH)\cusparse*64_*.dll*" $(Build.SourcesDirectory)\torch\lib
|
||||
copy "$(CUDA_BIN_PATH)\cublas*64_*.dll*" $(Build.SourcesDirectory)\torch\lib
|
||||
copy "$(CUDA_BIN_PATH)\cudart*64_*.dll*" $(Build.SourcesDirectory)\torch\lib
|
||||
copy "$(CUDA_BIN_PATH)\curand*64_*.dll*" $(Build.SourcesDirectory)\torch\lib
|
||||
copy "$(CUDA_BIN_PATH)\cufft*64_*.dll*" $(Build.SourcesDirectory)\torch\lib
|
||||
copy "$(CUDA_BIN_PATH)\cusolver*64_*.dll*" $(Build.SourcesDirectory)\torch\lib
|
||||
copy "$(CUDA_BIN_PATH)\cudnn*64_*.dll*" $(Build.SourcesDirectory)\torch\lib
|
||||
copy "$(CUDA_BIN_PATH)\nvrtc*64_*.dll*" $(Build.SourcesDirectory)\torch\lib
|
||||
copy "C:\Program Files\NVIDIA Corporation\NvToolsExt\bin\x64\nvToolsExt64_1.dll*" $(Build.SourcesDirectory)\torch\lib
|
||||
copy "$(CONDA_LIB_PATH)\libiomp*5md.dll" $(Build.SourcesDirectory)\torch\lib
|
||||
copy "$(CONDA_LIB_PATH)\uv.dll" $(Build.SourcesDirectory)\torch\lib
|
||||
displayName: Copy CUDA/cuDNN/libomp/libuv dlls to torch\lib
|
||||
|
||||
# Set MKL, sccache and randomtemp environment variables
|
||||
- powershell: |
|
||||
Write-Host "##vso[task.setvariable variable=CMAKE_INCLUDE_PATH;]$(Build.SourcesDirectory)\mkl\include"
|
||||
Write-Host "##vso[task.setvariable variable=CMAKE_LIBRARY_PATH;]$(Build.SourcesDirectory)\mkl\lib;$env:CMAKE_LIBRARY_PATH"
|
||||
Write-Host "##vso[task.setvariable variable=ADDITIONAL_PATH;]$(Build.SourcesDirectory)\tmp_bin"
|
||||
Write-Host "##vso[task.setvariable variable=SCCACHE_IDLE_TIMEOUT;]1500"
|
||||
Write-Host "##vso[task.setvariable variable=CMAKE_CUDA_COMPILER_LAUNCHER;]$(Build.SourcesDirectory)/tmp_bin/randomtemp.exe;$(Build.SourcesDirectory)/tmp_bin/sccache.exe"
|
||||
displayName: Set MKL, sccache and randomtemp environment variables
|
||||
|
||||
# View current environment variables
|
||||
- script:
|
||||
set
|
||||
displayName: Show environment variables
|
||||
@ -1,14 +0,0 @@
|
||||
# Main logic to initiate wait for PR artifact to be ready
|
||||
|
||||
steps:
|
||||
- task: InvokeRESTAPI@1
|
||||
displayName: 'Wait for job success and wheel ready'
|
||||
timeoutInMinutes: 60
|
||||
inputs:
|
||||
connectionType: 'connectedServiceName'
|
||||
serviceConnection: circleciconn
|
||||
method: 'POST'
|
||||
headers: '{"Content-Type":"application/json", "BranchName":"$(_TARGET_BRANCH_TO_CHECK)", "JobName":"$(TARGET_CIRCLECI_BUILD_PR)", "PRNumber":"$(_TARGET_PR_NUMBER)", "TargetCommit":"$(_TARGET_COMMIT)", "PlanUrl":"$(System.CollectionUri)", "ProjectId":"$(System.TeamProjectId)", "HubName":"$(System.HostType)", "PlanId":"$(System.PlanId)", "JobId":"$(System.JobId)", "TimelineId":"$(System.TimelineId)", "TaskInstanceId":"$(System.TaskInstanceId)", "AuthToken":"$(System.AccessToken)"}'
|
||||
body: ''
|
||||
urlSuffix: 'api/JobStatus'
|
||||
waitForCompletion: true
|
||||
@ -1,92 +0,0 @@
|
||||
# Initiate 5 agentless-server waiting jobs to check on the
|
||||
# status of PR artifact builds, for a maximum wait time of
|
||||
# 11*60 min=660 mins. These jobs will pass immediately
|
||||
# once targeted CircleCI build is ready.
|
||||
|
||||
jobs:
|
||||
- job: checkjob1
|
||||
pool: server
|
||||
timeoutInMinutes: 60
|
||||
continueOnError: true
|
||||
steps:
|
||||
- template: wheel-wait-job-template.yml
|
||||
|
||||
- job: checkjob2
|
||||
pool: server
|
||||
timeoutInMinutes: 60
|
||||
dependsOn: checkjob1
|
||||
continueOnError: true
|
||||
steps:
|
||||
- template: wheel-wait-job-template.yml
|
||||
|
||||
- job: checkjob3
|
||||
pool: server
|
||||
timeoutInMinutes: 60
|
||||
dependsOn: checkjob2
|
||||
continueOnError: true
|
||||
steps:
|
||||
- template: wheel-wait-job-template.yml
|
||||
|
||||
- job: checkjob4
|
||||
pool: server
|
||||
timeoutInMinutes: 60
|
||||
dependsOn: checkjob3
|
||||
continueOnError: true
|
||||
steps:
|
||||
- template: wheel-wait-job-template.yml
|
||||
|
||||
- job: checkjob5
|
||||
pool: server
|
||||
timeoutInMinutes: 60
|
||||
dependsOn: checkjob4
|
||||
continueOnError: true
|
||||
steps:
|
||||
- template: wheel-wait-job-template.yml
|
||||
|
||||
- job: checkjob6
|
||||
pool: server
|
||||
timeoutInMinutes: 60
|
||||
dependsOn: checkjob5
|
||||
continueOnError: true
|
||||
steps:
|
||||
- template: wheel-wait-job-template.yml
|
||||
|
||||
- job: checkjob7
|
||||
pool: server
|
||||
timeoutInMinutes: 60
|
||||
dependsOn: checkjob6
|
||||
continueOnError: true
|
||||
steps:
|
||||
- template: wheel-wait-job-template.yml
|
||||
|
||||
- job: checkjob8
|
||||
pool: server
|
||||
timeoutInMinutes: 60
|
||||
dependsOn: checkjob7
|
||||
continueOnError: true
|
||||
steps:
|
||||
- template: wheel-wait-job-template.yml
|
||||
|
||||
- job: checkjob9
|
||||
pool: server
|
||||
timeoutInMinutes: 60
|
||||
dependsOn: checkjob8
|
||||
continueOnError: true
|
||||
steps:
|
||||
- template: wheel-wait-job-template.yml
|
||||
|
||||
- job: checkjob10
|
||||
pool: server
|
||||
timeoutInMinutes: 60
|
||||
dependsOn: checkjob9
|
||||
continueOnError: true
|
||||
steps:
|
||||
- template: wheel-wait-job-template.yml
|
||||
|
||||
- job: checkjob11
|
||||
pool: server
|
||||
timeoutInMinutes: 60
|
||||
dependsOn: checkjob10
|
||||
continueOnError: true
|
||||
steps:
|
||||
- template: wheel-wait-job-template.yml
|
||||
@ -1,60 +0,0 @@
|
||||
# PyTorch Nightly PyTorch Tests Builds Pipeline on Azure DevOps
|
||||
#
|
||||
# This pipeline runs custom PyTorch unit-tests on nightly
|
||||
# PyTorch wheels.
|
||||
|
||||
stages:
|
||||
- stage: 'NightlyCustomTests'
|
||||
displayName: 'Run custom unit tests on PyTorch wheels'
|
||||
jobs:
|
||||
- template: job_templates/pytorch-template-unix.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_CPU_docker
|
||||
pool: $(BUILD_POOL_LIN_1)
|
||||
customMatrixes:
|
||||
Nightly_Custom_Tests:
|
||||
_DOCKER_IMAGE: $(DOCKER_IMAGE_LIN_1)
|
||||
_PYTHON_VERSION: $(PYTHON_VERSION_LIN_1)
|
||||
_CUDA_BUILD_VERSION: $(CUDA_BUILD_VERSION_LIN_1)
|
||||
_RUN_TESTS: $(RUN_TESTS_LIN)
|
||||
|
||||
- template: job_templates/pytorch-template-unix.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_GPU_docker
|
||||
pool: $(BUILD_POOL_LIN_2)
|
||||
customMatrixes:
|
||||
Nightly_Custom_Tests:
|
||||
_DOCKER_IMAGE: $(DOCKER_IMAGE_LIN_2)
|
||||
_PYTHON_VERSION: $(PYTHON_VERSION_LIN_2)
|
||||
_CUDA_BUILD_VERSION: $(CUDA_BUILD_VERSION_LIN_2)
|
||||
_RUN_TESTS: $(RUN_TESTS_LIN)
|
||||
|
||||
- template: job_templates/pytorch-template-win.yml
|
||||
parameters:
|
||||
name: windows_2019_CPU
|
||||
pool: $(BUILD_POOL_WIN_1)
|
||||
customMatrixes:
|
||||
Nightly_Custom_Tests:
|
||||
_PYTHON_VERSION: $(PYTHON_VERSION_WIN_1)
|
||||
_CUDA_BUILD_VERSION: $(CUDA_BUILD_VERSION_WIN_1)
|
||||
_RUN_TESTS: $(RUN_TESTS_WIN)
|
||||
|
||||
- template: job_templates/pytorch-template-win.yml
|
||||
parameters:
|
||||
name: windows_2019_GPU
|
||||
pool: $(BUILD_POOL_WIN_2)
|
||||
customMatrixes:
|
||||
Nightly_Custom_Tests:
|
||||
_PYTHON_VERSION: $(PYTHON_VERSION_WIN_2)
|
||||
_CUDA_BUILD_VERSION: $(CUDA_BUILD_VERSION_WIN_2)
|
||||
_RUN_TESTS: $(RUN_TESTS_WIN)
|
||||
|
||||
- stage: 'NotifyWebapp'
|
||||
displayName: 'Notify Webapp that pipeline is finished'
|
||||
dependsOn: NightlyCustomTests
|
||||
condition: succeededOrFailed()
|
||||
jobs:
|
||||
- template: job_templates/notify-webapp-template.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_CPU
|
||||
pool: $(BUILD_POOL_LIN_1)
|
||||
@ -1,62 +0,0 @@
|
||||
# PyTorch PR PyTorch Tests Builds Pipeline on Azure DevOps
|
||||
#
|
||||
# This pipeline:
|
||||
# 1) ensures that CircleCI builds for a given PR
|
||||
# have finished, and that its artifacts are
|
||||
# ready for download
|
||||
# 2) runs custom PyTorch unit-tests on PyTorch
|
||||
# wheels generated during PR builds.
|
||||
|
||||
resources:
|
||||
webhooks:
|
||||
- webhook: GitHubPyTorchPRTrigger
|
||||
connection: GitHubPyTorchPRTriggerConnection
|
||||
filters:
|
||||
- path: repositoryName
|
||||
value: pytorch_tests
|
||||
|
||||
stages:
|
||||
- stage: 'EnsureArtifactsReady'
|
||||
displayName: 'Ensure PyTorch PR Artifacts are ready'
|
||||
jobs:
|
||||
- template: job_templates/wheel-wait-template.yml
|
||||
variables:
|
||||
_TARGET_BRANCH_TO_CHECK: ${{parameters.GitHubPyTorchPRTrigger.TARGET_BRANCH_TO_CHECK_AZ_DEVOPS_PR}}
|
||||
_TARGET_PR_NUMBER: ${{parameters.GitHubPyTorchPRTrigger.PR_NUMBER}}
|
||||
_TARGET_COMMIT: ${{parameters.GitHubPyTorchPRTrigger.TARGET_COMMIT}}
|
||||
|
||||
- stage: 'PRCustomTests'
|
||||
displayName: 'Run custom unit tests on PyTorch wheels'
|
||||
dependsOn: EnsureArtifactsReady
|
||||
condition: succeeded()
|
||||
jobs:
|
||||
- template: job_templates/pytorch-template-unix.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_GPU_docker
|
||||
pool: $(BUILD_POOL_PR)
|
||||
customMatrixes:
|
||||
PR_Custom_Tests:
|
||||
_PYTHON_VERSION: $(PYTHON_VERSION_PR)
|
||||
_CUDA_BUILD_VERSION: $(CUDA_BUILD_VERSION_PR)
|
||||
_TARGET_CIRCLECI_BUILD: $(TARGET_CIRCLECI_BUILD_PR)
|
||||
_TARGET_BRANCH_TO_CHECK: ${{parameters.GitHubPyTorchPRTrigger.TARGET_BRANCH_TO_CHECK_AZ_DEVOPS_PR}}
|
||||
_TARGET_PR_NUMBER: ${{parameters.GitHubPyTorchPRTrigger.PR_NUMBER}}
|
||||
_TARGET_COMMIT: ${{parameters.GitHubPyTorchPRTrigger.TARGET_COMMIT}}
|
||||
_DOCKER_IMAGE: $(DOCKER_IMAGE_PR)
|
||||
_RUN_TESTS: $(RUN_TESTS_PR)
|
||||
|
||||
- stage: 'NotifyWebapp'
|
||||
displayName: 'Notify Webapp that pipeline is finished'
|
||||
dependsOn: PRCustomTests
|
||||
condition: succeededOrFailed()
|
||||
jobs:
|
||||
- template: job_templates/notify-webapp-template.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_CPU
|
||||
pool: $(BUILD_POOL_LIN_1)
|
||||
customMatrixes:
|
||||
PR_Notify_WebApp:
|
||||
_TARGET_CIRCLECI_BUILD: $(TARGET_CIRCLECI_BUILD_PR)
|
||||
_TARGET_BRANCH_TO_CHECK: ${{parameters.GitHubPyTorchPRTrigger.TARGET_BRANCH_TO_CHECK_AZ_DEVOPS_PR}}
|
||||
_TARGET_PR_NUMBER: ${{parameters.GitHubPyTorchPRTrigger.PR_NUMBER}}
|
||||
_TARGET_COMMIT: ${{parameters.GitHubPyTorchPRTrigger.TARGET_COMMIT}}
|
||||
@ -1,224 +0,0 @@
|
||||
# PyTorch Official Builds Pipeline on Azure DevOps
|
||||
#
|
||||
# This pipeline:
|
||||
# 1) builds PyTorch on all available configurations
|
||||
# 2) verifies PyTorch artifacts by installing them in a clean environment
|
||||
# and checking torch.__version_
|
||||
# 3) publishes official PyTorch artifacts to Azure DevOps Artifacts for consumption
|
||||
|
||||
stages:
|
||||
- stage: 'Build'
|
||||
displayName: 'Build PyTorch'
|
||||
jobs:
|
||||
- template: job_templates/build-verify-publish-template-unix.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_CPU_docker
|
||||
pool: 'PyTorch-Linux-CPU'
|
||||
container_endpoint: pytorchms.azurecr.io
|
||||
build_stage: True
|
||||
is_official_build: True
|
||||
os: ubuntu
|
||||
cuda: cpu
|
||||
customMatrixes:
|
||||
Py_38:
|
||||
configuration: ubuntu_1804_py_38_cpu
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_38_cpu_dev
|
||||
Py_37:
|
||||
configuration: ubuntu_1804_py_37_cpu
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_37_cpu_dev
|
||||
|
||||
- template: job_templates/build-verify-publish-template-unix.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_GPU_docker
|
||||
pool: 'PyTorch-Linux-GPU'
|
||||
container_endpoint: pytorchms.azurecr.io
|
||||
build_stage: True
|
||||
is_official_build: True
|
||||
os: ubuntu
|
||||
cuda: gpu
|
||||
customMatrixes:
|
||||
Py_39_CUDA_112_cuDNN_810:
|
||||
configuration: ubuntu_1804_py_39_cuda_112_cudnn_810
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_39_cuda_112_cudnn_8_dev
|
||||
CUDA_VERSION: 112
|
||||
Py_38_CUDA_102_cuDNN_810:
|
||||
configuration: ubuntu_1804_py_38_cuda_102_cudnn_810
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_38_cuda_102_cudnn_8_dev
|
||||
CUDA_VERSION: 102
|
||||
Py_37_CUDA_101_cuDNN_765:
|
||||
configuration: ubuntu_1804_py_37_cuda_101_cudnn_765
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_37_cuda_101_cudnn_7_dev
|
||||
CUDA_VERSION: 101
|
||||
|
||||
- template: job_templates/build-verify-publish-template-win.yml
|
||||
parameters:
|
||||
name: windows_2019_CPU
|
||||
pool: 'PyTorch-Win-CPU'
|
||||
build_stage: True
|
||||
is_official_build: True
|
||||
os: windows
|
||||
cuda: cpu
|
||||
customMatrixes:
|
||||
Py_38:
|
||||
configuration: windows_2019_py_38_cpu
|
||||
Py_37:
|
||||
configuration: windows_2019_py_37_cpu
|
||||
|
||||
- template: job_templates/build-verify-publish-template-win.yml
|
||||
parameters:
|
||||
name: windows_2019_GPU
|
||||
pool: 'PyTorch-Win-GPU'
|
||||
build_stage: True
|
||||
is_official_build: True
|
||||
os: windows
|
||||
cuda: gpu
|
||||
customMatrixes:
|
||||
Py_39_CUDA_112_cuDNN_810:
|
||||
configuration: windows_2019_py_39_cuda_112_cudnn_810
|
||||
CUDA_VERSION: 112
|
||||
Py_38_CUDA_102_cuDNN_765:
|
||||
configuration: windows_2019_py_38_cuda_102_cudnn_765
|
||||
CUDA_VERSION: 102
|
||||
Py_37_CUDA_101_cuDNN_764:
|
||||
configuration: windows_2019_py_37_cuda_101_cudnn_764
|
||||
CUDA_VERSION: 101
|
||||
|
||||
- stage: 'Verify'
|
||||
displayName: 'Verify PyTorch wheels'
|
||||
dependsOn: Build
|
||||
condition: succeeded()
|
||||
jobs:
|
||||
- template: job_templates/build-verify-publish-template-unix.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_CPU_docker
|
||||
pool: 'PyTorch-Linux-CPU'
|
||||
container_endpoint: pytorchms.azurecr.io
|
||||
verify_stage: True
|
||||
is_official_build: True
|
||||
customMatrixes:
|
||||
Py_38:
|
||||
configuration: ubuntu_1804_py_38_cpu
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_38_cpu_dev
|
||||
Py_37:
|
||||
configuration: ubuntu_1804_py_37_cpu
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_37_cpu_dev
|
||||
|
||||
- template: job_templates/build-verify-publish-template-unix.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_GPU_docker
|
||||
pool: 'PyTorch-Linux-GPU'
|
||||
container_endpoint: pytorchms.azurecr.io
|
||||
verify_stage: True
|
||||
is_official_build: True
|
||||
customMatrixes:
|
||||
Py_39_CUDA_112_cuDNN_810:
|
||||
configuration: ubuntu_1804_py_39_cuda_112_cudnn_810
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_39_cuda_112_cudnn_8_dev
|
||||
CUDA_VERSION: 112
|
||||
Py_38_CUDA_102_cuDNN_810:
|
||||
configuration: ubuntu_1804_py_38_cuda_102_cudnn_810
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_38_cuda_102_cudnn_8_dev
|
||||
CUDA_VERSION: 102
|
||||
Py_37_CUDA_101_cuDNN_765:
|
||||
configuration: ubuntu_1804_py_37_cuda_101_cudnn_765
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_37_cuda_101_cudnn_7_dev
|
||||
CUDA_VERSION: 101
|
||||
|
||||
- template: job_templates/build-verify-publish-template-win.yml
|
||||
parameters:
|
||||
name: windows_2019_CPU
|
||||
pool: 'PyTorch-Win-CPU'
|
||||
verify_stage: True
|
||||
is_official_build: True
|
||||
customMatrixes:
|
||||
Py_38:
|
||||
configuration: windows_2019_py_38_cpu
|
||||
Py_37:
|
||||
configuration: windows_2019_py_37_cpu
|
||||
|
||||
- template: job_templates/build-verify-publish-template-win.yml
|
||||
parameters:
|
||||
name: windows_2019_GPU
|
||||
pool: 'PyTorch-Win-GPU'
|
||||
verify_stage: True
|
||||
is_official_build: True
|
||||
customMatrixes:
|
||||
Py_39_CUDA_112_cuDNN_810:
|
||||
configuration: windows_2019_py_39_cuda_112_cudnn_810
|
||||
CUDA_VERSION: 112
|
||||
Py_38_CUDA_102_cuDNN_765:
|
||||
configuration: windows_2019_py_38_cuda_102_cudnn_765
|
||||
CUDA_VERSION: 102
|
||||
Py_37_CUDA_101_cuDNN_764:
|
||||
configuration: windows_2019_py_37_cuda_101_cudnn_764
|
||||
CUDA_VERSION: 101
|
||||
|
||||
- stage: 'Publish'
|
||||
displayName: 'Publish PyTorch wheels'
|
||||
dependsOn: Verify
|
||||
condition: succeeded()
|
||||
jobs:
|
||||
- template: job_templates/build-verify-publish-template-unix.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_CPU_docker
|
||||
pool: 'PyTorch-Linux-CPU'
|
||||
container_endpoint: pytorchms.azurecr.io
|
||||
publish_stage: True
|
||||
is_official_build: True
|
||||
customMatrixes:
|
||||
Py_38:
|
||||
configuration: ubuntu_1804_py_38_cpu
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_38_cpu_dev
|
||||
Py_37:
|
||||
configuration: ubuntu_1804_py_37_cpu
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_37_cpu_dev
|
||||
|
||||
- template: job_templates/build-verify-publish-template-unix.yml
|
||||
parameters:
|
||||
name: ubuntu_1804_GPU_docker
|
||||
pool: 'PyTorch-Linux-GPU'
|
||||
container_endpoint: pytorchms.azurecr.io
|
||||
publish_stage: True
|
||||
is_official_build: True
|
||||
customMatrixes:
|
||||
Py_39_CUDA_112_cuDNN_810:
|
||||
configuration: ubuntu_1804_py_39_cuda_112_cudnn_810
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_39_cuda_112_cudnn_8_dev
|
||||
CUDA_VERSION: 112
|
||||
Py_38_CUDA_102_cuDNN_810:
|
||||
configuration: ubuntu_1804_py_38_cuda_102_cudnn_810
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_38_cuda_102_cudnn_8_dev
|
||||
CUDA_VERSION: 102
|
||||
Py_37_CUDA_101_cuDNN_765:
|
||||
configuration: ubuntu_1804_py_37_cuda_101_cudnn_765
|
||||
container_image: pytorchms.azurecr.io/ubuntu_1804_py_37_cuda_101_cudnn_7_dev
|
||||
CUDA_VERSION: 101
|
||||
|
||||
- template: job_templates/build-verify-publish-template-win.yml
|
||||
parameters:
|
||||
name: windows_2019_CPU
|
||||
pool: 'PyTorch-Win-CPU'
|
||||
publish_stage: True
|
||||
is_official_build: True
|
||||
customMatrixes:
|
||||
Py_38:
|
||||
configuration: windows_2019_py_38_cpu
|
||||
Py_37:
|
||||
configuration: windows_2019_py_37_cpu
|
||||
|
||||
- template: job_templates/build-verify-publish-template-win.yml
|
||||
parameters:
|
||||
name: windows_2019_GPU
|
||||
pool: 'PyTorch-Win-GPU'
|
||||
publish_stage: True
|
||||
is_official_build: True
|
||||
customMatrixes:
|
||||
Py_39_CUDA_112_cuDNN_810:
|
||||
configuration: windows_2019_py_39_cuda_112_cudnn_810
|
||||
CUDA_VERSION: 112
|
||||
Py_38_CUDA_102_cuDNN_765:
|
||||
configuration: windows_2019_py_38_cuda_102_cudnn_765
|
||||
CUDA_VERSION: 102
|
||||
Py_37_CUDA_101_cuDNN_764:
|
||||
configuration: windows_2019_py_37_cuda_101_cudnn_764
|
||||
CUDA_VERSION: 101
|
||||
16
.bazelrc
16
.bazelrc
@ -1,19 +1,3 @@
|
||||
build --copt=--std=c++14
|
||||
build --copt=-I.
|
||||
build --copt=-isystem --copt bazel-out/k8-fastbuild/bin
|
||||
build --experimental_ui_max_stdouterr_bytes=2048576
|
||||
|
||||
# Configuration to disable tty features for environments like CI
|
||||
build:no-tty --curses no
|
||||
build:no-tty --progress_report_interval 10
|
||||
build:no-tty --show_progress_rate_limit 10
|
||||
|
||||
# Configuration to build with GPU support
|
||||
build:gpu --define=cuda=true
|
||||
# define a separate build folder for faster switching between configs
|
||||
build:gpu --platform_suffix=-gpu
|
||||
# rules_cuda configuration
|
||||
build:gpu --@rules_cuda//cuda:enable_cuda
|
||||
build:gpu --@rules_cuda//cuda:cuda_targets=sm_52
|
||||
build:gpu --@rules_cuda//cuda:compiler=nvcc
|
||||
build:gpu --repo_env=CUDA_PATH=/usr/local/cuda
|
||||
|
||||
@ -1 +1 @@
|
||||
4.2.1
|
||||
3.1.0
|
||||
|
||||
@ -31,7 +31,7 @@ Usage
|
||||
1. Make changes to these scripts.
|
||||
2. Run the `regenerate.sh` script in this directory and commit the script changes and the resulting change to `config.yml`.
|
||||
|
||||
You'll see a build failure on GitHub if the scripts don't agree with the checked-in version.
|
||||
You'll see a build failure on TravisCI if the scripts don't agree with the checked-in version.
|
||||
|
||||
|
||||
Motivation
|
||||
@ -55,7 +55,7 @@ Future direction
|
||||
See comment [here](https://github.com/pytorch/pytorch/pull/17323#pullrequestreview-206945747):
|
||||
|
||||
In contrast with a full recursive tree traversal of configuration dimensions,
|
||||
> in the future I think we actually want to decrease our matrix somewhat and have only a few mostly-orthogonal builds that taste as many different features as possible on PRs, plus a more complete suite on every PR and maybe an almost full suite nightly/weekly (we don't have this yet). Specifying PR jobs in the future might be easier to read with an explicit list when we come to this.
|
||||
> in the future future I think we actually want to decrease our matrix somewhat and have only a few mostly-orthogonal builds that taste as many different features as possible on PRs, plus a more complete suite on every PR and maybe an almost full suite nightly/weekly (we don't have this yet). Specifying PR jobs in the future might be easier to read with an explicit list when we come to this.
|
||||
|
||||
----------------
|
||||
----------------
|
||||
@ -90,7 +90,7 @@ The binaries are built in CircleCI. There are nightly binaries built every night
|
||||
|
||||
We have 3 types of binary packages
|
||||
|
||||
* pip packages - nightlies are stored on s3 (pip install -f \<a s3 url\>). releases are stored in a pip repo (pip install torch) (ask Soumith about this)
|
||||
* pip packages - nightlies are stored on s3 (pip install -f <a s3 url>). releases are stored in a pip repo (pip install torch) (ask Soumith about this)
|
||||
* conda packages - nightlies and releases are both stored in a conda repo. Nighty packages have a '_nightly' suffix
|
||||
* libtorch packages - these are zips of all the c++ libraries, header files, and sometimes dependencies. These are c++ only
|
||||
* shared with dependencies (the only supported option for Windows)
|
||||
@ -104,16 +104,16 @@ All binaries are built in CircleCI workflows except Windows. There are checked-i
|
||||
|
||||
Some quick vocab:
|
||||
|
||||
* A \**workflow** is a CircleCI concept; it is a DAG of '**jobs**'. ctrl-f 'workflows' on https://github.com/pytorch/pytorch/blob/master/.circleci/config.yml to see the workflows.
|
||||
* A\**workflow** is a CircleCI concept; it is a DAG of '**jobs**'. ctrl-f 'workflows' on\https://github.com/pytorch/pytorch/blob/master/.circleci/config.yml to see the workflows.
|
||||
* **jobs** are a sequence of '**steps**'
|
||||
* **steps** are usually just a bash script or a builtin CircleCI command. *All steps run in new environments, environment variables declared in one script DO NOT persist to following steps*
|
||||
* **steps** are usually just a bash script or a builtin CircleCI command.* All steps run in new environments, environment variables declared in one script DO NOT persist to following steps*
|
||||
* CircleCI has a **workspace**, which is essentially a cache between steps of the *same job* in which you can store artifacts between steps.
|
||||
|
||||
## How are the workflows structured?
|
||||
|
||||
The nightly binaries have 3 workflows. We have one job (actually 3 jobs: build, test, and upload) per binary configuration
|
||||
|
||||
1. binary_builds
|
||||
1. binarybuilds
|
||||
1. every day midnight EST
|
||||
2. linux: https://github.com/pytorch/pytorch/blob/master/.circleci/verbatim-sources/linux-binary-build-defaults.yml
|
||||
3. macos: https://github.com/pytorch/pytorch/blob/master/.circleci/verbatim-sources/macos-binary-build-defaults.yml
|
||||
@ -144,7 +144,7 @@ The nightly binaries have 3 workflows. We have one job (actually 3 jobs: build,
|
||||
|
||||
## How are the jobs structured?
|
||||
|
||||
The jobs are in https://github.com/pytorch/pytorch/tree/master/.circleci/verbatim-sources. Jobs are made of multiple steps. There are some shared steps used by all the binaries/smokes. Steps of these jobs are all delegated to scripts in https://github.com/pytorch/pytorch/tree/master/.circleci/scripts .
|
||||
The jobs are in https://github.com/pytorch/pytorch/tree/master/.circleci/verbatim-sources . Jobs are made of multiple steps. There are some shared steps used by all the binaries/smokes. Steps of these jobs are all delegated to scripts in https://github.com/pytorch/pytorch/tree/master/.circleci/scripts .
|
||||
|
||||
* Linux jobs: https://github.com/pytorch/pytorch/blob/master/.circleci/verbatim-sources/linux-binary-build-defaults.yml
|
||||
* binary_linux_build.sh
|
||||
@ -204,7 +204,7 @@ TODO: fill in stuff
|
||||
|
||||
## Overview
|
||||
|
||||
The code that runs the binaries lives in two places, in the normal [github.com/pytorch/pytorch](http://github.com/pytorch/pytorch), but also in [github.com/pytorch/builder](http://github.com/pytorch/builder), which is a repo that defines how all the binaries are built. The relevant code is
|
||||
The code that runs the binaries lives in two places, in the normal [github.com/pytorch/pytorch](http://github.com/pytorch/pytorch), but also in [github.com/pytorch/builder](http://github.com/pytorch/builder) , which is a repo that defines how all the binaries are built. The relevant code is
|
||||
|
||||
|
||||
```
|
||||
@ -260,7 +260,7 @@ Linux, MacOS and Windows use the same code flow for the conda builds.
|
||||
Conda packages are built with conda-build, see https://conda.io/projects/conda-build/en/latest/resources/commands/conda-build.html
|
||||
|
||||
Basically, you pass `conda build` a build folder (pytorch-nightly/ above) that contains a build script and a meta.yaml. The meta.yaml specifies in what python environment to build the package in, and what dependencies the resulting package should have, and the build script gets called in the env to build the thing.
|
||||
tl;dr on conda-build is
|
||||
tldr; on conda-build is
|
||||
|
||||
1. Creates a brand new conda environment, based off of deps in the meta.yaml
|
||||
1. Note that environment variables do not get passed into this build env unless they are specified in the meta.yaml
|
||||
@ -270,7 +270,7 @@ tl;dr on conda-build is
|
||||
4. Runs some simple import tests (if specified in the meta.yaml)
|
||||
5. Saves the finished package as a tarball
|
||||
|
||||
The build.sh we use is essentially a wrapper around `python setup.py build`, but it also manually copies in some of our dependent libraries into the resulting tarball and messes with some rpaths.
|
||||
The build.sh we use is essentially a wrapper around ```python setup.py build``` , but it also manually copies in some of our dependent libraries into the resulting tarball and messes with some rpaths.
|
||||
|
||||
The entrypoint file `builder/conda/build_conda.sh` is complicated because
|
||||
|
||||
@ -343,6 +343,7 @@ All linux builds occur in docker images. The docker images are
|
||||
* Has ALL CUDA versions installed. The script pytorch/builder/conda/switch_cuda_version.sh sets /usr/local/cuda to a symlink to e.g. /usr/local/cuda-10.0 to enable different CUDA builds
|
||||
* Also used for cpu builds
|
||||
* pytorch/manylinux-cuda90
|
||||
* pytorch/manylinux-cuda92
|
||||
* pytorch/manylinux-cuda100
|
||||
* Also used for cpu builds
|
||||
|
||||
@ -354,15 +355,15 @@ The Dockerfiles are available in pytorch/builder, but there is no circleci job o
|
||||
|
||||
# How to manually rebuild the binaries
|
||||
|
||||
tl;dr make a PR that looks like https://github.com/pytorch/pytorch/pull/21159
|
||||
tldr; make a PR that looks like https://github.com/pytorch/pytorch/pull/21159
|
||||
|
||||
Sometimes we want to push a change to master and then rebuild all of today's binaries after that change. As of May 30, 2019 there isn't a way to manually run a workflow in the UI. You can manually re-run a workflow, but it will use the exact same git commits as the first run and will not include any changes. So we have to make a PR and then force circleci to run the binary workflow instead of the normal tests. The above PR is an example of how to do this; essentially you copy-paste the binarybuilds workflow steps into the default workflow steps. If you need to point the builder repo to a different commit then you'd need to change https://github.com/pytorch/pytorch/blob/master/.circleci/scripts/binary_checkout.sh#L42-L45 to checkout what you want.
|
||||
|
||||
## How to test changes to the binaries via .circleci
|
||||
|
||||
Writing PRs that test the binaries is annoying, since the default circleci jobs that run on PRs are not the jobs that you want to run. Likely, changes to the binaries will touch something under .circleci/ and require that .circleci/config.yml be regenerated (.circleci/config.yml controls all .circleci behavior, and is generated using `.circleci/regenerate.sh` in python 3.7). But you also need to manually hardcode the binary jobs that you want to test into the .circleci/config.yml workflow, so you should actually make at least two commits, one for your changes and one to temporarily hardcode jobs. See https://github.com/pytorch/pytorch/pull/22928 as an example of how to do this.
|
||||
Writing PRs that test the binaries is annoying, since the default circleci jobs that run on PRs are not the jobs that you want to run. Likely, changes to the binaries will touch something under .circleci/ and require that .circleci/config.yml be regenerated (.circleci/config.yml controls all .circleci behavior, and is generated using ```.circleci/regenerate.sh``` in python 3.7). But you also need to manually hardcode the binary jobs that you want to test into the .circleci/config.yml workflow, so you should actually make at least two commits, one for your changes and one to temporarily hardcode jobs. See https://github.com/pytorch/pytorch/pull/22928 as an example of how to do this.
|
||||
|
||||
```sh
|
||||
```
|
||||
# Make your changes
|
||||
touch .circleci/verbatim-sources/nightly-binary-build-defaults.yml
|
||||
|
||||
@ -407,7 +408,7 @@ The advantage of this flow is that you can make new changes to the base commit a
|
||||
|
||||
You can build Linux binaries locally easily using docker.
|
||||
|
||||
```sh
|
||||
```
|
||||
# Run the docker
|
||||
# Use the correct docker image, pytorch/conda-cuda used here as an example
|
||||
#
|
||||
@ -450,7 +451,7 @@ There’s no easy way to generate reproducible hermetic MacOS environments. If y
|
||||
|
||||
But if you want to try, then I’d recommend
|
||||
|
||||
```sh
|
||||
```
|
||||
# Create a new terminal
|
||||
# Clear your LD_LIBRARY_PATH and trim as much out of your PATH as you
|
||||
# know how to do
|
||||
|
||||
@ -30,7 +30,21 @@ def get_processor_arch_name(gpu_version):
|
||||
"cu" + gpu_version.strip("cuda") if gpu_version.startswith("cuda") else gpu_version
|
||||
)
|
||||
|
||||
LINUX_PACKAGE_VARIANTS = OrderedDict(
|
||||
manywheel=[
|
||||
"3.6m",
|
||||
"3.7m",
|
||||
"3.8m",
|
||||
"3.9m"
|
||||
],
|
||||
conda=dimensions.STANDARD_PYTHON_VERSIONS,
|
||||
libtorch=[
|
||||
"3.7m",
|
||||
],
|
||||
)
|
||||
|
||||
CONFIG_TREE_DATA = OrderedDict(
|
||||
linux=(dimensions.GPU_VERSIONS, LINUX_PACKAGE_VARIANTS),
|
||||
macos=([None], OrderedDict(
|
||||
wheel=dimensions.STANDARD_PYTHON_VERSIONS,
|
||||
conda=dimensions.STANDARD_PYTHON_VERSIONS,
|
||||
@ -38,19 +52,9 @@ CONFIG_TREE_DATA = OrderedDict(
|
||||
"3.7",
|
||||
],
|
||||
)),
|
||||
macos_arm64=([None], OrderedDict(
|
||||
wheel=[
|
||||
"3.8",
|
||||
"3.9",
|
||||
],
|
||||
conda=[
|
||||
"3.8",
|
||||
"3.9",
|
||||
],
|
||||
)),
|
||||
# Skip CUDA-9.2 builds on Windows
|
||||
windows=(
|
||||
# Stop building Win+CU102, see https://github.com/pytorch/pytorch/issues/65648
|
||||
[v for v in dimensions.GPU_VERSIONS if v not in dimensions.ROCM_VERSION_LABELS and v != "cuda102"],
|
||||
[v for v in dimensions.GPU_VERSIONS if v not in ['cuda92'] + dimensions.ROCM_VERSION_LABELS],
|
||||
OrderedDict(
|
||||
wheel=dimensions.STANDARD_PYTHON_VERSIONS,
|
||||
conda=dimensions.STANDARD_PYTHON_VERSIONS,
|
||||
@ -113,7 +117,6 @@ class PackageFormatConfigNode(ConfigNode):
|
||||
self.props["python_versions"] = python_versions
|
||||
self.props["package_format"] = package_format
|
||||
|
||||
|
||||
def get_children(self):
|
||||
if self.find_prop("os_name") == "linux":
|
||||
return [LinuxGccConfigNode(self, v) for v in LINUX_GCC_CONFIG_VARIANTS[self.find_prop("package_format")]]
|
||||
|
||||
@ -27,19 +27,7 @@ class Conf(object):
|
||||
|
||||
def gen_docker_image(self):
|
||||
if self.gcc_config_variant == 'gcc5.4_cxx11-abi':
|
||||
if self.gpu_version is None:
|
||||
return miniutils.quote("pytorch/libtorch-cxx11-builder:cpu")
|
||||
else:
|
||||
return miniutils.quote(
|
||||
f"pytorch/libtorch-cxx11-builder:{self.gpu_version}"
|
||||
)
|
||||
if self.pydistro == "conda":
|
||||
if self.gpu_version is None:
|
||||
return miniutils.quote("pytorch/conda-builder:cpu")
|
||||
else:
|
||||
return miniutils.quote(
|
||||
f"pytorch/conda-builder:{self.gpu_version}"
|
||||
)
|
||||
return miniutils.quote("pytorch/pytorch-binary-docker-image-ubuntu16.04:latest")
|
||||
|
||||
docker_word_substitution = {
|
||||
"manywheel": "manylinux",
|
||||
@ -124,9 +112,9 @@ class Conf(object):
|
||||
Output looks similar to:
|
||||
|
||||
- binary_upload:
|
||||
name: binary_linux_manywheel_3_7m_cu113_devtoolset7_nightly_upload
|
||||
name: binary_linux_manywheel_3_7m_cu92_devtoolset7_nightly_upload
|
||||
context: org-member
|
||||
requires: binary_linux_manywheel_3_7m_cu113_devtoolset7_nightly_test
|
||||
requires: binary_linux_manywheel_3_7m_cu92_devtoolset7_nightly_test
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
@ -134,7 +122,7 @@ class Conf(object):
|
||||
tags:
|
||||
only: /v[0-9]+(\\.[0-9]+)*-rc[0-9]+/
|
||||
package_type: manywheel
|
||||
upload_subfolder: cu113
|
||||
upload_subfolder: cu92
|
||||
"""
|
||||
return {
|
||||
"binary_upload": OrderedDict({
|
||||
@ -176,7 +164,7 @@ def gen_build_env_list(smoke):
|
||||
c.find_prop("gpu"),
|
||||
c.find_prop("package_format"),
|
||||
[c.find_prop("pyver")],
|
||||
c.find_prop("smoke") and not (c.find_prop("os_name") == "macos_arm64"), # don't test arm64
|
||||
c.find_prop("smoke"),
|
||||
c.find_prop("libtorch_variant"),
|
||||
c.find_prop("gcc_config_variant"),
|
||||
c.find_prop("libtorch_config_variant"),
|
||||
@ -228,9 +216,7 @@ def get_jobs(toplevel_key, smoke):
|
||||
configs = gen_build_env_list(smoke)
|
||||
phase = "build" if toplevel_key == "binarybuilds" else "test"
|
||||
for build_config in configs:
|
||||
# don't test for macos_arm64 as it's cross compiled
|
||||
if phase != "test" or build_config.os != "macos_arm64":
|
||||
jobs_list.append(build_config.gen_workflow_job(phase, nightly=True))
|
||||
jobs_list.append(build_config.gen_workflow_job(phase, nightly=True))
|
||||
|
||||
return jobs_list
|
||||
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
PHASES = ["build", "test"]
|
||||
|
||||
CUDA_VERSIONS = [
|
||||
"92",
|
||||
"101",
|
||||
"102",
|
||||
"111",
|
||||
"113",
|
||||
"115",
|
||||
"110",
|
||||
]
|
||||
|
||||
ROCM_VERSIONS = [
|
||||
"4.3.1",
|
||||
"4.5.2",
|
||||
"3.7",
|
||||
"3.8",
|
||||
]
|
||||
|
||||
ROCM_VERSION_LABELS = ["rocm" + v for v in ROCM_VERSIONS]
|
||||
@ -17,8 +17,8 @@ ROCM_VERSION_LABELS = ["rocm" + v for v in ROCM_VERSIONS]
|
||||
GPU_VERSIONS = [None] + ["cuda" + v for v in CUDA_VERSIONS] + ROCM_VERSION_LABELS
|
||||
|
||||
STANDARD_PYTHON_VERSIONS = [
|
||||
"3.6",
|
||||
"3.7",
|
||||
"3.8",
|
||||
"3.9",
|
||||
"3.10"
|
||||
"3.9"
|
||||
]
|
||||
|
||||
@ -1,7 +1,89 @@
|
||||
from cimodel.lib.conf_tree import ConfigNode
|
||||
from cimodel.lib.conf_tree import ConfigNode, X, XImportant
|
||||
|
||||
|
||||
CONFIG_TREE_DATA = [
|
||||
("xenial", [
|
||||
("gcc", [
|
||||
("5.4", [ # All this subtree rebases to master and then build
|
||||
("3.6", [
|
||||
("important", [X(True)]),
|
||||
("parallel_tbb", [X(True)]),
|
||||
("parallel_native", [X(True)]),
|
||||
("pure_torch", [X(True)]),
|
||||
]),
|
||||
]),
|
||||
# TODO: bring back libtorch test
|
||||
("7", [X("3.6")]),
|
||||
]),
|
||||
("clang", [
|
||||
("5", [
|
||||
("3.6", [
|
||||
("asan", [XImportant(True)]),
|
||||
]),
|
||||
]),
|
||||
("7", [
|
||||
("3.6", [
|
||||
("onnx", [XImportant(True)]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
("cuda", [
|
||||
("9.2", [
|
||||
("3.6", [
|
||||
X(True),
|
||||
("cuda_gcc_override", [
|
||||
("gcc5.4", [
|
||||
('build_only', [XImportant(True)]),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
]),
|
||||
("10.1", [
|
||||
("3.6", [
|
||||
('build_only', [X(True)]),
|
||||
]),
|
||||
]),
|
||||
("10.2", [
|
||||
("3.6", [
|
||||
("important", [X(True)]),
|
||||
("libtorch", [X(True)]),
|
||||
]),
|
||||
]),
|
||||
("11.0", [
|
||||
("3.8", [
|
||||
X(True),
|
||||
("libtorch", [XImportant(True)])
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
("bionic", [
|
||||
("clang", [
|
||||
("9", [
|
||||
XImportant("3.6"),
|
||||
]),
|
||||
("9", [
|
||||
("3.6", [
|
||||
("xla", [XImportant(True)]),
|
||||
("vulkan", [XImportant(True)]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
("gcc", [
|
||||
("9", [
|
||||
("3.8", [
|
||||
("coverage", [XImportant(True)]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
("rocm", [
|
||||
("3.7", [
|
||||
("3.6", [
|
||||
('build_only', [XImportant(True)]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]
|
||||
|
||||
|
||||
@ -53,8 +135,6 @@ class PyVerConfigNode(TreeConfigNode):
|
||||
def init2(self, node_name):
|
||||
self.props["pyver"] = node_name
|
||||
self.props["abbreviated_pyver"] = get_major_pyver(node_name)
|
||||
if node_name == "3.9":
|
||||
self.props["abbreviated_pyver"] = "py3.9"
|
||||
|
||||
# noinspection PyMethodMayBeStatic
|
||||
def child_constructor(self):
|
||||
@ -71,30 +151,20 @@ class ExperimentalFeatureConfigNode(TreeConfigNode):
|
||||
next_nodes = {
|
||||
"asan": AsanConfigNode,
|
||||
"xla": XlaConfigNode,
|
||||
"mlc": MLCConfigNode,
|
||||
"vulkan": VulkanConfigNode,
|
||||
"parallel_tbb": ParallelTBBConfigNode,
|
||||
"noarch": NoarchConfigNode,
|
||||
"parallel_native": ParallelNativeConfigNode,
|
||||
"onnx": ONNXConfigNode,
|
||||
"libtorch": LibTorchConfigNode,
|
||||
"important": ImportantConfigNode,
|
||||
"build_only": BuildOnlyConfigNode,
|
||||
"shard_test": ShardTestConfigNode,
|
||||
"cuda_gcc_override": CudaGccOverrideConfigNode,
|
||||
"coverage": CoverageConfigNode,
|
||||
"pure_torch": PureTorchConfigNode,
|
||||
"slow_gradcheck": SlowGradcheckConfigNode,
|
||||
}
|
||||
return next_nodes[experimental_feature]
|
||||
|
||||
|
||||
class SlowGradcheckConfigNode(TreeConfigNode):
|
||||
def init2(self, node_name):
|
||||
self.props["is_slow_gradcheck"] = True
|
||||
|
||||
def child_constructor(self):
|
||||
return ExperimentalFeatureConfigNode
|
||||
|
||||
class PureTorchConfigNode(TreeConfigNode):
|
||||
def modify_label(self, label):
|
||||
return "PURE_TORCH=" + str(label)
|
||||
@ -116,16 +186,6 @@ class XlaConfigNode(TreeConfigNode):
|
||||
def child_constructor(self):
|
||||
return ImportantConfigNode
|
||||
|
||||
class MLCConfigNode(TreeConfigNode):
|
||||
def modify_label(self, label):
|
||||
return "MLC=" + str(label)
|
||||
|
||||
def init2(self, node_name):
|
||||
self.props["is_mlc"] = node_name
|
||||
|
||||
def child_constructor(self):
|
||||
return ImportantConfigNode
|
||||
|
||||
|
||||
class AsanConfigNode(TreeConfigNode):
|
||||
def modify_label(self, label):
|
||||
@ -135,7 +195,7 @@ class AsanConfigNode(TreeConfigNode):
|
||||
self.props["is_asan"] = node_name
|
||||
|
||||
def child_constructor(self):
|
||||
return ExperimentalFeatureConfigNode
|
||||
return ImportantConfigNode
|
||||
|
||||
|
||||
class ONNXConfigNode(TreeConfigNode):
|
||||
@ -171,14 +231,6 @@ class ParallelTBBConfigNode(TreeConfigNode):
|
||||
return ImportantConfigNode
|
||||
|
||||
|
||||
class NoarchConfigNode(TreeConfigNode):
|
||||
def init2(self, node_name):
|
||||
self.props["is_noarch"] = node_name
|
||||
|
||||
def child_constructor(self):
|
||||
return ImportantConfigNode
|
||||
|
||||
|
||||
class ParallelNativeConfigNode(TreeConfigNode):
|
||||
def modify_label(self, label):
|
||||
return "PARALLELNATIVE=" + str(label)
|
||||
@ -198,7 +250,7 @@ class LibTorchConfigNode(TreeConfigNode):
|
||||
self.props["is_libtorch"] = node_name
|
||||
|
||||
def child_constructor(self):
|
||||
return ExperimentalFeatureConfigNode
|
||||
return ImportantConfigNode
|
||||
|
||||
|
||||
class CudaGccOverrideConfigNode(TreeConfigNode):
|
||||
@ -208,8 +260,8 @@ class CudaGccOverrideConfigNode(TreeConfigNode):
|
||||
def child_constructor(self):
|
||||
return ExperimentalFeatureConfigNode
|
||||
|
||||
|
||||
class BuildOnlyConfigNode(TreeConfigNode):
|
||||
|
||||
def init2(self, node_name):
|
||||
self.props["build_only"] = node_name
|
||||
|
||||
@ -217,12 +269,13 @@ class BuildOnlyConfigNode(TreeConfigNode):
|
||||
return ExperimentalFeatureConfigNode
|
||||
|
||||
|
||||
class ShardTestConfigNode(TreeConfigNode):
|
||||
class CoverageConfigNode(TreeConfigNode):
|
||||
|
||||
def init2(self, node_name):
|
||||
self.props["shard_test"] = node_name
|
||||
self.props["is_coverage"] = node_name
|
||||
|
||||
def child_constructor(self):
|
||||
return ImportantConfigNode
|
||||
return ExperimentalFeatureConfigNode
|
||||
|
||||
|
||||
class ImportantConfigNode(TreeConfigNode):
|
||||
@ -237,6 +290,7 @@ class ImportantConfigNode(TreeConfigNode):
|
||||
|
||||
|
||||
class XenialCompilerConfigNode(TreeConfigNode):
|
||||
|
||||
def modify_label(self, label):
|
||||
return label or "<unspecified>"
|
||||
|
||||
@ -250,6 +304,7 @@ class XenialCompilerConfigNode(TreeConfigNode):
|
||||
|
||||
|
||||
class BionicCompilerConfigNode(TreeConfigNode):
|
||||
|
||||
def modify_label(self, label):
|
||||
return label or "<unspecified>"
|
||||
|
||||
|
||||
@ -31,7 +31,6 @@ class Conf:
|
||||
is_libtorch: bool = False
|
||||
is_important: bool = False
|
||||
parallel_backend: Optional[str] = None
|
||||
build_only: bool = False
|
||||
|
||||
@staticmethod
|
||||
def is_test_phase(phase):
|
||||
@ -113,8 +112,6 @@ class Conf:
|
||||
parameters["resource_class"] = "xlarge"
|
||||
if hasattr(self, 'filters'):
|
||||
parameters['filters'] = self.filters
|
||||
if self.build_only:
|
||||
parameters['build_only'] = miniutils.quote(str(int(True)))
|
||||
return parameters
|
||||
|
||||
def gen_workflow_job(self, phase):
|
||||
@ -178,6 +175,35 @@ class DocPushConf(object):
|
||||
}
|
||||
}
|
||||
|
||||
# TODO Convert these to graph nodes
|
||||
def gen_dependent_configs(xenial_parent_config):
|
||||
|
||||
extra_parms = [
|
||||
(["multigpu"], "large"),
|
||||
(["nogpu", "NO_AVX2"], None),
|
||||
(["nogpu", "NO_AVX"], None),
|
||||
(["slow"], "medium"),
|
||||
]
|
||||
|
||||
configs = []
|
||||
for parms, gpu in extra_parms:
|
||||
|
||||
c = Conf(
|
||||
xenial_parent_config.distro,
|
||||
["py3"] + parms,
|
||||
pyver=xenial_parent_config.pyver,
|
||||
cuda_version=xenial_parent_config.cuda_version,
|
||||
restrict_phases=["test"],
|
||||
gpu_resource=gpu,
|
||||
parent_build=xenial_parent_config,
|
||||
is_important=False,
|
||||
)
|
||||
|
||||
configs.append(c)
|
||||
|
||||
return configs
|
||||
|
||||
|
||||
def gen_docs_configs(xenial_parent_config):
|
||||
configs = []
|
||||
|
||||
@ -185,7 +211,7 @@ def gen_docs_configs(xenial_parent_config):
|
||||
HiddenConf(
|
||||
"pytorch_python_doc_build",
|
||||
parent_build=xenial_parent_config,
|
||||
filters=gen_filter_dict(branches_list=["master", "nightly"],
|
||||
filters=gen_filter_dict(branches_list=r"/.*/",
|
||||
tags_list=RC_PATTERN),
|
||||
)
|
||||
)
|
||||
@ -201,7 +227,7 @@ def gen_docs_configs(xenial_parent_config):
|
||||
HiddenConf(
|
||||
"pytorch_cpp_doc_build",
|
||||
parent_build=xenial_parent_config,
|
||||
filters=gen_filter_dict(branches_list=["master", "nightly"],
|
||||
filters=gen_filter_dict(branches_list=r"/.*/",
|
||||
tags_list=RC_PATTERN),
|
||||
)
|
||||
)
|
||||
@ -212,6 +238,13 @@ def gen_docs_configs(xenial_parent_config):
|
||||
branch="master",
|
||||
)
|
||||
)
|
||||
|
||||
configs.append(
|
||||
HiddenConf(
|
||||
"pytorch_doc_test",
|
||||
parent_build=xenial_parent_config
|
||||
)
|
||||
)
|
||||
return configs
|
||||
|
||||
|
||||
@ -225,7 +258,7 @@ def gen_tree():
|
||||
return configs_list
|
||||
|
||||
|
||||
def instantiate_configs(only_slow_gradcheck):
|
||||
def instantiate_configs():
|
||||
|
||||
config_list = []
|
||||
|
||||
@ -239,16 +272,11 @@ def instantiate_configs(only_slow_gradcheck):
|
||||
compiler_version = fc.find_prop("compiler_version")
|
||||
is_xla = fc.find_prop("is_xla") or False
|
||||
is_asan = fc.find_prop("is_asan") or False
|
||||
is_noarch = fc.find_prop("is_noarch") or False
|
||||
is_onnx = fc.find_prop("is_onnx") or False
|
||||
is_pure_torch = fc.find_prop("is_pure_torch") or False
|
||||
is_vulkan = fc.find_prop("is_vulkan") or False
|
||||
is_slow_gradcheck = fc.find_prop("is_slow_gradcheck") or False
|
||||
parms_list_ignored_for_docker_image = []
|
||||
|
||||
if only_slow_gradcheck ^ is_slow_gradcheck:
|
||||
continue
|
||||
|
||||
python_version = None
|
||||
if compiler_name == "cuda" or compiler_name == "android":
|
||||
python_version = fc.find_prop("pyver")
|
||||
@ -282,9 +310,7 @@ def instantiate_configs(only_slow_gradcheck):
|
||||
parms_list.append("asan")
|
||||
python_version = fc.find_prop("pyver")
|
||||
parms_list[0] = fc.find_prop("abbreviated_pyver")
|
||||
|
||||
if is_noarch:
|
||||
parms_list_ignored_for_docker_image.append("noarch")
|
||||
restrict_phases = ["build", "test1", "test2"]
|
||||
|
||||
if is_onnx:
|
||||
parms_list.append("onnx")
|
||||
@ -300,17 +326,13 @@ def instantiate_configs(only_slow_gradcheck):
|
||||
is_important = fc.find_prop("is_important") or False
|
||||
parallel_backend = fc.find_prop("parallel_backend") or None
|
||||
build_only = fc.find_prop("build_only") or False
|
||||
shard_test = fc.find_prop("shard_test") or False
|
||||
is_coverage = fc.find_prop("is_coverage") or False
|
||||
# TODO: fix pure_torch python test packaging issue.
|
||||
if shard_test:
|
||||
restrict_phases = ["build"] if restrict_phases is None else restrict_phases
|
||||
restrict_phases.extend(["test1", "test2"])
|
||||
if build_only or is_pure_torch:
|
||||
restrict_phases = ["build"]
|
||||
if is_coverage and restrict_phases is None:
|
||||
restrict_phases = ["build", "coverage_test"]
|
||||
|
||||
if is_slow_gradcheck:
|
||||
parms_list_ignored_for_docker_image.append("old")
|
||||
parms_list_ignored_for_docker_image.append("gradcheck")
|
||||
|
||||
gpu_resource = None
|
||||
if cuda_version and cuda_version != "10":
|
||||
@ -331,7 +353,6 @@ def instantiate_configs(only_slow_gradcheck):
|
||||
is_libtorch=is_libtorch,
|
||||
is_important=is_important,
|
||||
parallel_backend=parallel_backend,
|
||||
build_only=build_only,
|
||||
)
|
||||
|
||||
# run docs builds on "pytorch-linux-xenial-py3.6-gcc5.4". Docs builds
|
||||
@ -352,14 +373,36 @@ def instantiate_configs(only_slow_gradcheck):
|
||||
tags_list=RC_PATTERN)
|
||||
c.dependent_tests = gen_docs_configs(c)
|
||||
|
||||
if cuda_version == "10.2" and python_version == "3.6" and not is_libtorch:
|
||||
c.dependent_tests = gen_dependent_configs(c)
|
||||
|
||||
if (
|
||||
compiler_name == "gcc"
|
||||
and compiler_version == "5.4"
|
||||
and not is_libtorch
|
||||
and not is_vulkan
|
||||
and not is_pure_torch
|
||||
and parallel_backend is None
|
||||
):
|
||||
bc_breaking_check = Conf(
|
||||
"backward-compatibility-check",
|
||||
[],
|
||||
is_xla=False,
|
||||
restrict_phases=["test"],
|
||||
is_libtorch=False,
|
||||
is_important=True,
|
||||
parent_build=c,
|
||||
)
|
||||
c.dependent_tests.append(bc_breaking_check)
|
||||
|
||||
config_list.append(c)
|
||||
|
||||
return config_list
|
||||
|
||||
|
||||
def get_workflow_jobs(only_slow_gradcheck=False):
|
||||
def get_workflow_jobs():
|
||||
|
||||
config_list = instantiate_configs(only_slow_gradcheck)
|
||||
config_list = instantiate_configs()
|
||||
|
||||
x = []
|
||||
for conf_options in config_list:
|
||||
|
||||
106
.circleci/cimodel/data/simple/android_definitions.py
Normal file
106
.circleci/cimodel/data/simple/android_definitions.py
Normal file
@ -0,0 +1,106 @@
|
||||
import cimodel.data.simple.util.branch_filters as branch_filters
|
||||
from cimodel.data.simple.util.docker_constants import (
|
||||
DOCKER_IMAGE_NDK, DOCKER_REQUIREMENT_NDK
|
||||
)
|
||||
|
||||
|
||||
class AndroidJob:
|
||||
def __init__(self,
|
||||
variant,
|
||||
template_name,
|
||||
is_master_only=True):
|
||||
|
||||
self.variant = variant
|
||||
self.template_name = template_name
|
||||
self.is_master_only = is_master_only
|
||||
|
||||
def gen_tree(self):
|
||||
|
||||
base_name_parts = [
|
||||
"pytorch",
|
||||
"linux",
|
||||
"xenial",
|
||||
"py3",
|
||||
"clang5",
|
||||
"android",
|
||||
"ndk",
|
||||
"r19c",
|
||||
] + self.variant + [
|
||||
"build",
|
||||
]
|
||||
|
||||
full_job_name = "_".join(base_name_parts)
|
||||
build_env_name = "-".join(base_name_parts)
|
||||
|
||||
props_dict = {
|
||||
"name": full_job_name,
|
||||
"build_environment": "\"{}\"".format(build_env_name),
|
||||
"docker_image": "\"{}\"".format(DOCKER_IMAGE_NDK),
|
||||
"requires": [DOCKER_REQUIREMENT_NDK]
|
||||
}
|
||||
|
||||
if self.is_master_only:
|
||||
props_dict["filters"] = branch_filters.gen_filter_dict(branch_filters.NON_PR_BRANCH_LIST)
|
||||
|
||||
return [{self.template_name: props_dict}]
|
||||
|
||||
|
||||
class AndroidGradleJob:
|
||||
def __init__(self,
|
||||
job_name,
|
||||
template_name,
|
||||
dependencies,
|
||||
is_master_only=True,
|
||||
is_pr_only=False):
|
||||
|
||||
self.job_name = job_name
|
||||
self.template_name = template_name
|
||||
self.dependencies = dependencies
|
||||
self.is_master_only = is_master_only
|
||||
self.is_pr_only = is_pr_only
|
||||
|
||||
def gen_tree(self):
|
||||
|
||||
props_dict = {
|
||||
"name": self.job_name,
|
||||
"requires": self.dependencies,
|
||||
}
|
||||
|
||||
if self.is_master_only:
|
||||
props_dict["filters"] = branch_filters.gen_filter_dict(branch_filters.NON_PR_BRANCH_LIST)
|
||||
elif self.is_pr_only:
|
||||
props_dict["filters"] = branch_filters.gen_filter_dict(branch_filters.PR_BRANCH_LIST)
|
||||
|
||||
return [{self.template_name: props_dict}]
|
||||
|
||||
|
||||
WORKFLOW_DATA = [
|
||||
AndroidJob(["x86_32"], "pytorch_linux_build", is_master_only=False),
|
||||
AndroidJob(["x86_64"], "pytorch_linux_build"),
|
||||
AndroidJob(["arm", "v7a"], "pytorch_linux_build"),
|
||||
AndroidJob(["arm", "v8a"], "pytorch_linux_build"),
|
||||
AndroidJob(["vulkan", "x86_32"], "pytorch_linux_build", is_master_only=False),
|
||||
AndroidGradleJob(
|
||||
"pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-build-x86_32",
|
||||
"pytorch_android_gradle_build-x86_32",
|
||||
["pytorch_linux_xenial_py3_clang5_android_ndk_r19c_x86_32_build"],
|
||||
is_master_only=False,
|
||||
is_pr_only=True),
|
||||
AndroidGradleJob(
|
||||
"pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-custom-build-single",
|
||||
"pytorch_android_gradle_custom_build_single",
|
||||
[DOCKER_REQUIREMENT_NDK],
|
||||
is_master_only=False,
|
||||
is_pr_only=True),
|
||||
AndroidGradleJob(
|
||||
"pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-build",
|
||||
"pytorch_android_gradle_build",
|
||||
["pytorch_linux_xenial_py3_clang5_android_ndk_r19c_x86_32_build",
|
||||
"pytorch_linux_xenial_py3_clang5_android_ndk_r19c_x86_64_build",
|
||||
"pytorch_linux_xenial_py3_clang5_android_ndk_r19c_arm_v7a_build",
|
||||
"pytorch_linux_xenial_py3_clang5_android_ndk_r19c_arm_v8a_build"]),
|
||||
]
|
||||
|
||||
|
||||
def get_workflow_jobs():
|
||||
return [item.gen_tree() for item in WORKFLOW_DATA]
|
||||
@ -77,7 +77,7 @@ WORKFLOW_DATA = [
|
||||
["libtorch", "3.7m", "cpu", "devtoolset7"],
|
||||
"pytorch/manylinux-cuda102",
|
||||
"binary_linux_libtorch_3_7m_cpu_devtoolset7_shared-with-deps_build",
|
||||
is_master_only=True,
|
||||
is_master_only=False,
|
||||
has_libtorch_variant=True,
|
||||
),
|
||||
SmoketestJob(
|
||||
@ -109,20 +109,20 @@ WORKFLOW_DATA = [
|
||||
["libtorch", "3.7", "cpu", "debug"],
|
||||
None,
|
||||
"binary_windows_libtorch_3_7_cpu_debug_build",
|
||||
is_master_only=True,
|
||||
is_master_only=False,
|
||||
),
|
||||
SmoketestJob(
|
||||
"binary_windows_build",
|
||||
["libtorch", "3.7", "cpu", "release"],
|
||||
None,
|
||||
"binary_windows_libtorch_3_7_cpu_release_build",
|
||||
is_master_only=True,
|
||||
is_master_only=False,
|
||||
),
|
||||
SmoketestJob(
|
||||
"binary_windows_build",
|
||||
["wheel", "3.7", "cu113"],
|
||||
["wheel", "3.7", "cu102"],
|
||||
None,
|
||||
"binary_windows_wheel_3_7_cu113_build",
|
||||
"binary_windows_wheel_3_7_cu102_build",
|
||||
is_master_only=True,
|
||||
),
|
||||
|
||||
@ -131,7 +131,7 @@ WORKFLOW_DATA = [
|
||||
["libtorch", "3.7", "cpu", "debug"],
|
||||
None,
|
||||
"binary_windows_libtorch_3_7_cpu_debug_test",
|
||||
is_master_only=True,
|
||||
is_master_only=False,
|
||||
requires=["binary_windows_libtorch_3_7_cpu_debug_build"],
|
||||
),
|
||||
SmoketestJob(
|
||||
@ -144,11 +144,11 @@ WORKFLOW_DATA = [
|
||||
),
|
||||
SmoketestJob(
|
||||
"binary_windows_test",
|
||||
["wheel", "3.7", "cu113"],
|
||||
["wheel", "3.7", "cu102"],
|
||||
None,
|
||||
"binary_windows_wheel_3_7_cu113_test",
|
||||
"binary_windows_wheel_3_7_cu102_test",
|
||||
is_master_only=True,
|
||||
requires=["binary_windows_wheel_3_7_cu113_build"],
|
||||
requires=["binary_windows_wheel_3_7_cu102_build"],
|
||||
extra_props={
|
||||
"executor": "windows-with-nvidia-gpu",
|
||||
},
|
||||
@ -173,7 +173,7 @@ WORKFLOW_DATA = [
|
||||
["libtorch", "3.7m", "cpu", "devtoolset7"],
|
||||
"pytorch/manylinux-cuda102",
|
||||
"binary_linux_libtorch_3_7m_cpu_devtoolset7_shared-with-deps_test",
|
||||
is_master_only=True,
|
||||
is_master_only=False,
|
||||
requires=["binary_linux_libtorch_3_7m_cpu_devtoolset7_shared-with-deps_build"],
|
||||
has_libtorch_variant=True,
|
||||
),
|
||||
@ -182,7 +182,7 @@ WORKFLOW_DATA = [
|
||||
["libtorch", "3.7m", "cpu", "gcc5.4_cxx11-abi"],
|
||||
"pytorch/pytorch-binary-docker-image-ubuntu16.04:latest",
|
||||
"binary_linux_libtorch_3_7m_cpu_gcc5_4_cxx11-abi_shared-with-deps_test",
|
||||
is_master_only=True,
|
||||
is_master_only=False,
|
||||
requires=["binary_linux_libtorch_3_7m_cpu_gcc5_4_cxx11-abi_shared-with-deps_build"],
|
||||
has_libtorch_variant=True,
|
||||
),
|
||||
|
||||
@ -4,28 +4,43 @@ from cimodel.lib.miniutils import quote
|
||||
from cimodel.data.simple.util.branch_filters import gen_filter_dict, RC_PATTERN
|
||||
|
||||
|
||||
# NOTE: All hardcoded docker image builds have been migrated to GHA
|
||||
# TODO: make this generated from a matrix rather than just a static list
|
||||
IMAGE_NAMES = [
|
||||
"pytorch-linux-bionic-cuda11.0-cudnn8-py3.6-gcc9",
|
||||
"pytorch-linux-bionic-cuda11.0-cudnn8-py3.8-gcc9",
|
||||
"pytorch-linux-bionic-cuda10.2-cudnn7-py3.8-gcc9",
|
||||
"pytorch-linux-bionic-py3.6-clang9",
|
||||
"pytorch-linux-bionic-cuda10.2-cudnn7-py3.6-clang9",
|
||||
"pytorch-linux-bionic-py3.8-gcc9",
|
||||
"pytorch-linux-bionic-rocm3.5.1-py3.6",
|
||||
"pytorch-linux-xenial-cuda10-cudnn7-py3-gcc7",
|
||||
"pytorch-linux-xenial-cuda10.1-cudnn7-py3-gcc7",
|
||||
"pytorch-linux-xenial-cuda10.2-cudnn7-py3-gcc7",
|
||||
"pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7",
|
||||
"pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4",
|
||||
"pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7",
|
||||
"pytorch-linux-xenial-py3-clang5-android-ndk-r19c",
|
||||
"pytorch-linux-xenial-py3-clang5-asan",
|
||||
"pytorch-linux-xenial-py3-clang7-onnx",
|
||||
"pytorch-linux-xenial-py3.8",
|
||||
"pytorch-linux-xenial-py3.6-clang7",
|
||||
"pytorch-linux-xenial-py3.6-gcc4.8",
|
||||
"pytorch-linux-xenial-py3.6-gcc5.4", # this one is used in doc builds
|
||||
"pytorch-linux-xenial-py3.6-gcc7.2",
|
||||
"pytorch-linux-xenial-py3.6-gcc7",
|
||||
"pytorch-linux-bionic-rocm3.7-py3.6",
|
||||
"pytorch-linux-bionic-rocm3.8-py3.6",
|
||||
]
|
||||
|
||||
# This entry should be an element from the list above
|
||||
# This should contain the image matching the "slow_gradcheck" entry in
|
||||
# pytorch_build_data.py
|
||||
SLOW_GRADCHECK_IMAGE_NAME = "pytorch-linux-xenial-cuda10.2-cudnn7-py3-gcc7"
|
||||
|
||||
def get_workflow_jobs(images=IMAGE_NAMES, only_slow_gradcheck=False):
|
||||
def get_workflow_jobs():
|
||||
"""Generates a list of docker image build definitions"""
|
||||
ret = []
|
||||
for image_name in images:
|
||||
if image_name.startswith('docker-'):
|
||||
image_name = image_name.lstrip('docker-')
|
||||
if only_slow_gradcheck and image_name is not SLOW_GRADCHECK_IMAGE_NAME:
|
||||
continue
|
||||
|
||||
for image_name in IMAGE_NAMES:
|
||||
parameters = OrderedDict({
|
||||
"name": quote(f"docker-{image_name}"),
|
||||
"image_name": quote(image_name),
|
||||
})
|
||||
})
|
||||
if image_name == "pytorch-linux-xenial-py3.6-gcc5.4":
|
||||
# pushing documentation on tags requires CircleCI to also
|
||||
# build all the dependencies on tags, including this docker image
|
||||
|
||||
103
.circleci/cimodel/data/simple/ge_config_tests.py
Normal file
103
.circleci/cimodel/data/simple/ge_config_tests.py
Normal file
@ -0,0 +1,103 @@
|
||||
import cimodel.lib.miniutils as miniutils
|
||||
from cimodel.data.simple.util.versions import MultiPartVersion, CudaVersion
|
||||
from cimodel.data.simple.util.docker_constants import DOCKER_IMAGE_BASIC, DOCKER_IMAGE_CUDA_10_2
|
||||
|
||||
|
||||
class GeConfigTestJob:
|
||||
def __init__(self,
|
||||
py_version,
|
||||
gcc_version,
|
||||
cuda_version,
|
||||
variant_parts,
|
||||
extra_requires,
|
||||
use_cuda_docker=False,
|
||||
build_env_override=None):
|
||||
|
||||
self.py_version = py_version
|
||||
self.gcc_version = gcc_version
|
||||
self.cuda_version = cuda_version
|
||||
self.variant_parts = variant_parts
|
||||
self.extra_requires = extra_requires
|
||||
self.use_cuda_docker = use_cuda_docker
|
||||
self.build_env_override = build_env_override
|
||||
|
||||
def get_all_parts(self, with_dots):
|
||||
|
||||
maybe_py_version = self.py_version.render_dots_or_parts(with_dots) if self.py_version else []
|
||||
maybe_gcc_version = self.gcc_version.render_dots_or_parts(with_dots) if self.gcc_version else []
|
||||
maybe_cuda_version = self.cuda_version.render_dots_or_parts(with_dots) if self.cuda_version else []
|
||||
|
||||
common_parts = [
|
||||
"pytorch",
|
||||
"linux",
|
||||
"xenial",
|
||||
] + maybe_cuda_version + maybe_py_version + maybe_gcc_version
|
||||
|
||||
return common_parts + self.variant_parts
|
||||
|
||||
def gen_tree(self):
|
||||
|
||||
resource_class = "gpu.medium" if self.use_cuda_docker else "large"
|
||||
docker_image = DOCKER_IMAGE_CUDA_10_2 if self.use_cuda_docker else DOCKER_IMAGE_BASIC
|
||||
full_name = "_".join(self.get_all_parts(False))
|
||||
build_env = self.build_env_override or "-".join(self.get_all_parts(True))
|
||||
|
||||
props_dict = {
|
||||
"name": full_name,
|
||||
"build_environment": build_env,
|
||||
"requires": self.extra_requires,
|
||||
"resource_class": resource_class,
|
||||
"docker_image": docker_image,
|
||||
}
|
||||
|
||||
if self.use_cuda_docker:
|
||||
props_dict["use_cuda_docker_runtime"] = miniutils.quote(str(1))
|
||||
|
||||
return [{"pytorch_linux_test": props_dict}]
|
||||
|
||||
|
||||
WORKFLOW_DATA = [
|
||||
GeConfigTestJob(
|
||||
MultiPartVersion([3, 6], "py"),
|
||||
MultiPartVersion([5, 4], "gcc"),
|
||||
None,
|
||||
["ge_config_legacy", "test"],
|
||||
["pytorch_linux_xenial_py3_6_gcc5_4_build"]),
|
||||
GeConfigTestJob(
|
||||
MultiPartVersion([3, 6], "py"),
|
||||
MultiPartVersion([5, 4], "gcc"),
|
||||
None,
|
||||
["ge_config_profiling", "test"],
|
||||
["pytorch_linux_xenial_py3_6_gcc5_4_build"]),
|
||||
GeConfigTestJob(
|
||||
MultiPartVersion([3, 6], "py"),
|
||||
MultiPartVersion([5, 4], "gcc"),
|
||||
None,
|
||||
["ge_config_simple", "test"],
|
||||
["pytorch_linux_xenial_py3_6_gcc5_4_build"],
|
||||
),
|
||||
GeConfigTestJob(
|
||||
None,
|
||||
None,
|
||||
CudaVersion(10, 2),
|
||||
["cudnn7", "py3", "ge_config_legacy", "test"],
|
||||
["pytorch_linux_xenial_cuda10_2_cudnn7_py3_gcc7_build"],
|
||||
use_cuda_docker=True,
|
||||
# TODO Why does the build environment specify cuda10.1, while the
|
||||
# job name is cuda10_2?
|
||||
build_env_override="pytorch-linux-xenial-cuda10.1-cudnn7-ge_config_legacy-test"),
|
||||
GeConfigTestJob(
|
||||
None,
|
||||
None,
|
||||
CudaVersion(10, 2),
|
||||
["cudnn7", "py3", "ge_config_profiling", "test"],
|
||||
["pytorch_linux_xenial_cuda10_2_cudnn7_py3_gcc7_build"],
|
||||
use_cuda_docker=True,
|
||||
# TODO Why does the build environment specify cuda10.1, while the
|
||||
# job name is cuda10_2?
|
||||
build_env_override="pytorch-linux-xenial-cuda10.1-cudnn7-ge_config_profiling-test"),
|
||||
]
|
||||
|
||||
|
||||
def get_workflow_jobs():
|
||||
return [item.gen_tree() for item in WORKFLOW_DATA]
|
||||
@ -1,16 +1,16 @@
|
||||
from cimodel.data.simple.util.versions import MultiPartVersion
|
||||
import cimodel.lib.miniutils as miniutils
|
||||
|
||||
XCODE_VERSION = MultiPartVersion([12, 5, 1])
|
||||
|
||||
IOS_VERSION = MultiPartVersion([12, 0, 0])
|
||||
|
||||
|
||||
class ArchVariant:
|
||||
def __init__(self, name, custom_build_name=""):
|
||||
def __init__(self, name, is_custom=False):
|
||||
self.name = name
|
||||
self.custom_build_name = custom_build_name
|
||||
self.is_custom = is_custom
|
||||
|
||||
def render(self):
|
||||
extra_parts = [self.custom_build_name] if len(self.custom_build_name) > 0 else []
|
||||
extra_parts = ["custom"] if self.is_custom else []
|
||||
return "_".join([self.name] + extra_parts)
|
||||
|
||||
|
||||
@ -19,15 +19,15 @@ def get_platform(arch_variant_name):
|
||||
|
||||
|
||||
class IOSJob:
|
||||
def __init__(self, xcode_version, arch_variant, is_org_member_context=True, extra_props=None):
|
||||
self.xcode_version = xcode_version
|
||||
def __init__(self, ios_version, arch_variant, is_org_member_context=True, extra_props=None):
|
||||
self.ios_version = ios_version
|
||||
self.arch_variant = arch_variant
|
||||
self.is_org_member_context = is_org_member_context
|
||||
self.extra_props = extra_props
|
||||
|
||||
def gen_name_parts(self, with_version_dots):
|
||||
|
||||
version_parts = self.xcode_version.render_dots_or_parts(with_version_dots)
|
||||
version_parts = self.ios_version.render_dots_or_parts(with_version_dots)
|
||||
build_variant_suffix = "_".join([self.arch_variant.render(), "build"])
|
||||
|
||||
return [
|
||||
@ -61,26 +61,9 @@ class IOSJob:
|
||||
|
||||
|
||||
WORKFLOW_DATA = [
|
||||
IOSJob(XCODE_VERSION, ArchVariant("x86_64"), is_org_member_context=False, extra_props={
|
||||
"lite_interpreter": miniutils.quote(str(int(True)))}),
|
||||
IOSJob(XCODE_VERSION, ArchVariant("x86_64", "full_jit"), is_org_member_context=False, extra_props={
|
||||
"lite_interpreter": miniutils.quote(str(int(False)))}),
|
||||
IOSJob(XCODE_VERSION, ArchVariant("arm64"), extra_props={
|
||||
"lite_interpreter": miniutils.quote(str(int(True)))}),
|
||||
IOSJob(XCODE_VERSION, ArchVariant("arm64", "metal"), extra_props={
|
||||
"use_metal": miniutils.quote(str(int(True))),
|
||||
"lite_interpreter": miniutils.quote(str(int(True)))}),
|
||||
IOSJob(XCODE_VERSION, ArchVariant("arm64", "full_jit"), extra_props={
|
||||
"lite_interpreter": miniutils.quote(str(int(False)))}),
|
||||
IOSJob(XCODE_VERSION, ArchVariant("arm64", "custom"), extra_props={
|
||||
"op_list": "mobilenetv2.yaml",
|
||||
"lite_interpreter": miniutils.quote(str(int(True)))}),
|
||||
IOSJob(XCODE_VERSION, ArchVariant("x86_64", "coreml"), is_org_member_context=False, extra_props={
|
||||
"use_coreml": miniutils.quote(str(int(True))),
|
||||
"lite_interpreter": miniutils.quote(str(int(True)))}),
|
||||
IOSJob(XCODE_VERSION, ArchVariant("arm64", "coreml"), extra_props={
|
||||
"use_coreml": miniutils.quote(str(int(True))),
|
||||
"lite_interpreter": miniutils.quote(str(int(True)))}),
|
||||
IOSJob(IOS_VERSION, ArchVariant("x86_64"), is_org_member_context=False),
|
||||
IOSJob(IOS_VERSION, ArchVariant("arm64")),
|
||||
IOSJob(IOS_VERSION, ArchVariant("arm64", True), extra_props={"op_list": "mobilenetv2.yaml"}),
|
||||
]
|
||||
|
||||
|
||||
|
||||
@ -1,22 +1,14 @@
|
||||
class MacOsJob:
|
||||
def __init__(self, os_version, is_build=False, is_test=False, extra_props=tuple()):
|
||||
# extra_props is tuple type, because mutable data structures for argument defaults
|
||||
# is not recommended.
|
||||
def __init__(self, os_version, is_test=False):
|
||||
self.os_version = os_version
|
||||
self.is_build = is_build
|
||||
self.is_test = is_test
|
||||
self.extra_props = dict(extra_props)
|
||||
|
||||
def gen_tree(self):
|
||||
non_phase_parts = ["pytorch", "macos", self.os_version, "py3"]
|
||||
|
||||
extra_name_list = [name for name, exist in self.extra_props.items() if exist]
|
||||
full_job_name_list = non_phase_parts + extra_name_list + [
|
||||
'build' if self.is_build else None,
|
||||
'test' if self.is_test else None,
|
||||
]
|
||||
phase_name = "test" if self.is_test else "build"
|
||||
|
||||
full_job_name = "_".join(list(filter(None, full_job_name_list)))
|
||||
full_job_name = "_".join(non_phase_parts + [phase_name])
|
||||
|
||||
test_build_dependency = "_".join(non_phase_parts + ["build"])
|
||||
extra_dependencies = [test_build_dependency] if self.is_test else []
|
||||
@ -29,23 +21,7 @@ class MacOsJob:
|
||||
return [{full_job_name: props_dict}]
|
||||
|
||||
|
||||
WORKFLOW_DATA = [
|
||||
MacOsJob("10_15", is_build=True),
|
||||
MacOsJob("10_13", is_build=True),
|
||||
MacOsJob(
|
||||
"10_13",
|
||||
is_build=False,
|
||||
is_test=True,
|
||||
),
|
||||
MacOsJob(
|
||||
"10_13",
|
||||
is_build=True,
|
||||
is_test=True,
|
||||
extra_props=tuple({
|
||||
"lite_interpreter": True
|
||||
}.items()),
|
||||
)
|
||||
]
|
||||
WORKFLOW_DATA = [MacOsJob("10_13"), MacOsJob("10_13", True)]
|
||||
|
||||
|
||||
def get_workflow_jobs():
|
||||
|
||||
@ -4,6 +4,12 @@ PyTorch Mobile PR builds (use linux host toolchain + mobile build options)
|
||||
|
||||
import cimodel.lib.miniutils as miniutils
|
||||
import cimodel.data.simple.util.branch_filters
|
||||
from cimodel.data.simple.util.docker_constants import (
|
||||
DOCKER_IMAGE_ASAN,
|
||||
DOCKER_REQUIREMENT_ASAN,
|
||||
DOCKER_IMAGE_NDK,
|
||||
DOCKER_REQUIREMENT_NDK
|
||||
)
|
||||
|
||||
|
||||
class MobileJob:
|
||||
@ -46,6 +52,27 @@ class MobileJob:
|
||||
|
||||
|
||||
WORKFLOW_DATA = [
|
||||
MobileJob(
|
||||
DOCKER_IMAGE_ASAN,
|
||||
[DOCKER_REQUIREMENT_ASAN],
|
||||
["build"]
|
||||
),
|
||||
|
||||
# Use LLVM-DEV toolchain in android-ndk-r19c docker image
|
||||
MobileJob(
|
||||
DOCKER_IMAGE_NDK,
|
||||
[DOCKER_REQUIREMENT_NDK],
|
||||
["custom", "build", "dynamic"]
|
||||
),
|
||||
|
||||
# Use LLVM-DEV toolchain in android-ndk-r19c docker image
|
||||
# Most of this CI is already covered by "mobile-custom-build-dynamic" job
|
||||
MobileJob(
|
||||
DOCKER_IMAGE_NDK,
|
||||
[DOCKER_REQUIREMENT_NDK],
|
||||
["code", "analysis"],
|
||||
True
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
|
||||
77
.circleci/cimodel/data/simple/nightly_android.py
Normal file
77
.circleci/cimodel/data/simple/nightly_android.py
Normal file
@ -0,0 +1,77 @@
|
||||
from cimodel.data.simple.util.docker_constants import (
|
||||
DOCKER_IMAGE_NDK,
|
||||
DOCKER_REQUIREMENT_NDK
|
||||
)
|
||||
|
||||
|
||||
class AndroidNightlyJob:
|
||||
def __init__(self,
|
||||
variant,
|
||||
template_name,
|
||||
extra_props=None,
|
||||
with_docker=True,
|
||||
requires=None,
|
||||
no_build_suffix=False):
|
||||
|
||||
self.variant = variant
|
||||
self.template_name = template_name
|
||||
self.extra_props = extra_props or {}
|
||||
self.with_docker = with_docker
|
||||
self.requires = requires
|
||||
self.no_build_suffix = no_build_suffix
|
||||
|
||||
def gen_tree(self):
|
||||
|
||||
base_name_parts = [
|
||||
"pytorch",
|
||||
"linux",
|
||||
"xenial",
|
||||
"py3",
|
||||
"clang5",
|
||||
"android",
|
||||
"ndk",
|
||||
"r19c",
|
||||
] + self.variant
|
||||
|
||||
build_suffix = [] if self.no_build_suffix else ["build"]
|
||||
full_job_name = "_".join(["nightly"] + base_name_parts + build_suffix)
|
||||
build_env_name = "-".join(base_name_parts)
|
||||
|
||||
props_dict = {
|
||||
"name": full_job_name,
|
||||
"requires": self.requires,
|
||||
"filters": {"branches": {"only": "nightly"}},
|
||||
}
|
||||
|
||||
props_dict.update(self.extra_props)
|
||||
|
||||
if self.with_docker:
|
||||
props_dict["docker_image"] = DOCKER_IMAGE_NDK
|
||||
props_dict["build_environment"] = build_env_name
|
||||
|
||||
return [{self.template_name: props_dict}]
|
||||
|
||||
BASE_REQUIRES = [DOCKER_REQUIREMENT_NDK]
|
||||
|
||||
WORKFLOW_DATA = [
|
||||
AndroidNightlyJob(["x86_32"], "pytorch_linux_build", requires=BASE_REQUIRES),
|
||||
AndroidNightlyJob(["x86_64"], "pytorch_linux_build", requires=BASE_REQUIRES),
|
||||
AndroidNightlyJob(["arm", "v7a"], "pytorch_linux_build", requires=BASE_REQUIRES),
|
||||
AndroidNightlyJob(["arm", "v8a"], "pytorch_linux_build", requires=BASE_REQUIRES),
|
||||
AndroidNightlyJob(["android_gradle"], "pytorch_android_gradle_build",
|
||||
with_docker=False,
|
||||
requires=[
|
||||
"nightly_pytorch_linux_xenial_py3_clang5_android_ndk_r19c_x86_32_build",
|
||||
"nightly_pytorch_linux_xenial_py3_clang5_android_ndk_r19c_x86_64_build",
|
||||
"nightly_pytorch_linux_xenial_py3_clang5_android_ndk_r19c_arm_v7a_build",
|
||||
"nightly_pytorch_linux_xenial_py3_clang5_android_ndk_r19c_arm_v8a_build"]),
|
||||
AndroidNightlyJob(["x86_32_android_publish_snapshot"], "pytorch_android_publish_snapshot",
|
||||
extra_props={"context": "org-member"},
|
||||
with_docker=False,
|
||||
requires=["nightly_pytorch_linux_xenial_py3_clang5_android_ndk_r19c_android_gradle_build"],
|
||||
no_build_suffix=True),
|
||||
]
|
||||
|
||||
|
||||
def get_workflow_jobs():
|
||||
return [item.gen_tree() for item in WORKFLOW_DATA]
|
||||
@ -1,15 +1,12 @@
|
||||
import cimodel.data.simple.ios_definitions as ios_definitions
|
||||
import cimodel.lib.miniutils as miniutils
|
||||
|
||||
|
||||
class IOSNightlyJob:
|
||||
def __init__(self,
|
||||
variant,
|
||||
is_full_jit=False,
|
||||
is_upload=False):
|
||||
|
||||
self.variant = variant
|
||||
self.is_full_jit = is_full_jit
|
||||
self.is_upload = is_upload
|
||||
|
||||
def get_phase_name(self):
|
||||
@ -19,12 +16,9 @@ class IOSNightlyJob:
|
||||
|
||||
extra_name_suffix = [self.get_phase_name()] if self.is_upload else []
|
||||
|
||||
extra_name = ["full_jit"] if self.is_full_jit else []
|
||||
|
||||
common_name_pieces = [
|
||||
"ios",
|
||||
] + extra_name + [
|
||||
] + ios_definitions.XCODE_VERSION.render_dots_or_parts(with_version_dots) + [
|
||||
] + ios_definitions.IOS_VERSION.render_dots_or_parts(with_version_dots) + [
|
||||
"nightly",
|
||||
self.variant,
|
||||
"build",
|
||||
@ -36,8 +30,7 @@ class IOSNightlyJob:
|
||||
return "_".join(["pytorch"] + self.get_common_name_pieces(False))
|
||||
|
||||
def gen_tree(self):
|
||||
build_configs = BUILD_CONFIGS_FULL_JIT if self.is_full_jit else BUILD_CONFIGS
|
||||
extra_requires = [x.gen_job_name() for x in build_configs] if self.is_upload else []
|
||||
extra_requires = [x.gen_job_name() for x in BUILD_CONFIGS] if self.is_upload else []
|
||||
|
||||
props_dict = {
|
||||
"build_environment": "-".join(["libtorch"] + self.get_common_name_pieces(True)),
|
||||
@ -50,11 +43,6 @@ class IOSNightlyJob:
|
||||
props_dict["ios_arch"] = self.variant
|
||||
props_dict["ios_platform"] = ios_definitions.get_platform(self.variant)
|
||||
props_dict["name"] = self.gen_job_name()
|
||||
props_dict["use_metal"] = miniutils.quote(str(int(True)))
|
||||
props_dict["use_coreml"] = miniutils.quote(str(int(True)))
|
||||
|
||||
if self.is_full_jit:
|
||||
props_dict["lite_interpreter"] = miniutils.quote(str(int(False)))
|
||||
|
||||
template_name = "_".join([
|
||||
"binary",
|
||||
@ -70,14 +58,9 @@ BUILD_CONFIGS = [
|
||||
IOSNightlyJob("arm64"),
|
||||
]
|
||||
|
||||
BUILD_CONFIGS_FULL_JIT = [
|
||||
IOSNightlyJob("x86_64", is_full_jit=True),
|
||||
IOSNightlyJob("arm64", is_full_jit=True),
|
||||
]
|
||||
|
||||
WORKFLOW_DATA = BUILD_CONFIGS + BUILD_CONFIGS_FULL_JIT + [
|
||||
IOSNightlyJob("binary", is_full_jit=False, is_upload=True),
|
||||
IOSNightlyJob("binary", is_full_jit=True, is_upload=True),
|
||||
WORKFLOW_DATA = BUILD_CONFIGS + [
|
||||
IOSNightlyJob("binary", is_upload=True),
|
||||
]
|
||||
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ def gen_docker_image_requires(image_name):
|
||||
|
||||
|
||||
DOCKER_IMAGE_BASIC, DOCKER_REQUIREMENT_BASE = gen_docker_image(
|
||||
"pytorch-linux-xenial-py3.7-gcc5.4"
|
||||
"pytorch-linux-xenial-py3.6-gcc5.4"
|
||||
)
|
||||
|
||||
DOCKER_IMAGE_CUDA_10_2, DOCKER_REQUIREMENT_CUDA_10_2 = gen_docker_image(
|
||||
@ -19,7 +19,7 @@ DOCKER_IMAGE_CUDA_10_2, DOCKER_REQUIREMENT_CUDA_10_2 = gen_docker_image(
|
||||
)
|
||||
|
||||
DOCKER_IMAGE_GCC7, DOCKER_REQUIREMENT_GCC7 = gen_docker_image(
|
||||
"pytorch-linux-xenial-py3.7-gcc7"
|
||||
"pytorch-linux-xenial-py3.6-gcc7"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ class MultiPartVersion:
|
||||
with the prefix string.
|
||||
"""
|
||||
if self.parts:
|
||||
return [self.prefix + str(self.parts[0])] + [str(part) for part in self.parts[1:]]
|
||||
return [self.prefix + str(self.parts[0])] + list(map(str, self.parts[1:]))
|
||||
else:
|
||||
return [self.prefix]
|
||||
|
||||
@ -29,6 +29,3 @@ class CudaVersion(MultiPartVersion):
|
||||
self.minor = minor
|
||||
|
||||
super().__init__([self.major, self.minor], "cuda")
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.major}.{self.minor}"
|
||||
|
||||
147
.circleci/cimodel/data/windows_build_definitions.py
Normal file
147
.circleci/cimodel/data/windows_build_definitions.py
Normal file
@ -0,0 +1,147 @@
|
||||
import cimodel.data.simple.util.branch_filters
|
||||
import cimodel.lib.miniutils as miniutils
|
||||
from cimodel.data.simple.util.versions import CudaVersion
|
||||
|
||||
|
||||
class WindowsJob:
|
||||
def __init__(
|
||||
self,
|
||||
test_index,
|
||||
vscode_spec,
|
||||
cuda_version,
|
||||
force_on_cpu=False,
|
||||
master_only_pred=lambda job: job.vscode_spec.year != 2019,
|
||||
):
|
||||
self.test_index = test_index
|
||||
self.vscode_spec = vscode_spec
|
||||
self.cuda_version = cuda_version
|
||||
self.force_on_cpu = force_on_cpu
|
||||
self.master_only_pred = master_only_pred
|
||||
|
||||
def gen_tree(self):
|
||||
|
||||
base_phase = "build" if self.test_index is None else "test"
|
||||
numbered_phase = (
|
||||
base_phase if self.test_index is None else base_phase + str(self.test_index)
|
||||
)
|
||||
|
||||
key_name = "_".join(["pytorch", "windows", base_phase])
|
||||
|
||||
cpu_forcing_name_parts = ["on", "cpu"] if self.force_on_cpu else []
|
||||
|
||||
target_arch = self.cuda_version.render_dots() if self.cuda_version else "cpu"
|
||||
|
||||
base_name_parts = [
|
||||
"pytorch",
|
||||
"windows",
|
||||
self.vscode_spec.render(),
|
||||
"py36",
|
||||
target_arch,
|
||||
]
|
||||
|
||||
prerequisite_jobs = []
|
||||
if base_phase == "test":
|
||||
prerequisite_jobs.append("_".join(base_name_parts + ["build"]))
|
||||
|
||||
if self.cuda_version:
|
||||
self.cudnn_version = 8 if self.cuda_version.major == 11 else 7
|
||||
|
||||
arch_env_elements = (
|
||||
["cuda" + str(self.cuda_version.major), "cudnn" + str(self.cudnn_version)]
|
||||
if self.cuda_version
|
||||
else ["cpu"]
|
||||
)
|
||||
|
||||
build_environment_string = "-".join(
|
||||
["pytorch", "win"]
|
||||
+ self.vscode_spec.get_elements()
|
||||
+ arch_env_elements
|
||||
+ ["py3"]
|
||||
)
|
||||
|
||||
is_running_on_cuda = bool(self.cuda_version) and not self.force_on_cpu
|
||||
|
||||
props_dict = {
|
||||
"build_environment": build_environment_string,
|
||||
"python_version": miniutils.quote("3.6"),
|
||||
"vc_version": miniutils.quote(self.vscode_spec.dotted_version()),
|
||||
"vc_year": miniutils.quote(str(self.vscode_spec.year)),
|
||||
"vc_product": self.vscode_spec.get_product(),
|
||||
"use_cuda": miniutils.quote(str(int(is_running_on_cuda))),
|
||||
"requires": prerequisite_jobs,
|
||||
}
|
||||
|
||||
if self.master_only_pred(self):
|
||||
props_dict[
|
||||
"filters"
|
||||
] = cimodel.data.simple.util.branch_filters.gen_filter_dict()
|
||||
|
||||
name_parts = base_name_parts + cpu_forcing_name_parts + [numbered_phase]
|
||||
|
||||
if base_phase == "test":
|
||||
test_name = "-".join(["pytorch", "windows", numbered_phase])
|
||||
props_dict["test_name"] = test_name
|
||||
|
||||
if is_running_on_cuda:
|
||||
props_dict["executor"] = "windows-with-nvidia-gpu"
|
||||
|
||||
props_dict["cuda_version"] = (
|
||||
miniutils.quote(str(self.cuda_version.major))
|
||||
if self.cuda_version
|
||||
else "cpu"
|
||||
)
|
||||
props_dict["name"] = "_".join(name_parts)
|
||||
|
||||
return [{key_name: props_dict}]
|
||||
|
||||
|
||||
class VcSpec:
|
||||
def __init__(self, year, version_elements=None, hide_version=False):
|
||||
self.year = year
|
||||
self.version_elements = version_elements or []
|
||||
self.hide_version = hide_version
|
||||
|
||||
def get_elements(self):
|
||||
if self.hide_version:
|
||||
return [self.prefixed_year()]
|
||||
return [self.prefixed_year()] + self.version_elements
|
||||
|
||||
def get_product(self):
|
||||
return "Community" if self.year == 2019 else "BuildTools"
|
||||
|
||||
def dotted_version(self):
|
||||
return ".".join(self.version_elements)
|
||||
|
||||
def prefixed_year(self):
|
||||
return "vs" + str(self.year)
|
||||
|
||||
def render(self):
|
||||
return "_".join(self.get_elements())
|
||||
|
||||
def FalsePred(_):
|
||||
return False
|
||||
|
||||
def TruePred(_):
|
||||
return True
|
||||
|
||||
_VC2019 = VcSpec(2019)
|
||||
|
||||
WORKFLOW_DATA = [
|
||||
# VS2019 CUDA-10.1
|
||||
WindowsJob(None, _VC2019, CudaVersion(10, 1)),
|
||||
WindowsJob(1, _VC2019, CudaVersion(10, 1)),
|
||||
WindowsJob(2, _VC2019, CudaVersion(10, 1)),
|
||||
# VS2019 CUDA-11.0
|
||||
WindowsJob(None, _VC2019, CudaVersion(11, 0)),
|
||||
WindowsJob(1, _VC2019, CudaVersion(11, 0), master_only_pred=TruePred),
|
||||
WindowsJob(2, _VC2019, CudaVersion(11, 0), master_only_pred=TruePred),
|
||||
# VS2019 CPU-only
|
||||
WindowsJob(None, _VC2019, None),
|
||||
WindowsJob(1, _VC2019, None, master_only_pred=TruePred),
|
||||
WindowsJob(2, _VC2019, None, master_only_pred=TruePred),
|
||||
WindowsJob(1, _VC2019, CudaVersion(10, 1), force_on_cpu=True, master_only_pred=TruePred),
|
||||
]
|
||||
|
||||
|
||||
def get_windows_workflows():
|
||||
return [item.gen_tree() for item in WORKFLOW_DATA]
|
||||
7633
.circleci/config.yml
7633
.circleci/config.yml
File diff suppressed because it is too large
Load Diff
@ -12,20 +12,8 @@ each image as the `BUILD_ENVIRONMENT` environment variable.
|
||||
|
||||
See `build.sh` for valid build environments (it's the giant switch).
|
||||
|
||||
Docker builds are now defined with `.circleci/cimodel/data/simple/docker_definitions.py`
|
||||
|
||||
## Contents
|
||||
|
||||
* `build.sh` -- dispatch script to launch all builds
|
||||
* `common` -- scripts used to execute individual Docker build stages
|
||||
* `ubuntu-cuda` -- Dockerfile for Ubuntu image with CUDA support for nvidia-docker
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
# Build a specific image
|
||||
./build.sh pytorch-linux-bionic-py3.8-gcc9 -t myimage:latest
|
||||
|
||||
# Set flags (see build.sh) and build image
|
||||
sudo bash -c 'PROTOBUF=1 ./build.sh pytorch-linux-bionic-py3.8-gcc9 -t myimage:latest
|
||||
```
|
||||
|
||||
@ -20,8 +20,10 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.1.2'
|
||||
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.14.2'
|
||||
classpath 'com.android.tools.build:gradle:3.3.2'
|
||||
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0"
|
||||
classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
|
||||
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.9.8"
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,9 +53,9 @@ android {
|
||||
dependencies {
|
||||
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.0.0'
|
||||
implementation 'com.facebook.fbjni:fbjni-java-only:0.2.2'
|
||||
implementation 'com.facebook.fbjni:fbjni-java-only:0.0.3'
|
||||
implementation 'com.google.code.findbugs:jsr305:3.0.1'
|
||||
implementation 'com.facebook.soloader:nativeloader:0.10.1'
|
||||
implementation 'com.facebook.soloader:nativeloader:0.8.0'
|
||||
|
||||
implementation 'junit:junit:' + rootProject.junitVersion
|
||||
implementation 'androidx.test:core:' + rootProject.coreVersion
|
||||
|
||||
@ -40,7 +40,9 @@ function extract_all_from_image_name() {
|
||||
done
|
||||
}
|
||||
|
||||
if [[ "$image" == *-xenial* ]]; then
|
||||
if [[ "$image" == *-trusty* ]]; then
|
||||
UBUNTU_VERSION=14.04
|
||||
elif [[ "$image" == *-xenial* ]]; then
|
||||
UBUNTU_VERSION=16.04
|
||||
elif [[ "$image" == *-artful* ]]; then
|
||||
UBUNTU_VERSION=17.10
|
||||
@ -77,73 +79,90 @@ TRAVIS_DL_URL_PREFIX="https://s3.amazonaws.com/travis-python-archives/binaries/u
|
||||
# from scratch
|
||||
case "$image" in
|
||||
pytorch-linux-xenial-py3.8)
|
||||
ANACONDA_PYTHON_VERSION=3.8
|
||||
CMAKE_VERSION=3.10.3
|
||||
# TODO: This is a hack, get rid of this as soon as you get rid of the travis downloads
|
||||
TRAVIS_DL_URL_PREFIX="https://s3.amazonaws.com/travis-python-archives/binaries/ubuntu/16.04/x86_64"
|
||||
TRAVIS_PYTHON_VERSION=3.8
|
||||
GCC_VERSION=7
|
||||
# Do not install PROTOBUF, DB, and VISION as a test
|
||||
;;
|
||||
pytorch-linux-xenial-py3.7-gcc5.4)
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
CMAKE_VERSION=3.10.3
|
||||
pytorch-linux-xenial-py3.6-gcc4.8)
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
GCC_VERSION=4.8
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
;;
|
||||
pytorch-linux-xenial-py3.6-gcc5.4)
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
GCC_VERSION=5
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
KATEX=yes
|
||||
;;
|
||||
pytorch-linux-xenial-py3.7-gcc7.2)
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
CMAKE_VERSION=3.10.3
|
||||
pytorch-linux-xenial-py3.6-gcc7.2)
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
GCC_VERSION=7
|
||||
# Do not install PROTOBUF, DB, and VISION as a test
|
||||
;;
|
||||
pytorch-linux-xenial-py3.7-gcc7)
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
CMAKE_VERSION=3.10.3
|
||||
pytorch-linux-xenial-py3.6-gcc7)
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
GCC_VERSION=7
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
;;
|
||||
pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4)
|
||||
CUDA_VERSION=9.2
|
||||
CUDNN_VERSION=7
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
GCC_VERSION=5
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
;;
|
||||
pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7)
|
||||
CUDA_VERSION=9.2
|
||||
CUDNN_VERSION=7
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
GCC_VERSION=7
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
;;
|
||||
pytorch-linux-xenial-cuda10-cudnn7-py3-gcc7)
|
||||
CUDA_VERSION=10.0
|
||||
CUDNN_VERSION=7
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
GCC_VERSION=7
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
;;
|
||||
pytorch-linux-xenial-cuda10.1-cudnn7-py3-gcc7)
|
||||
CUDA_VERSION=10.1
|
||||
CUDNN_VERSION=7
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
GCC_VERSION=7
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
KATEX=yes
|
||||
;;
|
||||
pytorch-linux-xenial-cuda10.2-cudnn7-py3-gcc7)
|
||||
CUDA_VERSION=10.2
|
||||
CUDNN_VERSION=7
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
CMAKE_VERSION=3.10.3
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
GCC_VERSION=7
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
KATEX=yes
|
||||
;;
|
||||
pytorch-linux-xenial-cuda11.1-cudnn8-py3-gcc7)
|
||||
CUDA_VERSION=11.1
|
||||
pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7)
|
||||
CUDA_VERSION=11.0
|
||||
CUDNN_VERSION=8
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
CMAKE_VERSION=3.10.3
|
||||
GCC_VERSION=7
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
KATEX=yes
|
||||
;;
|
||||
pytorch-linux-xenial-cuda11.3-cudnn8-py3-gcc7)
|
||||
CUDA_VERSION=11.3.0 # Deviating from major.minor to conform to nvidia's Docker image names
|
||||
CUDNN_VERSION=8
|
||||
TENSORRT_VERSION=8.0.1.6
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
CMAKE_VERSION=3.10.3
|
||||
GCC_VERSION=7
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
KATEX=yes
|
||||
;;
|
||||
pytorch-linux-bionic-cuda11.5-cudnn8-py3-gcc7)
|
||||
CUDA_VERSION=11.5.0
|
||||
CUDNN_VERSION=8
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
CMAKE_VERSION=3.10.3
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
GCC_VERSION=7
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
@ -151,55 +170,44 @@ case "$image" in
|
||||
KATEX=yes
|
||||
;;
|
||||
pytorch-linux-xenial-py3-clang5-asan)
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
CLANG_VERSION=5.0
|
||||
CMAKE_VERSION=3.13.5
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
;;
|
||||
pytorch-linux-xenial-py3-clang7-asan)
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
CLANG_VERSION=7
|
||||
CMAKE_VERSION=3.10.3
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
;;
|
||||
pytorch-linux-xenial-py3-clang7-onnx)
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
CLANG_VERSION=7
|
||||
CMAKE_VERSION=3.10.3
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
;;
|
||||
pytorch-linux-xenial-py3-clang5-android-ndk-r19c)
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
CLANG_VERSION=5.0
|
||||
CMAKE_VERSION=3.13.5
|
||||
LLVMDEV=yes
|
||||
PROTOBUF=yes
|
||||
ANDROID=yes
|
||||
ANDROID_NDK_VERSION=r19c
|
||||
GRADLE_VERSION=6.8.3
|
||||
GRADLE_VERSION=4.10.3
|
||||
CMAKE_VERSION=3.7.0
|
||||
NINJA_VERSION=1.9.0
|
||||
;;
|
||||
pytorch-linux-xenial-py3.7-clang7)
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
CMAKE_VERSION=3.10.3
|
||||
pytorch-linux-xenial-py3.6-clang7)
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
CLANG_VERSION=7
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
;;
|
||||
pytorch-linux-bionic-py3.7-clang9)
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
pytorch-linux-bionic-py3.6-clang9)
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
CLANG_VERSION=9
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
VULKAN_SDK_VERSION=1.2.162.1
|
||||
VULKAN_SDK_VERSION=1.2.148.0
|
||||
SWIFTSHADER=yes
|
||||
;;
|
||||
pytorch-linux-bionic-py3.8-gcc9)
|
||||
@ -209,49 +217,57 @@ case "$image" in
|
||||
DB=yes
|
||||
VISION=yes
|
||||
;;
|
||||
pytorch-linux-bionic-cuda10.2-cudnn7-py3.7-clang9)
|
||||
pytorch-linux-bionic-cuda10.2-cudnn7-py3.6-clang9)
|
||||
CUDA_VERSION=10.2
|
||||
CUDNN_VERSION=7
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
CLANG_VERSION=9
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
;;
|
||||
pytorch-linux-bionic-cuda10.2-cudnn7-py3.9-gcc7)
|
||||
pytorch-linux-bionic-cuda10.2-cudnn7-py3.8-gcc9)
|
||||
CUDA_VERSION=10.2
|
||||
CUDNN_VERSION=7
|
||||
ANACONDA_PYTHON_VERSION=3.9
|
||||
GCC_VERSION=7
|
||||
ANACONDA_PYTHON_VERSION=3.8
|
||||
GCC_VERSION=9
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
;;
|
||||
pytorch-linux-bionic-cuda11.0-cudnn8-py3.7-gcc9)
|
||||
pytorch-linux-bionic-cuda11.0-cudnn8-py3.6-gcc9)
|
||||
CUDA_VERSION=11.0
|
||||
CUDNN_VERSION=8
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
GCC_VERSION=9
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
ROCM_VERSION=3.9
|
||||
KATEX=yes
|
||||
;;
|
||||
pytorch-linux-bionic-rocm4.3.1-py3.7)
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
pytorch-linux-bionic-cuda11.0-cudnn8-py3.8-gcc9)
|
||||
CUDA_VERSION=11.0
|
||||
CUDNN_VERSION=8
|
||||
ANACONDA_PYTHON_VERSION=3.8
|
||||
GCC_VERSION=9
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
ROCM_VERSION=4.3.1
|
||||
KATEX=yes
|
||||
;;
|
||||
pytorch-linux-bionic-rocm4.5-py3.7)
|
||||
ANACONDA_PYTHON_VERSION=3.7
|
||||
GCC_VERSION=9
|
||||
pytorch-linux-bionic-rocm3.7-py3.6)
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
ROCM_VERSION=4.5.2
|
||||
ROCM_VERSION=3.7
|
||||
;;
|
||||
pytorch-linux-bionic-rocm3.8-py3.6)
|
||||
ANACONDA_PYTHON_VERSION=3.6
|
||||
PROTOBUF=yes
|
||||
DB=yes
|
||||
VISION=yes
|
||||
ROCM_VERSION=3.8
|
||||
;;
|
||||
*)
|
||||
# Catch-all for builds that are not hardcoded.
|
||||
@ -259,9 +275,6 @@ case "$image" in
|
||||
DB=yes
|
||||
VISION=yes
|
||||
echo "image '$image' did not match an existing build configuration"
|
||||
if [[ "$image" == *xenial* ]]; then
|
||||
CMAKE_VERSION=3.10.3
|
||||
fi
|
||||
if [[ "$image" == *py* ]]; then
|
||||
extract_version_from_image_name py ANACONDA_PYTHON_VERSION
|
||||
fi
|
||||
@ -296,17 +309,7 @@ if [ -n "${JENKINS:-}" ]; then
|
||||
JENKINS_GID=$(id -g jenkins)
|
||||
fi
|
||||
|
||||
tmp_tag=$(basename "$(mktemp -u)" | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
# If we are trying to use nvidia cuda image make sure it exists, otherwise use IMAGE from ghcr.io
|
||||
# this logic currently only exists for ubuntu
|
||||
if [[ "$image" == *cuda* && ${OS} == "ubuntu" ]]; then
|
||||
IMAGE_NAME="nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel-ubuntu${UBUNTU_VERSION}"
|
||||
if ! DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect "${IMAGE_NAME}" >/dev/null 2>/dev/null; then
|
||||
IMAGE_NAME="ghcr.io/pytorch/nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}"
|
||||
INSTALL_CUDNN="True"
|
||||
fi
|
||||
fi
|
||||
tmp_tag="tmp-$(cat /dev/urandom | tr -dc 'a-z' | fold -w 32 | head -n 1)"
|
||||
|
||||
# Build image
|
||||
# TODO: build-arg THRIFT is not turned on for any image, remove it once we confirm
|
||||
@ -331,10 +334,10 @@ docker build \
|
||||
--build-arg "GLIBC_VERSION=${GLIBC_VERSION}" \
|
||||
--build-arg "CLANG_VERSION=${CLANG_VERSION}" \
|
||||
--build-arg "ANACONDA_PYTHON_VERSION=${ANACONDA_PYTHON_VERSION}" \
|
||||
--build-arg "TRAVIS_PYTHON_VERSION=${TRAVIS_PYTHON_VERSION}" \
|
||||
--build-arg "GCC_VERSION=${GCC_VERSION}" \
|
||||
--build-arg "CUDA_VERSION=${CUDA_VERSION}" \
|
||||
--build-arg "CUDNN_VERSION=${CUDNN_VERSION}" \
|
||||
--build-arg "TENSORRT_VERSION=${TENSORRT_VERSION}" \
|
||||
--build-arg "ANDROID=${ANDROID}" \
|
||||
--build-arg "ANDROID_NDK=${ANDROID_NDK_VERSION}" \
|
||||
--build-arg "GRADLE_VERSION=${GRADLE_VERSION}" \
|
||||
@ -344,9 +347,6 @@ docker build \
|
||||
--build-arg "NINJA_VERSION=${NINJA_VERSION:-}" \
|
||||
--build-arg "KATEX=${KATEX:-}" \
|
||||
--build-arg "ROCM_VERSION=${ROCM_VERSION:-}" \
|
||||
--build-arg "PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH:-gfx900;gfx906}" \
|
||||
--build-arg "IMAGE_NAME=${IMAGE_NAME}" \
|
||||
--build-arg "INSTALL_CUDNN=${INSTALL_CUDNN}" \
|
||||
-f $(dirname ${DOCKERFILE})/Dockerfile \
|
||||
-t "$tmp_tag" \
|
||||
"$@" \
|
||||
@ -365,7 +365,6 @@ function drun() {
|
||||
}
|
||||
|
||||
if [[ "$OS" == "ubuntu" ]]; then
|
||||
|
||||
if !(drun lsb_release -a 2>&1 | grep -qF Ubuntu); then
|
||||
echo "OS=ubuntu, but:"
|
||||
drun lsb_release -a
|
||||
@ -378,6 +377,19 @@ if [[ "$OS" == "ubuntu" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$TRAVIS_PYTHON_VERSION" ]; then
|
||||
if [[ "$TRAVIS_PYTHON_VERSION" != nightly ]]; then
|
||||
if !(drun python --version 2>&1 | grep -qF "Python $TRAVIS_PYTHON_VERSION"); then
|
||||
echo "TRAVIS_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION, but:"
|
||||
drun python --version
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Please manually check nightly is OK:"
|
||||
drun python --version
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
|
||||
if !(drun python --version 2>&1 | grep -qF "Python $ANACONDA_PYTHON_VERSION"); then
|
||||
echo "ANACONDA_PYTHON_VERSION=$ANACONDA_PYTHON_VERSION, but:"
|
||||
|
||||
@ -26,14 +26,11 @@ login() {
|
||||
docker login -u AWS --password-stdin "$1"
|
||||
}
|
||||
|
||||
# Retry on timeouts (can happen on job stampede).
|
||||
retry login "${registry}"
|
||||
|
||||
# Only run these steps if not on github actions
|
||||
if [[ -z "${GITHUB_ACTIONS}" ]]; then
|
||||
# Retry on timeouts (can happen on job stampede).
|
||||
retry login "${registry}"
|
||||
# Logout on exit
|
||||
trap "docker logout ${registry}" EXIT
|
||||
fi
|
||||
# Logout on exit
|
||||
trap "docker logout ${registry}" EXIT
|
||||
|
||||
# export EC2=1
|
||||
# export JENKINS=1
|
||||
@ -48,8 +45,5 @@ fi
|
||||
|
||||
docker push "${image}:${tag}"
|
||||
|
||||
if [ -z "${DOCKER_SKIP_S3_UPLOAD:-}" ]; then
|
||||
trap "rm -rf ${IMAGE_NAME}:${tag}.tar" EXIT
|
||||
docker save -o "${IMAGE_NAME}:${tag}.tar" "${image}:${tag}"
|
||||
aws s3 cp "${IMAGE_NAME}:${tag}.tar" "s3://ossci-linux-build/pytorch/base/${IMAGE_NAME}:${tag}.tar" --acl public-read
|
||||
fi
|
||||
docker save -o "${IMAGE_NAME}:${tag}.tar" "${image}:${tag}"
|
||||
aws s3 cp "${IMAGE_NAME}:${tag}.tar" "s3://ossci-linux-build/pytorch/base/${IMAGE_NAME}:${tag}.tar" --acl public-read
|
||||
|
||||
@ -4,10 +4,6 @@ FROM centos:${CENTOS_VERSION}
|
||||
|
||||
ARG CENTOS_VERSION
|
||||
|
||||
# Set AMD gpu targets to build for
|
||||
ARG PYTORCH_ROCM_ARCH
|
||||
ENV PYTORCH_ROCM_ARCH ${PYTORCH_ROCM_ARCH}
|
||||
|
||||
# Install required packages to build Caffe2
|
||||
|
||||
# Install common dependencies (so that this step can be cached separately)
|
||||
@ -15,12 +11,6 @@ ARG EC2
|
||||
ADD ./common/install_base.sh install_base.sh
|
||||
RUN bash ./install_base.sh && rm install_base.sh
|
||||
|
||||
# Update CentOS git version
|
||||
RUN yum -y remove git
|
||||
RUN yum -y remove git-*
|
||||
RUN yum -y install https://packages.endpoint.com/rhel/7/os/x86_64/endpoint-repo-1.9-1.x86_64.rpm
|
||||
RUN yum install -y git
|
||||
|
||||
# Install devtoolset
|
||||
ARG DEVTOOLSET_VERSION
|
||||
ADD ./common/install_devtoolset.sh install_devtoolset.sh
|
||||
@ -37,7 +27,7 @@ RUN rm install_glibc.sh
|
||||
ADD ./common/install_user.sh install_user.sh
|
||||
RUN bash ./install_user.sh && rm install_user.sh
|
||||
|
||||
# Install conda and other packages (e.g., numpy, pytest)
|
||||
# Install conda
|
||||
ENV PATH /opt/conda/bin:$PATH
|
||||
ARG ANACONDA_PYTHON_VERSION
|
||||
ADD ./common/install_conda.sh install_conda.sh
|
||||
@ -74,7 +64,7 @@ ENV PATH /opt/rocm/hcc/bin:$PATH
|
||||
ENV PATH /opt/rocm/hip/bin:$PATH
|
||||
ENV PATH /opt/rocm/opencl/bin:$PATH
|
||||
ENV PATH /opt/rocm/llvm/bin:$PATH
|
||||
ENV MAGMA_HOME /opt/rocm/magma
|
||||
ENV HIP_PLATFORM hcc
|
||||
ENV LANG en_US.utf8
|
||||
ENV LC_ALL en_US.utf8
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ echo "ndk.dir=/opt/ndk" >> $GRADLE_LOCAL_PROPERTIES
|
||||
chown -R jenkins /var/lib/jenkins/gradledeps
|
||||
chgrp -R jenkins /var/lib/jenkins/gradledeps
|
||||
|
||||
sudo -H -u jenkins $GRADLE_HOME/bin/gradle -Pandroid.useAndroidX=true -p /var/lib/jenkins/gradledeps -g /var/lib/jenkins/.gradle --refresh-dependencies --debug --stacktrace assemble
|
||||
sudo -H -u jenkins $GRADLE_HOME/bin/gradle -p /var/lib/jenkins/gradledeps -g /var/lib/jenkins/.gradle --refresh-dependencies --debug --stacktrace assemble
|
||||
|
||||
chown -R jenkins /var/lib/jenkins/.gradle
|
||||
chgrp -R jenkins /var/lib/jenkins/.gradle
|
||||
|
||||
@ -11,18 +11,14 @@ install_ubuntu() {
|
||||
# "$UBUNTU_VERSION" == "18.04"
|
||||
if [[ "$UBUNTU_VERSION" == "18.04"* ]]; then
|
||||
cmake3="cmake=3.10*"
|
||||
maybe_libiomp_dev="libiomp-dev"
|
||||
elif [[ "$UBUNTU_VERSION" == "20.04"* ]]; then
|
||||
cmake3="cmake=3.16*"
|
||||
maybe_libiomp_dev=""
|
||||
else
|
||||
cmake3="cmake=3.5*"
|
||||
maybe_libiomp_dev="libiomp-dev"
|
||||
fi
|
||||
|
||||
# Install common dependencies
|
||||
apt-get update
|
||||
# TODO: Some of these may not be necessary
|
||||
# TODO: libiomp also gets installed by conda, aka there's a conflict
|
||||
ccache_deps="asciidoc docbook-xml docbook-xsl xsltproc"
|
||||
numpy_deps="gfortran"
|
||||
apt-get install -y --no-install-recommends \
|
||||
@ -38,20 +34,26 @@ install_ubuntu() {
|
||||
git \
|
||||
libatlas-base-dev \
|
||||
libc6-dbg \
|
||||
${maybe_libiomp_dev} \
|
||||
libiomp-dev \
|
||||
libyaml-dev \
|
||||
libz-dev \
|
||||
libjpeg-dev \
|
||||
libasound2-dev \
|
||||
libsndfile-dev \
|
||||
python \
|
||||
python-dev \
|
||||
python-setuptools \
|
||||
python-wheel \
|
||||
software-properties-common \
|
||||
sudo \
|
||||
wget \
|
||||
vim
|
||||
|
||||
# Should resolve issues related to various apt package repository cert issues
|
||||
# see: https://github.com/pytorch/pytorch/issues/65931
|
||||
apt-get install -y libgnutls30
|
||||
# TODO: THIS IS A HACK!!!
|
||||
# distributed nccl(2) tests are a bit busted, see https://github.com/pytorch/pytorch/issues/5877
|
||||
if dpkg -s libnccl-dev; then
|
||||
apt-get remove -y libnccl-dev libnccl2 --allow-change-held-packages
|
||||
fi
|
||||
|
||||
# Cleanup package manager
|
||||
apt-get autoclean && apt-get clean
|
||||
@ -86,7 +88,6 @@ install_centos() {
|
||||
glog-devel \
|
||||
hiredis-devel \
|
||||
libstdc++-devel \
|
||||
libsndfile-devel \
|
||||
make \
|
||||
opencv-devel \
|
||||
sudo \
|
||||
@ -118,11 +119,14 @@ esac
|
||||
# Install Valgrind separately since the apt-get version is too old.
|
||||
mkdir valgrind_build && cd valgrind_build
|
||||
VALGRIND_VERSION=3.16.1
|
||||
wget https://ossci-linux.s3.amazonaws.com/valgrind-${VALGRIND_VERSION}.tar.bz2
|
||||
if ! wget http://valgrind.org/downloads/valgrind-${VALGRIND_VERSION}.tar.bz2
|
||||
then
|
||||
wget https://sourceware.org/ftp/valgrind/valgrind-${VALGRIND_VERSION}.tar.bz2
|
||||
fi
|
||||
tar -xjf valgrind-${VALGRIND_VERSION}.tar.bz2
|
||||
cd valgrind-${VALGRIND_VERSION}
|
||||
./configure --prefix=/usr/local
|
||||
make -j6
|
||||
make -j 4
|
||||
sudo make install
|
||||
cd ../../
|
||||
rm -rf valgrind_build
|
||||
|
||||
@ -2,28 +2,6 @@
|
||||
|
||||
set -ex
|
||||
|
||||
install_ubuntu() {
|
||||
echo "Preparing to build sccache from source"
|
||||
apt-get update
|
||||
apt-get install -y cargo pkg-config libssl-dev
|
||||
echo "Checking out sccache repo"
|
||||
git clone https://github.com/pytorch/sccache
|
||||
cd sccache
|
||||
echo "Building sccache"
|
||||
cargo build --release
|
||||
cp target/release/sccache /opt/cache/bin
|
||||
echo "Cleaning up"
|
||||
cd ..
|
||||
rm -rf sccache
|
||||
apt-get remove -y cargo rustc
|
||||
apt-get autoclean && apt-get clean
|
||||
}
|
||||
|
||||
install_binary() {
|
||||
echo "Downloading sccache binary from S3 repo"
|
||||
curl --retry 3 https://s3.amazonaws.com/ossci-linux/sccache -o /opt/cache/bin/sccache
|
||||
}
|
||||
|
||||
mkdir -p /opt/cache/bin
|
||||
mkdir -p /opt/cache/lib
|
||||
sed -e 's|PATH="\(.*\)"|PATH="/opt/cache/bin:\1"|g' -i /etc/environment
|
||||
@ -33,20 +11,12 @@ export PATH="/opt/cache/bin:$PATH"
|
||||
if [ -n "$ROCM_VERSION" ]; then
|
||||
curl --retry 3 http://repo.radeon.com/misc/.sccache_amd/sccache -o /opt/cache/bin/sccache
|
||||
else
|
||||
ID=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
|
||||
case "$ID" in
|
||||
ubuntu)
|
||||
install_ubuntu
|
||||
;;
|
||||
*)
|
||||
install_binary
|
||||
;;
|
||||
esac
|
||||
curl --retry 3 https://s3.amazonaws.com/ossci-linux/sccache -o /opt/cache/bin/sccache
|
||||
fi
|
||||
chmod a+x /opt/cache/bin/sccache
|
||||
|
||||
function write_sccache_stub() {
|
||||
printf "#!/bin/sh\nif [ \$(ps -p \$PPID -o comm=) != sccache ]; then\n exec sccache $(which $1) \"\$@\"\nelse\n exec $(which $1) \"\$@\"\nfi" > "/opt/cache/bin/$1"
|
||||
printf "#!/bin/sh\nexec sccache $(which $1) \$*" > "/opt/cache/bin/$1"
|
||||
chmod a+x "/opt/cache/bin/$1"
|
||||
}
|
||||
|
||||
@ -68,8 +38,8 @@ if [ -n "$CUDA_VERSION" ]; then
|
||||
# where CUDA is installed. Instead, we install an nvcc symlink outside
|
||||
# of the PATH, and set CUDA_NVCC_EXECUTABLE so that we make use of it.
|
||||
|
||||
write_sccache_stub nvcc
|
||||
mv /opt/cache/bin/nvcc /opt/cache/lib/
|
||||
printf "#!/bin/sh\nexec sccache $(which nvcc) \"\$@\"" > /opt/cache/lib/nvcc
|
||||
chmod a+x /opt/cache/lib/nvcc
|
||||
fi
|
||||
|
||||
if [ -n "$ROCM_VERSION" ]; then
|
||||
@ -87,8 +57,8 @@ if [ -n "$ROCM_VERSION" ]; then
|
||||
TOPDIR=$(dirname $OLDCOMP)
|
||||
WRAPPED="$TOPDIR/original/$COMPNAME"
|
||||
mv "$OLDCOMP" "$WRAPPED"
|
||||
printf "#!/bin/sh\nexec sccache $WRAPPED \"\$@\"" > "$OLDCOMP"
|
||||
chmod a+x "$OLDCOMP"
|
||||
printf "#!/bin/sh\nexec sccache $WRAPPED \$*" > "$OLDCOMP"
|
||||
chmod a+x "$1"
|
||||
}
|
||||
|
||||
if [[ -e "/opt/rocm/hcc/bin/hcc" ]]; then
|
||||
|
||||
@ -4,9 +4,6 @@ set -ex
|
||||
|
||||
[ -n "$CMAKE_VERSION" ]
|
||||
|
||||
# Remove system cmake install so it won't get used instead
|
||||
apt-get remove cmake -y
|
||||
|
||||
# Turn 3.6.3 into v3.6
|
||||
path=$(echo "${CMAKE_VERSION}" | sed -e 's/\([0-9].[0-9]\+\).*/v\1/')
|
||||
file="cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
|
||||
|
||||
@ -13,12 +13,7 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
|
||||
CONDA_FILE="Miniconda2-latest-Linux-x86_64.sh"
|
||||
;;
|
||||
3)
|
||||
if [ "$ANACONDA_PYTHON_VERSION" = "3.6" ]; then
|
||||
# Latest release of Conda that still supports python-3.6
|
||||
CONDA_FILE="Miniconda3-py37_4.10.3-Linux-x86_64.sh"
|
||||
else
|
||||
CONDA_FILE="Miniconda3-latest-Linux-x86_64.sh"
|
||||
fi
|
||||
CONDA_FILE="Miniconda3-latest-Linux-x86_64.sh"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported ANACONDA_PYTHON_VERSION: $ANACONDA_PYTHON_VERSION"
|
||||
@ -61,9 +56,7 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
|
||||
pushd /opt/conda
|
||||
|
||||
# Track latest conda update
|
||||
if [ "$ANACONDA_PYTHON_VERSION" != "3.6" ]; then
|
||||
as_jenkins conda update -y -n base conda
|
||||
fi
|
||||
as_jenkins conda update -y -n base conda
|
||||
|
||||
# Install correct Python version
|
||||
as_jenkins conda install -y python="$ANACONDA_PYTHON_VERSION"
|
||||
@ -76,62 +69,37 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
|
||||
}
|
||||
|
||||
# Install PyTorch conda deps, as per https://github.com/pytorch/pytorch README
|
||||
# DO NOT install cmake here as it would install a version newer than 3.10, but
|
||||
# we want to pin to version 3.10.
|
||||
SCIPY_VERSION=1.1.0
|
||||
if [ "$ANACONDA_PYTHON_VERSION" = "3.9" ]; then
|
||||
# DO NOT install cmake here as it would install a version newer than 3.5, but
|
||||
# we want to pin to version 3.5.
|
||||
if [ "$ANACONDA_PYTHON_VERSION" = "3.8" ]; then
|
||||
# DO NOT install typing if installing python-3.8, since its part of python-3.8 core packages
|
||||
# Install llvm-8 as it is required to compile llvmlite-0.30.0 from source
|
||||
conda_install numpy=1.19.2 astunparse pyyaml mkl mkl-include setuptools cffi future six llvmdev=8.0.0 -c conda-forge
|
||||
SCIPY_VERSION=1.6.0
|
||||
elif [ "$ANACONDA_PYTHON_VERSION" = "3.8" ]; then
|
||||
# Install llvm-8 as it is required to compile llvmlite-0.30.0 from source
|
||||
conda_install numpy=1.18.5 astunparse pyyaml mkl mkl-include setuptools cffi future six llvmdev=8.0.0
|
||||
elif [ "$ANACONDA_PYTHON_VERSION" = "3.7" ]; then
|
||||
# DO NOT install dataclasses if installing python-3.7, since its part of python-3.7 core packages
|
||||
conda_install numpy=1.18.5 astunparse pyyaml mkl mkl-include setuptools cffi future six typing_extensions
|
||||
conda_install numpy=1.18.5 pyyaml mkl mkl-include setuptools cffi future six llvmdev=8.0.0 dataclasses
|
||||
else
|
||||
conda_install numpy=1.18.5 astunparse pyyaml mkl mkl-include setuptools cffi future six dataclasses typing_extensions
|
||||
conda_install numpy=1.18.5 pyyaml mkl mkl-include setuptools cffi typing future six dataclasses
|
||||
fi
|
||||
|
||||
# Magma package names are concatenation of CUDA major and minor ignoring revision
|
||||
# I.e. magma-cuda102 package corresponds to CUDA_VERSION=10.2 and CUDA_VERSION=10.2.89
|
||||
if [ -n "$CUDA_VERSION" ]; then
|
||||
conda_install magma-cuda$(TMP=${CUDA_VERSION/./};echo ${TMP%.*[0-9]}) -c pytorch
|
||||
if [[ "$CUDA_VERSION" == 9.2* ]]; then
|
||||
conda_install magma-cuda92 -c pytorch
|
||||
elif [[ "$CUDA_VERSION" == 10.0* ]]; then
|
||||
conda_install magma-cuda100 -c pytorch
|
||||
elif [[ "$CUDA_VERSION" == 10.1* ]]; then
|
||||
conda_install magma-cuda101 -c pytorch
|
||||
elif [[ "$CUDA_VERSION" == 10.2* ]]; then
|
||||
conda_install magma-cuda102 -c pytorch
|
||||
elif [[ "$CUDA_VERSION" == 11.0* ]]; then
|
||||
conda_install magma-cuda110 -c pytorch
|
||||
fi
|
||||
|
||||
# TODO: This isn't working atm
|
||||
conda_install nnpack -c killeent
|
||||
|
||||
# Install some other packages, including those needed for Python test reporting
|
||||
# Install some other packages
|
||||
# TODO: Why is scipy pinned
|
||||
# Pin MyPy version because new errors are likely to appear with each release
|
||||
# Pin hypothesis to avoid flakiness: https://github.com/pytorch/pytorch/issues/31136
|
||||
as_jenkins pip install --progress-bar off pytest \
|
||||
scipy==$SCIPY_VERSION \
|
||||
scikit-image \
|
||||
psutil \
|
||||
unittest-xml-reporting \
|
||||
boto3==1.16.34 \
|
||||
hypothesis==4.53.2 \
|
||||
expecttest==0.1.3 \
|
||||
mypy==0.812 \
|
||||
tb-nightly
|
||||
|
||||
# Install numba only on python-3.8 or below
|
||||
# For numba issue see https://github.com/pytorch/pytorch/issues/51511
|
||||
if [[ $(python -c "import sys; print(int(sys.version_info < (3, 9)))") == "1" ]]; then
|
||||
as_jenkins pip install --progress-bar off numba==0.54.1 librosa>=0.6.2
|
||||
else
|
||||
as_jenkins pip install --progress-bar off numba==0.49.0 librosa>=0.6.2
|
||||
fi
|
||||
|
||||
# Update scikit-learn to a python-3.8 compatible version
|
||||
if [[ $(python -c "import sys; print(int(sys.version_info >= (3, 8)))") == "1" ]]; then
|
||||
as_jenkins pip install --progress-bar off -U scikit-learn
|
||||
else
|
||||
# Pinned scikit-learn due to https://github.com/scikit-learn/scikit-learn/issues/14485 (affects gcc 5.5 only)
|
||||
as_jenkins pip install --progress-bar off scikit-learn==0.20.3
|
||||
fi
|
||||
# numba & llvmlite is pinned because of https://github.com/numba/numba/issues/4368
|
||||
# scikit-learn is pinned because of
|
||||
# https://github.com/scikit-learn/scikit-learn/issues/14485 (affects gcc 5.5
|
||||
# only)
|
||||
as_jenkins pip install --progress-bar off pytest scipy==1.1.0 scikit-learn==0.20.3 scikit-image librosa>=0.6.2 psutil numba==0.46.0 llvmlite==0.30.0
|
||||
|
||||
popd
|
||||
fi
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
sudo apt-get update
|
||||
# also install ssh to avoid error of:
|
||||
# --------------------------------------------------------------------------
|
||||
# The value of the MCA parameter "plm_rsh_agent" was set to a path
|
||||
# that could not be found:
|
||||
# plm_rsh_agent: ssh : rsh
|
||||
sudo apt-get install -y ssh
|
||||
sudo apt-get update && apt-get install -y --no-install-recommends libcudnn8=8.2.0.53-1+cuda11.3 libcudnn8-dev=8.2.0.53-1+cuda11.3 && apt-mark hold libcudnn8
|
||||
@ -2,6 +2,23 @@
|
||||
|
||||
set -ex
|
||||
|
||||
# This function installs protobuf 2.6
|
||||
install_protobuf_26() {
|
||||
pb_dir="/usr/temp_pb_install_dir"
|
||||
mkdir -p $pb_dir
|
||||
|
||||
# On the nvidia/cuda:9-cudnn7-devel-centos7 image we need this symlink or
|
||||
# else it will fail with
|
||||
# g++: error: ./../lib64/crti.o: No such file or directory
|
||||
ln -s /usr/lib64 "$pb_dir/lib64"
|
||||
|
||||
curl -LO "https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz"
|
||||
tar -xvz -C "$pb_dir" --strip-components 1 -f protobuf-2.6.1.tar.gz
|
||||
pushd "$pb_dir" && ./configure && make && make check && sudo make install && sudo ldconfig
|
||||
popd
|
||||
rm -rf $pb_dir
|
||||
}
|
||||
|
||||
install_ubuntu() {
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends \
|
||||
|
||||
@ -7,18 +7,14 @@ if [ -n "$GCC_VERSION" ]; then
|
||||
# Need the official toolchain repo to get alternate packages
|
||||
add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
apt-get update
|
||||
if [[ "$UBUNTU_VERSION" == "16.04" && "${GCC_VERSION:0:1}" == "5" ]]; then
|
||||
if [ "$UBUNTU_VERSION" = "16.04" -a "$GCC_VERSION" = "5" ]; then
|
||||
apt-get install -y g++-5=5.4.0-6ubuntu1~16.04.12
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50
|
||||
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 50
|
||||
update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-5 50
|
||||
else
|
||||
apt-get install -y g++-$GCC_VERSION
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-"$GCC_VERSION" 50
|
||||
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-"$GCC_VERSION" 50
|
||||
update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-"$GCC_VERSION" 50
|
||||
fi
|
||||
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-"$GCC_VERSION" 50
|
||||
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-"$GCC_VERSION" 50
|
||||
|
||||
# Cleanup package manager
|
||||
apt-get autoclean && apt-get clean
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
git clone --branch v1.15 https://github.com/linux-test-project/lcov.git
|
||||
pushd lcov
|
||||
sudo make install # will be installed in /usr/local/bin/lcov
|
||||
popd
|
||||
@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
sudo apt-get update
|
||||
# also install ssh to avoid error of:
|
||||
# --------------------------------------------------------------------------
|
||||
# The value of the MCA parameter "plm_rsh_agent" was set to a path
|
||||
# that could not be found:
|
||||
# plm_rsh_agent: ssh : rsh
|
||||
sudo apt-get install -y ssh
|
||||
sudo apt-get install -y --allow-downgrades --allow-change-held-packages openmpi-bin libopenmpi-dev
|
||||
@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
OPENSSL=openssl-1.1.1k
|
||||
|
||||
wget -q -O "${OPENSSL}.tar.gz" "https://ossci-linux.s3.amazonaws.com/${OPENSSL}.tar.gz"
|
||||
tar xf "${OPENSSL}.tar.gz"
|
||||
cd "${OPENSSL}"
|
||||
./config --prefix=/opt/openssl -d '-Wl,--enable-new-dtags,-rpath,$(LIBRPATH)'
|
||||
# NOTE: openssl install errors out when built with the -j option
|
||||
make -j6; make install_sw
|
||||
cd ..
|
||||
rm -rf "${OPENSSL}"
|
||||
@ -2,8 +2,8 @@
|
||||
|
||||
set -ex
|
||||
|
||||
# This function installs protobuf 3.17
|
||||
install_protobuf_317() {
|
||||
# This function installs protobuf 2.6
|
||||
install_protobuf_26() {
|
||||
pb_dir="/usr/temp_pb_install_dir"
|
||||
mkdir -p $pb_dir
|
||||
|
||||
@ -12,32 +12,37 @@ install_protobuf_317() {
|
||||
# g++: error: ./../lib64/crti.o: No such file or directory
|
||||
ln -s /usr/lib64 "$pb_dir/lib64"
|
||||
|
||||
curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protobuf-all-3.17.3.tar.gz"
|
||||
tar -xvz -C "$pb_dir" --strip-components 1 -f protobuf-all-3.17.3.tar.gz
|
||||
# -j6 to balance memory usage and speed.
|
||||
# naked `-j` seems to use too much memory.
|
||||
pushd "$pb_dir" && ./configure && make -j6 && make -j6 check && sudo make -j6 install && sudo ldconfig
|
||||
curl -LO "https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz"
|
||||
tar -xvz -C "$pb_dir" --strip-components 1 -f protobuf-2.6.1.tar.gz
|
||||
pushd "$pb_dir" && ./configure && make && make check && sudo make install && sudo ldconfig
|
||||
popd
|
||||
rm -rf $pb_dir
|
||||
}
|
||||
|
||||
install_ubuntu() {
|
||||
# Ubuntu 14.04 has cmake 2.8.12 as the default option, so we will
|
||||
# Ubuntu 14.04 ships with protobuf 2.5, but ONNX needs protobuf >= 2.6
|
||||
# so we install that here if on 14.04
|
||||
# Ubuntu 14.04 also has cmake 2.8.12 as the default option, so we will
|
||||
# install cmake3 here and use cmake3.
|
||||
apt-get update
|
||||
if [[ "$UBUNTU_VERSION" == 14.04 ]]; then
|
||||
apt-get install -y --no-install-recommends cmake3
|
||||
install_protobuf_26
|
||||
else
|
||||
apt-get install -y --no-install-recommends \
|
||||
libprotobuf-dev \
|
||||
protobuf-compiler
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
apt-get autoclean && apt-get clean
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
install_protobuf_317
|
||||
}
|
||||
|
||||
install_centos() {
|
||||
install_protobuf_317
|
||||
# Centos7 ships with protobuf 2.5, but ONNX needs protobuf >= 2.6
|
||||
# so we always install install that here
|
||||
install_protobuf_26
|
||||
}
|
||||
|
||||
# Install base packages depending on the base OS
|
||||
|
||||
@ -2,80 +2,36 @@
|
||||
|
||||
set -ex
|
||||
|
||||
install_magma() {
|
||||
# "install" hipMAGMA into /opt/rocm/magma by copying after build
|
||||
git clone https://bitbucket.org/icl/magma.git
|
||||
pushd magma
|
||||
# fix for magma_queue memory leak issue
|
||||
git checkout c62d700d880c7283b33fb1d615d62fc9c7f7ca21
|
||||
cp make.inc-examples/make.inc.hip-gcc-mkl make.inc
|
||||
echo 'LIBDIR += -L$(MKLROOT)/lib' >> make.inc
|
||||
echo 'LIB += -Wl,--enable-new-dtags -Wl,--rpath,/opt/rocm/lib -Wl,--rpath,$(MKLROOT)/lib -Wl,--rpath,/opt/rocm/magma/lib' >> make.inc
|
||||
echo 'DEVCCFLAGS += --gpu-max-threads-per-block=256' >> make.inc
|
||||
export PATH="${PATH}:/opt/rocm/bin"
|
||||
if [[ -n "$PYTORCH_ROCM_ARCH" ]]; then
|
||||
amdgpu_targets=`echo $PYTORCH_ROCM_ARCH | sed 's/;/ /g'`
|
||||
else
|
||||
amdgpu_targets=`rocm_agent_enumerator | grep -v gfx000 | sort -u | xargs`
|
||||
fi
|
||||
for arch in $amdgpu_targets; do
|
||||
echo "DEVCCFLAGS += --amdgpu-target=$arch" >> make.inc
|
||||
done
|
||||
# hipcc with openmp flag may cause isnan() on __device__ not to be found; depending on context, compiler may attempt to match with host definition
|
||||
sed -i 's/^FOPENMP/#FOPENMP/g' make.inc
|
||||
make -f make.gen.hipMAGMA -j $(nproc)
|
||||
LANG=C.UTF-8 make lib/libmagma.so -j $(nproc) MKLROOT=/opt/conda
|
||||
make testing/testing_dgemm -j $(nproc) MKLROOT=/opt/conda
|
||||
popd
|
||||
mv magma /opt/rocm
|
||||
}
|
||||
|
||||
ver() {
|
||||
printf "%3d%03d%03d%03d" $(echo "$1" | tr '.' ' ');
|
||||
}
|
||||
|
||||
# Map ROCm version to AMDGPU version
|
||||
declare -A AMDGPU_VERSIONS=( ["4.5.2"]="21.40.2" )
|
||||
|
||||
install_ubuntu() {
|
||||
apt-get update
|
||||
if [[ $UBUNTU_VERSION == 18.04 ]]; then
|
||||
# gpg-agent is not available by default on 18.04
|
||||
apt-get install -y --no-install-recommends gpg-agent
|
||||
fi
|
||||
if [[ $UBUNTU_VERSION == 20.04 ]]; then
|
||||
# gpg-agent is not available by default on 20.04
|
||||
apt-get install -y --no-install-recommends gpg-agent
|
||||
fi
|
||||
apt-get install -y kmod
|
||||
apt-get install -y wget
|
||||
apt-get install -y libopenblas-dev
|
||||
|
||||
# Need the libc++1 and libc++abi1 libraries to allow torch._C to load at runtime
|
||||
apt-get install -y libc++1
|
||||
apt-get install -y libc++abi1
|
||||
|
||||
if [[ $(ver $ROCM_VERSION) -ge $(ver 4.5) ]]; then
|
||||
# Add amdgpu repository
|
||||
UBUNTU_VERSION_NAME=`cat /etc/os-release | grep UBUNTU_CODENAME | awk -F= '{print $2}'`
|
||||
local amdgpu_baseurl="https://repo.radeon.com/amdgpu/${AMDGPU_VERSIONS[$ROCM_VERSION]}/ubuntu"
|
||||
echo "deb [arch=amd64] ${amdgpu_baseurl} ${UBUNTU_VERSION_NAME} main" > /etc/apt/sources.list.d/amdgpu.list
|
||||
fi
|
||||
|
||||
ROCM_REPO="ubuntu"
|
||||
if [[ $(ver $ROCM_VERSION) -lt $(ver 4.2) ]]; then
|
||||
ROCM_REPO="xenial"
|
||||
fi
|
||||
|
||||
DEB_ROCM_REPO=http://repo.radeon.com/rocm/apt/${ROCM_VERSION}
|
||||
# Add rocm repository
|
||||
wget -qO - http://repo.radeon.com/rocm/rocm.gpg.key | apt-key add -
|
||||
local rocm_baseurl="http://repo.radeon.com/rocm/apt/${ROCM_VERSION}"
|
||||
echo "deb [arch=amd64] ${rocm_baseurl} ${ROCM_REPO} main" > /etc/apt/sources.list.d/rocm.list
|
||||
wget -qO - $DEB_ROCM_REPO/rocm.gpg.key | apt-key add -
|
||||
echo "deb [arch=amd64] $DEB_ROCM_REPO xenial main" > /etc/apt/sources.list.d/rocm.list
|
||||
apt-get update --allow-insecure-repositories
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
|
||||
rocm-dev \
|
||||
rocm-utils \
|
||||
rocm-libs \
|
||||
rocfft \
|
||||
miopen-hip \
|
||||
rocblas \
|
||||
hipsparse \
|
||||
rocrand \
|
||||
hipcub \
|
||||
rocthrust \
|
||||
rccl \
|
||||
rocprofiler-dev \
|
||||
roctracer-dev
|
||||
@ -89,11 +45,9 @@ install_ubuntu() {
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated ${MIOPENKERNELS}
|
||||
fi
|
||||
|
||||
install_magma
|
||||
|
||||
# Cleanup
|
||||
apt-get autoclean && apt-get clean
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
# Cleanup
|
||||
apt-get autoclean && apt-get clean
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
}
|
||||
|
||||
install_centos() {
|
||||
@ -106,37 +60,28 @@ install_centos() {
|
||||
yum install -y epel-release
|
||||
yum install -y dkms kernel-headers-`uname -r` kernel-devel-`uname -r`
|
||||
|
||||
if [[ $(ver $ROCM_VERSION) -ge $(ver 4.5) ]]; then
|
||||
# Add amdgpu repository
|
||||
local amdgpu_baseurl="https://repo.radeon.com/amdgpu/${AMDGPU_VERSIONS[$ROCM_VERSION]}/rhel/7.9/main/x86_64"
|
||||
echo "[AMDGPU]" > /etc/yum.repos.d/amdgpu.repo
|
||||
echo "name=AMDGPU" >> /etc/yum.repos.d/amdgpu.repo
|
||||
echo "baseurl=${amdgpu_baseurl}" >> /etc/yum.repos.d/amdgpu.repo
|
||||
echo "enabled=1" >> /etc/yum.repos.d/amdgpu.repo
|
||||
echo "gpgcheck=1" >> /etc/yum.repos.d/amdgpu.repo
|
||||
echo "gpgkey=http://repo.radeon.com/rocm/rocm.gpg.key" >> /etc/yum.repos.d/amdgpu.repo
|
||||
fi
|
||||
|
||||
local rocm_baseurl="http://repo.radeon.com/rocm/yum/${ROCM_VERSION}"
|
||||
echo "[ROCm]" > /etc/yum.repos.d/rocm.repo
|
||||
echo "name=ROCm" >> /etc/yum.repos.d/rocm.repo
|
||||
echo "baseurl=${rocm_baseurl}" >> /etc/yum.repos.d/rocm.repo
|
||||
echo "baseurl=http://repo.radeon.com/rocm/yum/${ROCM_VERSION}" >> /etc/yum.repos.d/rocm.repo
|
||||
echo "enabled=1" >> /etc/yum.repos.d/rocm.repo
|
||||
echo "gpgcheck=1" >> /etc/yum.repos.d/rocm.repo
|
||||
echo "gpgkey=http://repo.radeon.com/rocm/rocm.gpg.key" >> /etc/yum.repos.d/rocm.repo
|
||||
echo "gpgcheck=0" >> /etc/yum.repos.d/rocm.repo
|
||||
|
||||
yum update -y
|
||||
|
||||
yum install -y \
|
||||
rocm-dev \
|
||||
rocm-utils \
|
||||
rocm-libs \
|
||||
rocfft \
|
||||
miopen-hip \
|
||||
rocblas \
|
||||
hipsparse \
|
||||
rocrand \
|
||||
rccl \
|
||||
hipcub \
|
||||
rocthrust \
|
||||
rocprofiler-dev \
|
||||
roctracer-dev
|
||||
|
||||
install_magma
|
||||
|
||||
# Cleanup
|
||||
yum clean all
|
||||
rm -rf /var/cache/yum
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -n "$TENSORRT_VERSION" ]; then
|
||||
python3 -m pip install --upgrade setuptools pip
|
||||
python3 -m pip install nvidia-pyindex
|
||||
python3 -m pip install nvidia-tensorrt==${TENSORRT_VERSION} --extra-index-url https://pypi.ngc.nvidia.com
|
||||
fi
|
||||
79
.circleci/docker/common/install_travis_python.sh
Executable file
79
.circleci/docker/common/install_travis_python.sh
Executable file
@ -0,0 +1,79 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
as_jenkins() {
|
||||
# NB: Preserve PATH and LD_LIBRARY_PATH changes
|
||||
sudo -H -u jenkins env "PATH=$PATH" "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" $*
|
||||
}
|
||||
|
||||
if [ -n "$TRAVIS_PYTHON_VERSION" ]; then
|
||||
|
||||
mkdir -p /opt/python
|
||||
chown jenkins:jenkins /opt/python
|
||||
|
||||
# Download Python binary from Travis
|
||||
pushd tmp
|
||||
as_jenkins wget --quiet ${TRAVIS_DL_URL_PREFIX}/python-$TRAVIS_PYTHON_VERSION.tar.bz2
|
||||
# NB: The tarball also comes with /home/travis virtualenv that we
|
||||
# don't care about. (Maybe we should, but we've worked around the
|
||||
# "how do I install to python" issue by making this entire directory
|
||||
# user-writable "lol")
|
||||
# NB: Relative ordering of opt/python and flags matters
|
||||
as_jenkins tar xjf python-$TRAVIS_PYTHON_VERSION.tar.bz2 --strip-components=2 --directory /opt/python opt/python
|
||||
popd
|
||||
|
||||
echo "/opt/python/$TRAVIS_PYTHON_VERSION/lib" > /etc/ld.so.conf.d/travis-python.conf
|
||||
ldconfig
|
||||
sed -e 's|PATH="\(.*\)"|PATH="/opt/python/'"$TRAVIS_PYTHON_VERSION"'/bin:\1"|g' -i /etc/environment
|
||||
export PATH="/opt/python/$TRAVIS_PYTHON_VERSION/bin:$PATH"
|
||||
|
||||
python --version
|
||||
pip --version
|
||||
|
||||
# Install pip from source.
|
||||
# The python-pip package on Ubuntu Trusty is old
|
||||
# and upon install numpy doesn't use the binary
|
||||
# distribution, and fails to compile it from source.
|
||||
pushd tmp
|
||||
as_jenkins curl -L -O https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz
|
||||
as_jenkins tar zxf pip-9.0.1.tar.gz
|
||||
pushd pip-9.0.1
|
||||
as_jenkins python setup.py install
|
||||
popd
|
||||
rm -rf pip-9.0.1*
|
||||
popd
|
||||
|
||||
# Install pip packages
|
||||
as_jenkins pip install --upgrade pip
|
||||
|
||||
pip --version
|
||||
|
||||
as_jenkins pip install numpy pyyaml
|
||||
|
||||
as_jenkins pip install \
|
||||
future \
|
||||
hypothesis \
|
||||
protobuf \
|
||||
pytest \
|
||||
pillow \
|
||||
typing \
|
||||
dataclasses
|
||||
|
||||
as_jenkins pip install mkl mkl-devel
|
||||
|
||||
# SciPy does not support Python 3.7 or Python 2.7.9
|
||||
if [[ "$TRAVIS_PYTHON_VERSION" != nightly ]] && [[ "$TRAVIS_PYTHON_VERSION" != "2.7.9" ]]; then
|
||||
as_jenkins pip install scipy==1.1.0 scikit-image librosa>=0.6.2
|
||||
fi
|
||||
|
||||
# Install psutil for dataloader tests
|
||||
as_jenkins pip install psutil
|
||||
|
||||
# Install dill for serialization tests
|
||||
as_jenkins pip install "dill>=0.3.1"
|
||||
|
||||
# Cleanup package manager
|
||||
apt-get autoclean && apt-get clean
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
fi
|
||||
@ -2,6 +2,23 @@
|
||||
|
||||
set -ex
|
||||
|
||||
# This function installs protobuf 2.6
|
||||
install_protobuf_26() {
|
||||
pb_dir="/usr/temp_pb_install_dir"
|
||||
mkdir -p $pb_dir
|
||||
|
||||
# On the nvidia/cuda:9-cudnn7-devel-centos7 image we need this symlink or
|
||||
# else it will fail with
|
||||
# g++: error: ./../lib64/crti.o: No such file or directory
|
||||
ln -s /usr/lib64 "$pb_dir/lib64"
|
||||
|
||||
curl -LO "https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz"
|
||||
tar -xvz -C "$pb_dir" --strip-components 1 -f protobuf-2.6.1.tar.gz
|
||||
pushd "$pb_dir" && ./configure && make && make check && sudo make install && sudo ldconfig
|
||||
popd
|
||||
rm -rf $pb_dir
|
||||
}
|
||||
|
||||
install_ubuntu() {
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends \
|
||||
|
||||
@ -8,17 +8,16 @@ retry () {
|
||||
$* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)
|
||||
}
|
||||
|
||||
_https_amazon_aws=https://ossci-android.s3.amazonaws.com
|
||||
|
||||
_vulkansdk_dir=/var/lib/jenkins/vulkansdk
|
||||
mkdir -p $_vulkansdk_dir
|
||||
_tmp_vulkansdk_targz=/tmp/vulkansdk.tar.gz
|
||||
curl --silent --show-error --location --fail --retry 3 \
|
||||
--output "$_tmp_vulkansdk_targz" "$_https_amazon_aws/vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.gz"
|
||||
|
||||
curl \
|
||||
--silent \
|
||||
--show-error \
|
||||
--location \
|
||||
--fail \
|
||||
--retry 3 \
|
||||
--output "${_tmp_vulkansdk_targz}" "https://ossci-android.s3.amazonaws.com/vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.gz"
|
||||
tar -C "$_vulkansdk_dir" -xzf "$_tmp_vulkansdk_targz" --strip-components 1
|
||||
|
||||
mkdir -p "${_vulkansdk_dir}"
|
||||
tar -C "${_vulkansdk_dir}" -xzf "${_tmp_vulkansdk_targz}" --strip-components 1
|
||||
rm -rf "${_tmp_vulkansdk_targz}"
|
||||
export VULKAN_SDK="$_vulkansdk_dir/"
|
||||
|
||||
rm "$_tmp_vulkansdk_targz"
|
||||
|
||||
@ -1,14 +1,12 @@
|
||||
ARG UBUNTU_VERSION
|
||||
ARG CUDA_VERSION
|
||||
ARG CUDNN_VERSION
|
||||
ARG IMAGE_NAME
|
||||
|
||||
FROM ${IMAGE_NAME}
|
||||
|
||||
ARG UBUNTU_VERSION
|
||||
ARG CUDA_VERSION
|
||||
ARG CUDNN_VERSION
|
||||
|
||||
FROM nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel-ubuntu${UBUNTU_VERSION}
|
||||
|
||||
ARG UBUNTU_VERSION
|
||||
ARG CUDA_VERSION
|
||||
ARG CUDNN_VERSION
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
@ -26,7 +24,7 @@ ARG KATEX
|
||||
ADD ./common/install_katex.sh install_katex.sh
|
||||
RUN bash ./install_katex.sh && rm install_katex.sh
|
||||
|
||||
# Install conda and other packages (e.g., numpy, pytest)
|
||||
# Install conda
|
||||
ENV PATH /opt/conda/bin:$PATH
|
||||
ARG ANACONDA_PYTHON_VERSION
|
||||
ADD ./common/install_conda.sh install_conda.sh
|
||||
@ -42,6 +40,12 @@ ARG CLANG_VERSION
|
||||
ADD ./common/install_clang.sh install_clang.sh
|
||||
RUN bash ./install_clang.sh && rm install_clang.sh
|
||||
|
||||
# Install non-standard Python versions (via Travis binaries)
|
||||
ARG TRAVIS_PYTHON_VERSION
|
||||
ENV PATH /opt/python/$TRAVIS_PYTHON_VERSION/bin:$PATH
|
||||
ADD ./common/install_travis_python.sh install_travis_python.sh
|
||||
RUN bash ./install_travis_python.sh && rm install_travis_python.sh
|
||||
|
||||
# (optional) Install protobuf for ONNX
|
||||
ARG PROTOBUF
|
||||
ADD ./common/install_protobuf.sh install_protobuf.sh
|
||||
@ -63,38 +67,17 @@ RUN if [ -n "${VISION}" ]; then bash ./install_vision.sh; fi
|
||||
RUN rm install_vision.sh
|
||||
ENV INSTALLED_VISION ${VISION}
|
||||
|
||||
ADD ./common/install_openssl.sh install_openssl.sh
|
||||
ENV OPENSSL_ROOT_DIR /opt/openssl
|
||||
RUN bash ./install_openssl.sh
|
||||
|
||||
# (optional) Install TensorRT
|
||||
ARG TENSORRT_VERSION
|
||||
ADD ./common/install_tensorrt.sh install_tensorrt.sh
|
||||
RUN if [ -n "${TENSORRT_VERSION}" ]; then bash ./install_tensorrt.sh; fi
|
||||
RUN rm install_tensorrt.sh
|
||||
|
||||
# (optional) Install non-default CMake version
|
||||
ARG CMAKE_VERSION
|
||||
ADD ./common/install_cmake.sh install_cmake.sh
|
||||
RUN if [ -n "${CMAKE_VERSION}" ]; then bash ./install_cmake.sh; fi
|
||||
RUN rm install_cmake.sh
|
||||
|
||||
# Install ccache/sccache (do this last, so we get priority in PATH)
|
||||
ADD ./common/install_cache.sh install_cache.sh
|
||||
ENV PATH /opt/cache/bin:$PATH
|
||||
RUN bash ./install_cache.sh && rm install_cache.sh
|
||||
ENV CMAKE_CUDA_COMPILER_LAUNCHER=/opt/cache/bin/sccache
|
||||
ENV CUDA_NVCC_EXECUTABLE=/opt/cache/lib/nvcc
|
||||
|
||||
# Add jni.h for java host build
|
||||
ADD ./common/install_jni.sh install_jni.sh
|
||||
ADD ./java/jni.h jni.h
|
||||
RUN bash ./install_jni.sh && rm install_jni.sh
|
||||
|
||||
# Install Open MPI for CUDA
|
||||
ADD ./common/install_openmpi.sh install_openmpi.sh
|
||||
RUN if [ -n "${CUDA_VERSION}" ]; then bash install_openmpi.sh; fi
|
||||
RUN rm install_openmpi.sh
|
||||
|
||||
# Include BUILD_ENVIRONMENT environment variable in image
|
||||
ARG BUILD_ENVIRONMENT
|
||||
ENV BUILD_ENVIRONMENT ${BUILD_ENVIRONMENT}
|
||||
@ -102,17 +85,9 @@ ENV BUILD_ENVIRONMENT ${BUILD_ENVIRONMENT}
|
||||
# AWS specific CUDA build guidance
|
||||
ENV TORCH_CUDA_ARCH_LIST Maxwell
|
||||
ENV TORCH_NVCC_FLAGS "-Xfatbin -compress-all"
|
||||
ENV CUDA_PATH /usr/local/cuda
|
||||
|
||||
# Install LLVM dev version (Defined in the pytorch/builder github repository)
|
||||
COPY --from=pytorch/llvm:9.0.1 /opt/llvm /opt/llvm
|
||||
|
||||
# Hack for CUDA 11.5.0 image to install cudnn8 since cudnn8 is not included with CUDA 11.5 image
|
||||
# Also note cudnn 8.2.0.53 is labeled for cuda 11.3
|
||||
ARG INSTALL_CUDNN
|
||||
ADD ./common/install_cudnn8.sh install_cudnn8.sh
|
||||
RUN if [ -n "${INSTALL_CUDNN}" ]; then bash install_cudnn8.sh; fi
|
||||
RUN rm install_cudnn8.sh
|
||||
|
||||
USER jenkins
|
||||
CMD ["bash"]
|
||||
|
||||
@ -6,10 +6,6 @@ ARG UBUNTU_VERSION
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Set AMD gpu targets to build for
|
||||
ARG PYTORCH_ROCM_ARCH
|
||||
ENV PYTORCH_ROCM_ARCH ${PYTORCH_ROCM_ARCH}
|
||||
|
||||
# Install common dependencies (so that this step can be cached separately)
|
||||
ARG EC2
|
||||
ADD ./common/install_base.sh install_base.sh
|
||||
@ -25,17 +21,12 @@ RUN bash ./install_clang.sh && rm install_clang.sh
|
||||
ADD ./common/install_user.sh install_user.sh
|
||||
RUN bash ./install_user.sh && rm install_user.sh
|
||||
|
||||
# Install conda and other packages (e.g., numpy, pytest)
|
||||
# Install conda
|
||||
ENV PATH /opt/conda/bin:$PATH
|
||||
ARG ANACONDA_PYTHON_VERSION
|
||||
ADD ./common/install_conda.sh install_conda.sh
|
||||
RUN bash ./install_conda.sh && rm install_conda.sh
|
||||
|
||||
# Install gcc
|
||||
ARG GCC_VERSION
|
||||
ADD ./common/install_gcc.sh install_gcc.sh
|
||||
RUN bash ./install_gcc.sh && rm install_gcc.sh
|
||||
|
||||
# (optional) Install protobuf for ONNX
|
||||
ARG PROTOBUF
|
||||
ADD ./common/install_protobuf.sh install_protobuf.sh
|
||||
@ -67,7 +58,7 @@ ENV PATH /opt/rocm/hcc/bin:$PATH
|
||||
ENV PATH /opt/rocm/hip/bin:$PATH
|
||||
ENV PATH /opt/rocm/opencl/bin:$PATH
|
||||
ENV PATH /opt/rocm/llvm/bin:$PATH
|
||||
ENV MAGMA_HOME /opt/rocm/magma
|
||||
ENV HIP_PLATFORM hcc
|
||||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ ARG KATEX
|
||||
ADD ./common/install_katex.sh install_katex.sh
|
||||
RUN bash ./install_katex.sh && rm install_katex.sh
|
||||
|
||||
# Install conda and other packages (e.g., numpy, pytest)
|
||||
# Install conda
|
||||
ENV PATH /opt/conda/bin:$PATH
|
||||
ARG ANACONDA_PYTHON_VERSION
|
||||
ADD ./common/install_conda.sh install_conda.sh
|
||||
@ -44,9 +44,12 @@ ARG GCC_VERSION
|
||||
ADD ./common/install_gcc.sh install_gcc.sh
|
||||
RUN bash ./install_gcc.sh && rm install_gcc.sh
|
||||
|
||||
# Install lcov for C++ code coverage
|
||||
ADD ./common/install_lcov.sh install_lcov.sh
|
||||
RUN bash ./install_lcov.sh && rm install_lcov.sh
|
||||
# Install non-standard Python versions (via Travis binaries)
|
||||
ARG TRAVIS_PYTHON_VERSION
|
||||
ARG TRAVIS_DL_URL_PREFIX
|
||||
ENV PATH /opt/python/$TRAVIS_PYTHON_VERSION/bin:$PATH
|
||||
ADD ./common/install_travis_python.sh install_travis_python.sh
|
||||
RUN bash ./install_travis_python.sh && rm install_travis_python.sh
|
||||
|
||||
# (optional) Install protobuf for ONNX
|
||||
ARG PROTOBUF
|
||||
@ -106,10 +109,6 @@ ADD ./common/install_ninja.sh install_ninja.sh
|
||||
RUN if [ -n "${NINJA_VERSION}" ]; then bash ./install_ninja.sh; fi
|
||||
RUN rm install_ninja.sh
|
||||
|
||||
ADD ./common/install_openssl.sh install_openssl.sh
|
||||
RUN bash ./install_openssl.sh
|
||||
ENV OPENSSL_ROOT_DIR /opt/openssl
|
||||
|
||||
# Install ccache/sccache (do this last, so we get priority in PATH)
|
||||
ADD ./common/install_cache.sh install_cache.sh
|
||||
ENV PATH /opt/cache/bin:$PATH
|
||||
|
||||
13
.circleci/ecr_gc_docker/Dockerfile
Normal file
13
.circleci/ecr_gc_docker/Dockerfile
Normal file
@ -0,0 +1,13 @@
|
||||
FROM ubuntu:16.04
|
||||
|
||||
RUN apt-get update && apt-get install -y python-pip git && rm -rf /var/lib/apt/lists/* /var/log/dpkg.log
|
||||
|
||||
ADD requirements.txt /requirements.txt
|
||||
|
||||
RUN pip install -r /requirements.txt
|
||||
|
||||
ADD gc.py /usr/bin/gc.py
|
||||
|
||||
ADD docker_hub.py /usr/bin/docker_hub.py
|
||||
|
||||
ENTRYPOINT ["/usr/bin/gc.py"]
|
||||
125
.circleci/ecr_gc_docker/docker_hub.py
Executable file
125
.circleci/ecr_gc_docker/docker_hub.py
Executable file
@ -0,0 +1,125 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
import boto3
|
||||
import requests
|
||||
import os
|
||||
|
||||
|
||||
IMAGE_INFO = namedtuple(
|
||||
"IMAGE_INFO", ("repo", "tag", "size", "last_updated_at", "last_updated_by")
|
||||
)
|
||||
|
||||
|
||||
def build_access_token(username, passwordtr):
|
||||
r = requests.post(
|
||||
"https://hub.docker.com/v2/users/login/",
|
||||
data={"username": username, "password": password},
|
||||
)
|
||||
r.raise_for_status()
|
||||
token = r.json().get("token")
|
||||
return {"Authorization": "JWT " + token}
|
||||
|
||||
|
||||
def list_repos(user, token):
|
||||
r = requests.get("https://hub.docker.com/v2/repositories/" + user, headers=token)
|
||||
r.raise_for_status()
|
||||
ret = sorted(
|
||||
repo["user"] + "/" + repo["name"] for repo in r.json().get("results", [])
|
||||
)
|
||||
if ret:
|
||||
print("repos found:")
|
||||
print("".join("\n\t" + r for r in ret))
|
||||
return ret
|
||||
|
||||
|
||||
def list_tags(repo, token):
|
||||
r = requests.get(
|
||||
"https://hub.docker.com/v2/repositories/" + repo + "/tags", headers=token
|
||||
)
|
||||
r.raise_for_status()
|
||||
return [
|
||||
IMAGE_INFO(
|
||||
repo=repo,
|
||||
tag=t["name"],
|
||||
size=t["full_size"],
|
||||
last_updated_at=t["last_updated"],
|
||||
last_updated_by=t["last_updater_username"],
|
||||
)
|
||||
for t in r.json().get("results", [])
|
||||
]
|
||||
|
||||
|
||||
def save_to_s3(tags):
|
||||
table_content = ""
|
||||
client = boto3.client("s3")
|
||||
for t in tags:
|
||||
table_content += (
|
||||
"<tr><td>{repo}</td><td>{tag}</td><td>{size}</td>"
|
||||
"<td>{last_updated_at}</td><td>{last_updated_by}</td></tr>"
|
||||
).format(
|
||||
repo=t.repo,
|
||||
tag=t.tag,
|
||||
size=t.size,
|
||||
last_updated_at=t.last_updated_at,
|
||||
last_updated_by=t.last_updated_by,
|
||||
)
|
||||
html_body = """
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet"
|
||||
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
|
||||
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
|
||||
crossorigin="anonymous">
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.css">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
|
||||
</script>
|
||||
<script type="text/javascript" charset="utf8"
|
||||
src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.js"></script>
|
||||
<title> docker image info</title>
|
||||
</head>
|
||||
<body>
|
||||
<table class="table table-striped table-hover" id="docker">
|
||||
<caption>Docker images on docker hub</caption>
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">repo</th>
|
||||
<th scope="col">tag</th>
|
||||
<th scope="col">size</th>
|
||||
<th scope="col">last_updated_at</th>
|
||||
<th scope="col">last_updated_by</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{table_content}
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
<script>
|
||||
$(document).ready( function () {{
|
||||
$('#docker').DataTable({{paging: false}});
|
||||
}} );py
|
||||
</script>
|
||||
</html>
|
||||
""".format(
|
||||
table_content=table_content
|
||||
)
|
||||
client.put_object(
|
||||
Bucket="docker.pytorch.org",
|
||||
ACL="public-read",
|
||||
Key="docker_hub.html",
|
||||
Body=html_body,
|
||||
ContentType="text/html",
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
username = os.environ.get("DOCKER_HUB_USERNAME")
|
||||
password = os.environ.get("DOCKER_HUB_PASSWORD")
|
||||
token = build_access_token(username, password)
|
||||
tags = []
|
||||
for repo in list_repos("pytorch", token):
|
||||
tags.extend(list_tags(repo, token))
|
||||
save_to_s3(tags)
|
||||
214
.circleci/ecr_gc_docker/gc.py
Executable file
214
.circleci/ecr_gc_docker/gc.py
Executable file
@ -0,0 +1,214 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import boto3
|
||||
import pytz
|
||||
import sys
|
||||
import re
|
||||
|
||||
|
||||
def save_to_s3(project, data):
|
||||
table_content = ""
|
||||
client = boto3.client("s3")
|
||||
for repo, tag, window, age, pushed in data:
|
||||
table_content += "<tr><td>{repo}</td><td>{tag}</td><td>{window}</td><td>{age}</td><td>{pushed}</td></tr>".format(
|
||||
repo=repo, tag=tag, window=window, age=age, pushed=pushed
|
||||
)
|
||||
html_body = """
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet"
|
||||
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
|
||||
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
|
||||
crossorigin="anonymous">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.css">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.js"></script>
|
||||
<title>{project} nightly and permanent docker image info</title>
|
||||
</head>
|
||||
<body>
|
||||
<table class="table table-striped table-hover" id="docker">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">repo</th>
|
||||
<th scope="col">tag</th>
|
||||
<th scope="col">keep window</th>
|
||||
<th scope="col">age</th>
|
||||
<th scope="col">pushed at</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{table_content}
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
<script>
|
||||
$(document).ready( function () {{
|
||||
$('#docker').DataTable({{paging: false}});
|
||||
}} );
|
||||
</script>
|
||||
</html>
|
||||
""".format(
|
||||
project=project, table_content=table_content
|
||||
)
|
||||
|
||||
# for pytorch, file can be found at
|
||||
# http://ossci-docker.s3-website.us-east-1.amazonaws.com/pytorch.html
|
||||
# and later one we can config docker.pytorch.org to point to the location
|
||||
|
||||
client.put_object(
|
||||
Bucket="docker.pytorch.org",
|
||||
ACL="public-read",
|
||||
Key="{project}.html".format(project=project),
|
||||
Body=html_body,
|
||||
ContentType="text/html",
|
||||
)
|
||||
|
||||
|
||||
def repos(client):
|
||||
paginator = client.get_paginator("describe_repositories")
|
||||
pages = paginator.paginate(registryId="308535385114")
|
||||
for page in pages:
|
||||
for repo in page["repositories"]:
|
||||
yield repo
|
||||
|
||||
|
||||
def images(client, repository):
|
||||
paginator = client.get_paginator("describe_images")
|
||||
pages = paginator.paginate(
|
||||
registryId="308535385114", repositoryName=repository["repositoryName"]
|
||||
)
|
||||
for page in pages:
|
||||
for image in page["imageDetails"]:
|
||||
yield image
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(description="Delete old Docker tags from registry")
|
||||
parser.add_argument(
|
||||
"--dry-run", action="store_true", help="Dry run; print tags that would be deleted"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--debug", action="store_true", help="Debug, print ignored / saved tags"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--keep-stable-days",
|
||||
type=int,
|
||||
default=14,
|
||||
help="Days of stable Docker tags to keep (non per-build images)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--keep-unstable-days",
|
||||
type=int,
|
||||
default=1,
|
||||
help="Days of unstable Docker tags to keep (per-build images)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--filter-prefix",
|
||||
type=str,
|
||||
default="",
|
||||
help="Only run cleanup for repositories with this prefix",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--ignore-tags",
|
||||
type=str,
|
||||
default="",
|
||||
help="Never cleanup these tags (comma separated)",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.ignore_tags or not args.filter_prefix:
|
||||
print(
|
||||
"""
|
||||
Missing required arguments --ignore-tags and --filter-prefix
|
||||
|
||||
You must specify --ignore-tags and --filter-prefix to avoid accidentally
|
||||
pruning a stable Docker tag which is being actively used. This will
|
||||
make you VERY SAD. So pay attention.
|
||||
|
||||
First, which filter-prefix do you want? The list of valid prefixes
|
||||
is in jobs/private.groovy under the 'docker-registry-cleanup' job.
|
||||
You probably want either pytorch or caffe2.
|
||||
|
||||
Second, which ignore-tags do you want? It should be whatever the most
|
||||
up-to-date DockerVersion for the repository in question is. Follow
|
||||
the imports of jobs/pytorch.groovy to find them.
|
||||
"""
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
client = boto3.client("ecr", region_name="us-east-1")
|
||||
stable_window = datetime.timedelta(days=args.keep_stable_days)
|
||||
unstable_window = datetime.timedelta(days=args.keep_unstable_days)
|
||||
now = datetime.datetime.now(pytz.UTC)
|
||||
ignore_tags = args.ignore_tags.split(",")
|
||||
|
||||
|
||||
def chunks(chunkable, n):
|
||||
""" Yield successive n-sized chunks from l.
|
||||
"""
|
||||
for i in range(0, len(chunkable), n):
|
||||
yield chunkable[i : i + n]
|
||||
|
||||
SHA_PATTERN = re.compile(r'^[0-9a-f]{40}$')
|
||||
def looks_like_git_sha(tag):
|
||||
"""Returns a boolean to check if a tag looks like a git sha
|
||||
|
||||
For reference a sha1 is 40 characters with only 0-9a-f and contains no
|
||||
"-" characters
|
||||
"""
|
||||
return re.match(SHA_PATTERN, tag) is not None
|
||||
|
||||
stable_window_tags = []
|
||||
for repo in repos(client):
|
||||
repositoryName = repo["repositoryName"]
|
||||
if not repositoryName.startswith(args.filter_prefix):
|
||||
continue
|
||||
|
||||
# Keep list of image digests to delete for this repository
|
||||
digest_to_delete = []
|
||||
|
||||
for image in images(client, repo):
|
||||
tags = image.get("imageTags")
|
||||
if not isinstance(tags, (list,)) or len(tags) == 0:
|
||||
continue
|
||||
created = image["imagePushedAt"]
|
||||
age = now - created
|
||||
for tag in tags:
|
||||
if any([
|
||||
looks_like_git_sha(tag),
|
||||
tag.isdigit(),
|
||||
tag.count("-") == 4, # TODO: Remove, this no longer applies as tags are now built using a SHA1
|
||||
tag in ignore_tags]):
|
||||
window = stable_window
|
||||
if tag in ignore_tags:
|
||||
stable_window_tags.append((repositoryName, tag, "", age, created))
|
||||
elif age < window:
|
||||
stable_window_tags.append((repositoryName, tag, window, age, created))
|
||||
else:
|
||||
window = unstable_window
|
||||
|
||||
if tag in ignore_tags or age < window:
|
||||
if args.debug:
|
||||
print("Ignoring {}:{} (age: {})".format(repositoryName, tag, age))
|
||||
break
|
||||
else:
|
||||
for tag in tags:
|
||||
print("{}Deleting {}:{} (age: {})".format("(dry run) " if args.dry_run else "", repositoryName, tag, age))
|
||||
digest_to_delete.append(image["imageDigest"])
|
||||
if args.dry_run:
|
||||
if args.debug:
|
||||
print("Skipping actual deletion, moving on...")
|
||||
else:
|
||||
# Issue batch delete for all images to delete for this repository
|
||||
# Note that as of 2018-07-25, the maximum number of images you can
|
||||
# delete in a single batch is 100, so chunk our list into batches of
|
||||
# 100
|
||||
for c in chunks(digest_to_delete, 100):
|
||||
client.batch_delete_image(
|
||||
registryId="308535385114",
|
||||
repositoryName=repositoryName,
|
||||
imageIds=[{"imageDigest": digest} for digest in c],
|
||||
)
|
||||
|
||||
save_to_s3(args.filter_prefix, stable_window_tags)
|
||||
3
.circleci/ecr_gc_docker/requirements.txt
Normal file
3
.circleci/ecr_gc_docker/requirements.txt
Normal file
@ -0,0 +1,3 @@
|
||||
boto3
|
||||
pytz
|
||||
requests
|
||||
@ -11,11 +11,19 @@ import sys
|
||||
from collections import namedtuple
|
||||
|
||||
import cimodel.data.binary_build_definitions as binary_build_definitions
|
||||
import cimodel.data.pytorch_build_definitions as pytorch_build_definitions
|
||||
import cimodel.data.simple.android_definitions
|
||||
import cimodel.data.simple.bazel_definitions
|
||||
import cimodel.data.simple.binary_smoketest
|
||||
import cimodel.data.simple.docker_definitions
|
||||
import cimodel.data.simple.ge_config_tests
|
||||
import cimodel.data.simple.ios_definitions
|
||||
import cimodel.data.simple.macos_definitions
|
||||
import cimodel.data.simple.mobile_definitions
|
||||
import cimodel.data.simple.nightly_android
|
||||
import cimodel.data.simple.nightly_ios
|
||||
import cimodel.data.simple.anaconda_prune_defintions
|
||||
import cimodel.data.windows_build_definitions as windows_build_definitions
|
||||
import cimodel.lib.miniutils as miniutils
|
||||
import cimodel.lib.miniyaml as miniyaml
|
||||
|
||||
@ -72,84 +80,25 @@ class Header(object):
|
||||
for line in filter(None, lines):
|
||||
output_filehandle.write(line + "\n")
|
||||
|
||||
def _for_all_items(items, functor) -> None:
|
||||
if isinstance(items, list):
|
||||
for item in items:
|
||||
_for_all_items(item, functor)
|
||||
if isinstance(items, dict) and len(items) == 1:
|
||||
item_type, item = next(iter(items.items()))
|
||||
functor(item_type, item)
|
||||
|
||||
def filter_master_only_jobs(items):
|
||||
def _is_master_item(item):
|
||||
filters = item.get('filters', None)
|
||||
branches = filters.get('branches', None) if filters is not None else None
|
||||
branches_only = branches.get('only', None) if branches is not None else None
|
||||
return 'master' in branches_only if branches_only is not None else False
|
||||
|
||||
master_deps = set()
|
||||
|
||||
def _save_requires_if_master(item_type, item):
|
||||
requires = item.get('requires', None)
|
||||
item_name = item.get("name", None)
|
||||
if not isinstance(requires, list):
|
||||
return
|
||||
if _is_master_item(item) or item_name in master_deps:
|
||||
master_deps.update([n.strip('"') for n in requires])
|
||||
|
||||
def _do_filtering(items):
|
||||
if isinstance(items, list):
|
||||
rc = [_do_filtering(item) for item in items]
|
||||
return [item for item in rc if len(item if item is not None else []) > 0]
|
||||
assert isinstance(items, dict) and len(items) == 1
|
||||
item_type, item = next(iter(items.items()))
|
||||
item_name = item.get("name", None)
|
||||
item_name = item_name.strip('"') if item_name is not None else None
|
||||
if not _is_master_item(item) and item_name not in master_deps:
|
||||
return None
|
||||
if 'filters' in item:
|
||||
item = item.copy()
|
||||
item.pop('filters')
|
||||
return {item_type: item}
|
||||
|
||||
# Scan of dependencies twice to pick up nested required jobs
|
||||
# I.e. jobs depending on jobs that master-only job depend on
|
||||
_for_all_items(items, _save_requires_if_master)
|
||||
_for_all_items(items, _save_requires_if_master)
|
||||
return _do_filtering(items)
|
||||
|
||||
def generate_required_docker_images(items):
|
||||
required_docker_images = set()
|
||||
|
||||
def _requires_docker_image(item_type, item):
|
||||
requires = item.get('requires', None)
|
||||
if not isinstance(requires, list):
|
||||
return
|
||||
for requirement in requires:
|
||||
requirement = requirement.replace('"', '')
|
||||
if requirement.startswith('docker-'):
|
||||
required_docker_images.add(requirement)
|
||||
|
||||
_for_all_items(items, _requires_docker_image)
|
||||
return required_docker_images
|
||||
|
||||
def gen_build_workflows_tree():
|
||||
build_workflows_functions = [
|
||||
cimodel.data.simple.docker_definitions.get_workflow_jobs,
|
||||
pytorch_build_definitions.get_workflow_jobs,
|
||||
cimodel.data.simple.macos_definitions.get_workflow_jobs,
|
||||
cimodel.data.simple.android_definitions.get_workflow_jobs,
|
||||
cimodel.data.simple.ios_definitions.get_workflow_jobs,
|
||||
cimodel.data.simple.mobile_definitions.get_workflow_jobs,
|
||||
cimodel.data.simple.ge_config_tests.get_workflow_jobs,
|
||||
cimodel.data.simple.bazel_definitions.get_workflow_jobs,
|
||||
cimodel.data.simple.binary_smoketest.get_workflow_jobs,
|
||||
cimodel.data.simple.nightly_ios.get_workflow_jobs,
|
||||
cimodel.data.simple.nightly_android.get_workflow_jobs,
|
||||
cimodel.data.simple.anaconda_prune_defintions.get_workflow_jobs,
|
||||
windows_build_definitions.get_windows_workflows,
|
||||
binary_build_definitions.get_post_upload_jobs,
|
||||
binary_build_definitions.get_binary_smoke_test_jobs,
|
||||
]
|
||||
build_jobs = [f() for f in build_workflows_functions]
|
||||
build_jobs.extend(
|
||||
cimodel.data.simple.docker_definitions.get_workflow_jobs(
|
||||
# sort for consistency
|
||||
sorted(generate_required_docker_images(build_jobs))
|
||||
)
|
||||
)
|
||||
master_build_jobs = filter_master_only_jobs(build_jobs)
|
||||
|
||||
binary_build_functions = [
|
||||
binary_build_definitions.get_binary_build_jobs,
|
||||
@ -163,14 +112,7 @@ def gen_build_workflows_tree():
|
||||
"when": r"<< pipeline.parameters.run_binary_tests >>",
|
||||
"jobs": [f() for f in binary_build_functions],
|
||||
},
|
||||
"build": {
|
||||
"when": r"<< pipeline.parameters.run_build >>",
|
||||
"jobs": build_jobs,
|
||||
},
|
||||
"master_build": {
|
||||
"when": r"<< pipeline.parameters.run_master_build >>",
|
||||
"jobs": master_build_jobs,
|
||||
},
|
||||
"build": {"jobs": [f() for f in build_workflows_functions]},
|
||||
}
|
||||
}
|
||||
|
||||
@ -185,6 +127,7 @@ YAML_SOURCES = [
|
||||
File("build-parameters/binary-build-params.yml"),
|
||||
File("build-parameters/promote-build-params.yml"),
|
||||
Header("Job specs"),
|
||||
File("job-specs/pytorch-job-specs.yml"),
|
||||
File("job-specs/binary-job-specs.yml"),
|
||||
File("job-specs/job-specs-custom.yml"),
|
||||
File("job-specs/job-specs-promote.yml"),
|
||||
@ -193,6 +136,7 @@ YAML_SOURCES = [
|
||||
File("job-specs/docker_jobs.yml"),
|
||||
Header("Workflows"),
|
||||
Treegen(gen_build_workflows_tree, 0),
|
||||
File("workflows/workflows-ecr-gc.yml"),
|
||||
File("workflows/workflows-promote.yml"),
|
||||
]
|
||||
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
cd $PSScriptRoot;
|
||||
$NewFile = New-TemporaryFile;
|
||||
python generate_config_yml.py > $NewFile.name
|
||||
(Get-Content $NewFile.name -Raw).TrimEnd().Replace("`r`n","`n") | Set-Content config.yml -Force
|
||||
Remove-Item $NewFile.name
|
||||
@ -1,17 +1,8 @@
|
||||
#!/bin/bash -e
|
||||
#!/bin/bash -xe
|
||||
|
||||
# Allows this script to be invoked from any directory:
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
UNCOMMIT_CHANGE=$(git status -s | grep " config.yml" | wc -l | xargs)
|
||||
if [[ $UNCOMMIT_CHANGE != 0 ]]; then
|
||||
OLD_FILE=$(mktemp)
|
||||
cp config.yml "$OLD_FILE"
|
||||
echo "Uncommitted change detected in .circleci/config.yml"
|
||||
echo "It has been backed up to $OLD_FILE"
|
||||
fi
|
||||
cd $(dirname "$0")
|
||||
|
||||
NEW_FILE=$(mktemp)
|
||||
./generate_config_yml.py > "$NEW_FILE"
|
||||
cp "$NEW_FILE" config.yml
|
||||
echo "New config generated in .circleci/config.yml"
|
||||
./generate_config_yml.py > $NEW_FILE
|
||||
cp $NEW_FILE config.yml
|
||||
|
||||
@ -33,11 +33,6 @@ else
|
||||
export BUILDER_ROOT="$workdir/builder"
|
||||
fi
|
||||
|
||||
# Try to extract PR number from branch if not already set
|
||||
if [[ -z "${CIRCLE_PR_NUMBER:-}" ]]; then
|
||||
CIRCLE_PR_NUMBER="$(echo ${CIRCLE_BRANCH} | sed -E -n 's/pull\/([0-9]*).*/\1/p')"
|
||||
fi
|
||||
|
||||
# Clone the Pytorch branch
|
||||
retry git clone https://github.com/pytorch/pytorch.git "$PYTORCH_ROOT"
|
||||
pushd "$PYTORCH_ROOT"
|
||||
@ -55,7 +50,7 @@ else
|
||||
echo "Can't tell what to checkout"
|
||||
exit 1
|
||||
fi
|
||||
retry git submodule update --init --recursive --jobs 0
|
||||
retry git submodule update --init --recursive
|
||||
echo "Using Pytorch from "
|
||||
git --no-pager log --max-count 1
|
||||
popd
|
||||
|
||||
@ -15,14 +15,14 @@ export PATH="~/anaconda/bin:${PATH}"
|
||||
source ~/anaconda/bin/activate
|
||||
|
||||
# Install dependencies
|
||||
conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi requests typing_extensions --yes
|
||||
conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing requests --yes
|
||||
conda install -c conda-forge valgrind --yes
|
||||
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
|
||||
|
||||
# sync submodules
|
||||
cd ${PROJ_ROOT}
|
||||
git submodule sync
|
||||
git submodule update --init --recursive --jobs 0
|
||||
git submodule update --init --recursive
|
||||
|
||||
# run build script
|
||||
chmod a+x ${PROJ_ROOT}/scripts/build_ios.sh
|
||||
@ -31,12 +31,8 @@ cat ${PROJ_ROOT}/scripts/build_ios.sh
|
||||
echo "########################################################"
|
||||
echo "IOS_ARCH: ${IOS_ARCH}"
|
||||
echo "IOS_PLATFORM: ${IOS_PLATFORM}"
|
||||
echo "USE_PYTORCH_METAL: ${USE_PYTORCH_METAL}"
|
||||
echo "USE_COREML_DELEGATE: ${USE_COREML_DELEGATE}"
|
||||
export IOS_ARCH=${IOS_ARCH}
|
||||
export IOS_PLATFORM=${IOS_PLATFORM}
|
||||
export USE_PYTORCH_METAL=${USE_PYTORCH_METAL}
|
||||
export USE_COREML_DELEGATE=${USE_COREML_DELEGATE}
|
||||
unbuffer ${PROJ_ROOT}/scripts/build_ios.sh 2>&1 | ts
|
||||
|
||||
#store the binary
|
||||
|
||||
@ -8,23 +8,22 @@ cd ${PROJ_ROOT}/ios/TestApp
|
||||
# install fastlane
|
||||
sudo gem install bundler && bundle install
|
||||
# install certificates
|
||||
echo "${IOS_CERT_KEY_2022}" >> cert.txt
|
||||
echo "${IOS_CERT_KEY}" >> cert.txt
|
||||
base64 --decode cert.txt -o Certificates.p12
|
||||
rm cert.txt
|
||||
bundle exec fastlane install_root_cert
|
||||
bundle exec fastlane install_dev_cert
|
||||
bundle exec fastlane install_cert
|
||||
# install the provisioning profile
|
||||
PROFILE=PyTorch_CI_2022.mobileprovision
|
||||
PROFILE=PyTorch_CI_2021.mobileprovision
|
||||
PROVISIONING_PROFILES=~/Library/MobileDevice/Provisioning\ Profiles
|
||||
mkdir -pv "${PROVISIONING_PROFILES}"
|
||||
cd "${PROVISIONING_PROFILES}"
|
||||
echo "${IOS_SIGN_KEY_2022}" >> cert.txt
|
||||
echo "${IOS_SIGN_KEY}" >> cert.txt
|
||||
base64 --decode cert.txt -o ${PROFILE}
|
||||
rm cert.txt
|
||||
# run the ruby build script
|
||||
if ! [ -x "$(command -v xcodebuild)" ]; then
|
||||
echo 'Error: xcodebuild is not installed.'
|
||||
exit 1
|
||||
fi
|
||||
PROFILE=PyTorch_CI_2022
|
||||
fi
|
||||
PROFILE=PyTorch_CI_2021
|
||||
ruby ${PROJ_ROOT}/scripts/xcode_build.rb -i ${PROJ_ROOT}/build_ios/install -x ${PROJ_ROOT}/ios/TestApp/TestApp.xcodeproj -p ${IOS_PLATFORM} -c ${PROFILE} -t ${IOS_DEV_TEAM_ID}
|
||||
|
||||
@ -23,36 +23,18 @@ do
|
||||
fi
|
||||
done
|
||||
lipo -i ${ZIP_DIR}/install/lib/*.a
|
||||
echo "BUILD_LITE_INTERPRETER: ${BUILD_LITE_INTERPRETER}"
|
||||
# copy the umbrella header and license
|
||||
if [ "${BUILD_LITE_INTERPRETER}" == "1" ]; then
|
||||
cp ${PROJ_ROOT}/ios/LibTorch-Lite.h ${ZIP_DIR}/src/
|
||||
else
|
||||
cp ${PROJ_ROOT}/ios/LibTorch.h ${ZIP_DIR}/src/
|
||||
fi
|
||||
cp ${PROJ_ROOT}/ios/LibTorch.h ${ZIP_DIR}/src/
|
||||
cp ${PROJ_ROOT}/LICENSE ${ZIP_DIR}/
|
||||
# zip the library
|
||||
export DATE="$(date -u +%Y%m%d)"
|
||||
export IOS_NIGHTLY_BUILD_VERSION="1.11.0.${DATE}"
|
||||
if [ "${BUILD_LITE_INTERPRETER}" == "1" ]; then
|
||||
# libtorch_lite_ios_nightly_1.11.0.20210810.zip
|
||||
ZIPFILE="libtorch_lite_ios_nightly_${IOS_NIGHTLY_BUILD_VERSION}.zip"
|
||||
else
|
||||
ZIPFILE="libtorch_ios_nightly_build.zip"
|
||||
fi
|
||||
ZIPFILE=libtorch_ios_nightly_build.zip
|
||||
cd ${ZIP_DIR}
|
||||
#for testing
|
||||
touch version.txt
|
||||
echo "${IOS_NIGHTLY_BUILD_VERSION}" > version.txt
|
||||
echo $(date +%s) > version.txt
|
||||
zip -r ${ZIPFILE} install src version.txt LICENSE
|
||||
# upload to aws
|
||||
# Install conda then 'conda install' awscli
|
||||
curl --retry 3 -o ~/conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
|
||||
chmod +x ~/conda.sh
|
||||
/bin/bash ~/conda.sh -b -p ~/anaconda
|
||||
export PATH="~/anaconda/bin:${PATH}"
|
||||
source ~/anaconda/bin/activate
|
||||
conda install -c conda-forge awscli --yes
|
||||
brew install awscli
|
||||
set +x
|
||||
export AWS_ACCESS_KEY_ID=${AWS_S3_ACCESS_KEY_FOR_PYTORCH_BINARY_UPLOAD}
|
||||
export AWS_SECRET_ACCESS_KEY=${AWS_S3_ACCESS_SECRET_FOR_PYTORCH_BINARY_UPLOAD}
|
||||
@ -60,16 +42,3 @@ set +x
|
||||
# echo "AWS KEY: ${AWS_ACCESS_KEY_ID}"
|
||||
# echo "AWS SECRET: ${AWS_SECRET_ACCESS_KEY}"
|
||||
aws s3 cp ${ZIPFILE} s3://ossci-ios-build/ --acl public-read
|
||||
|
||||
if [ "${BUILD_LITE_INTERPRETER}" == "1" ]; then
|
||||
# create a new LibTorch-Lite-Nightly.podspec from the template
|
||||
echo "cp ${PROJ_ROOT}/ios/LibTorch-Lite-Nightly.podspec.template ${PROJ_ROOT}/ios/LibTorch-Lite-Nightly.podspec"
|
||||
cp ${PROJ_ROOT}/ios/LibTorch-Lite-Nightly.podspec.template ${PROJ_ROOT}/ios/LibTorch-Lite-Nightly.podspec
|
||||
|
||||
# update pod version
|
||||
sed -i '' -e "s/IOS_NIGHTLY_BUILD_VERSION/${IOS_NIGHTLY_BUILD_VERSION}/g" ${PROJ_ROOT}/ios/LibTorch-Lite-Nightly.podspec
|
||||
cat ${PROJ_ROOT}/ios/LibTorch-Lite-Nightly.podspec
|
||||
|
||||
# push the new LibTorch-Lite-Nightly.podspec to CocoaPods
|
||||
pod trunk push --verbose --allow-warnings --use-libraries --skip-import-validation ${PROJ_ROOT}/ios/LibTorch-Lite-Nightly.podspec
|
||||
fi
|
||||
|
||||
@ -4,16 +4,8 @@ echo "RUNNING ON $(uname -a) WITH $(nproc) CPUS AND $(free -m)"
|
||||
set -eux -o pipefail
|
||||
source /env
|
||||
|
||||
# Because most Circle executors only have 20 CPUs, using more causes OOMs w/ Ninja and nvcc parallelization
|
||||
MEMORY_LIMIT_MAX_JOBS=18
|
||||
NUM_CPUS=$(( $(nproc) - 2 ))
|
||||
|
||||
# Defaults here for **binary** linux builds so they can be changed in one place
|
||||
export MAX_JOBS=${MAX_JOBS:-$(( ${NUM_CPUS} > ${MEMORY_LIMIT_MAX_JOBS} ? ${MEMORY_LIMIT_MAX_JOBS} : ${NUM_CPUS} ))}
|
||||
|
||||
if [[ "${DESIRED_CUDA}" =~ cu11[0-9] ]]; then
|
||||
export BUILD_SPLIT_CUDA="ON"
|
||||
fi
|
||||
# Defaults here so they can be changed in one place
|
||||
export MAX_JOBS=${MAX_JOBS:-$(( $(nproc) - 2 ))}
|
||||
|
||||
# Parse the parameters
|
||||
if [[ "$PACKAGE_TYPE" == 'conda' ]]; then
|
||||
@ -26,9 +18,5 @@ else
|
||||
build_script='manywheel/build.sh'
|
||||
fi
|
||||
|
||||
if [[ "$CIRCLE_BRANCH" == "master" ]] || [[ "$CIRCLE_BRANCH" == release/* ]]; then
|
||||
export BUILD_DEBUG_INFO=1
|
||||
fi
|
||||
|
||||
# Build the package
|
||||
SKIP_ALL_TESTS=1 "/builder/$build_script"
|
||||
|
||||
@ -1,24 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
OUTPUT_SCRIPT=${OUTPUT_SCRIPT:-/home/circleci/project/ci_test_script.sh}
|
||||
|
||||
# only source if file exists
|
||||
if [[ -f /home/circleci/project/env ]]; then
|
||||
source /home/circleci/project/env
|
||||
fi
|
||||
cat >"${OUTPUT_SCRIPT}" <<EOL
|
||||
source /home/circleci/project/env
|
||||
cat >/home/circleci/project/ci_test_script.sh <<EOL
|
||||
# =================== The following code will be executed inside Docker container ===================
|
||||
set -eux -o pipefail
|
||||
|
||||
retry () {
|
||||
"\$@" || (sleep 1 && "\$@") || (sleep 2 && "\$@")
|
||||
}
|
||||
|
||||
# Source binary env file here if exists
|
||||
if [[ -e "${BINARY_ENV_FILE:-/nofile}" ]]; then
|
||||
source "${BINARY_ENV_FILE:-/nofile}"
|
||||
fi
|
||||
|
||||
python_nodot="\$(echo $DESIRED_PYTHON | tr -d m.u)"
|
||||
|
||||
# Set up Python
|
||||
@ -36,31 +22,10 @@ elif [[ "$PACKAGE_TYPE" != libtorch ]]; then
|
||||
fi
|
||||
|
||||
EXTRA_CONDA_FLAGS=""
|
||||
NUMPY_PIN=""
|
||||
PROTOBUF_PACKAGE="defaults::protobuf"
|
||||
if [[ "\$python_nodot" = *310* ]]; then
|
||||
EXTRA_CONDA_FLAGS="-c=conda-forge"
|
||||
# There's an issue with conda channel priority where it'll randomly pick 1.19 over 1.20
|
||||
# we set a lower boundary here just to be safe
|
||||
NUMPY_PIN=">=1.21.2"
|
||||
PROTOBUF_PACKAGE="protobuf>=3.19.0"
|
||||
fi
|
||||
|
||||
if [[ "\$python_nodot" = *39* ]]; then
|
||||
EXTRA_CONDA_FLAGS="-c=conda-forge"
|
||||
# There's an issue with conda channel priority where it'll randomly pick 1.19 over 1.20
|
||||
# we set a lower boundary here just to be safe
|
||||
NUMPY_PIN=">=1.20"
|
||||
fi
|
||||
|
||||
if [[ "$DESIRED_CUDA" == "cu112" || "$DESIRED_CUDA" == "cu115" ]]; then
|
||||
if [[ "\$python_nodot" = *39* ]]; then
|
||||
EXTRA_CONDA_FLAGS="-c=conda-forge"
|
||||
fi
|
||||
|
||||
# Move debug wheels out of the the package dir so they don't get installed
|
||||
mkdir -p /tmp/debug_final_pkgs
|
||||
mv /final_pkgs/debug-*.zip /tmp/debug_final_pkgs || echo "no debug packages to move"
|
||||
|
||||
# Install the package
|
||||
# These network calls should not have 'retry's because they are installing
|
||||
# locally and aren't actually network calls
|
||||
@ -69,37 +34,23 @@ mv /final_pkgs/debug-*.zip /tmp/debug_final_pkgs || echo "no debug packages to m
|
||||
# conda build scripts themselves. These should really be consolidated
|
||||
pkg="/final_pkgs/\$(ls /final_pkgs)"
|
||||
if [[ "$PACKAGE_TYPE" == conda ]]; then
|
||||
(
|
||||
# For some reason conda likes to re-activate the conda environment when attempting this install
|
||||
# which means that a deactivate is run and some variables might not exist when that happens,
|
||||
# namely CONDA_MKL_INTERFACE_LAYER_BACKUP from libblas so let's just ignore unbound variables when
|
||||
# it comes to the conda installation commands
|
||||
set +u
|
||||
retry conda install \${EXTRA_CONDA_FLAGS} -yq \
|
||||
"numpy\${NUMPY_PIN}" \
|
||||
future \
|
||||
mkl>=2018 \
|
||||
ninja \
|
||||
dataclasses \
|
||||
typing-extensions \
|
||||
${PROTOBUF_PACKAGE} \
|
||||
six
|
||||
if [[ "$DESIRED_CUDA" == 'cpu' ]]; then
|
||||
retry conda install -c pytorch -y cpuonly
|
||||
conda install \${EXTRA_CONDA_FLAGS} -y "\$pkg" --offline
|
||||
if [[ "$DESIRED_CUDA" == 'cpu' ]]; then
|
||||
retry conda install \${EXTRA_CONDA_FLAGS} -y cpuonly -c pytorch
|
||||
fi
|
||||
retry conda install \${EXTRA_CONDA_FLAGS} -yq future numpy protobuf six
|
||||
if [[ "$DESIRED_CUDA" != 'cpu' ]]; then
|
||||
# DESIRED_CUDA is in format cu90 or cu102
|
||||
if [[ "${#DESIRED_CUDA}" == 4 ]]; then
|
||||
cu_ver="${DESIRED_CUDA:2:1}.${DESIRED_CUDA:3}"
|
||||
else
|
||||
# DESIRED_CUDA is in format cu90 or cu102
|
||||
if [[ "${#DESIRED_CUDA}" == 4 ]]; then
|
||||
cu_ver="${DESIRED_CUDA:2:1}.${DESIRED_CUDA:3}"
|
||||
else
|
||||
cu_ver="${DESIRED_CUDA:2:2}.${DESIRED_CUDA:4}"
|
||||
fi
|
||||
retry conda install \${EXTRA_CONDA_FLAGS} -yq -c nvidia -c pytorch "cudatoolkit=\${cu_ver}"
|
||||
cu_ver="${DESIRED_CUDA:2:2}.${DESIRED_CUDA:4}"
|
||||
fi
|
||||
conda install \${EXTRA_CONDA_FLAGS} -y "\$pkg" --offline
|
||||
)
|
||||
retry conda install \${EXTRA_CONDA_FLAGS} -yq -c nvidia -c pytorch "cudatoolkit=\${cu_ver}"
|
||||
fi
|
||||
elif [[ "$PACKAGE_TYPE" != libtorch ]]; then
|
||||
pip install "\$pkg"
|
||||
retry pip install -q future numpy protobuf typing-extensions six
|
||||
retry pip install -q future numpy protobuf six
|
||||
fi
|
||||
if [[ "$PACKAGE_TYPE" == libtorch ]]; then
|
||||
pkg="\$(ls /final_pkgs/*-latest.zip)"
|
||||
@ -115,4 +66,4 @@ EOL
|
||||
echo
|
||||
echo
|
||||
echo "The script that will run in the next step is:"
|
||||
cat "${OUTPUT_SCRIPT}"
|
||||
cat /home/circleci/project/ci_test_script.sh
|
||||
|
||||
@ -14,10 +14,6 @@ chmod +x "$build_script"
|
||||
# Build
|
||||
cat >"$build_script" <<EOL
|
||||
export PATH="$workdir/miniconda/bin:$PATH"
|
||||
if [[ "$CIRCLE_BRANCH" == "nightly" ]]; then
|
||||
export USE_PYTORCH_METAL_EXPORT=1
|
||||
export USE_COREML_DELEGATE=1
|
||||
fi
|
||||
if [[ "$PACKAGE_TYPE" == conda ]]; then
|
||||
"$workdir/builder/conda/build_pytorch.sh"
|
||||
else
|
||||
|
||||
@ -19,47 +19,39 @@ tagged_version() {
|
||||
fi
|
||||
}
|
||||
|
||||
# These are only relevant for CircleCI
|
||||
# TODO: Remove these later once migrated fully to GHA
|
||||
if [[ -z ${IS_GHA:-} ]]; then
|
||||
# We need to write an envfile to persist these variables to following
|
||||
# steps, but the location of the envfile depends on the circleci executor
|
||||
if [[ "$(uname)" == Darwin ]]; then
|
||||
# macos executor (builds and tests)
|
||||
workdir="/Users/distiller/project"
|
||||
elif [[ "$OSTYPE" == "msys" ]]; then
|
||||
# windows executor (builds and tests)
|
||||
workdir="/c/w"
|
||||
elif [[ -d "/home/circleci/project" ]]; then
|
||||
# machine executor (binary tests)
|
||||
workdir="/home/circleci/project"
|
||||
else
|
||||
# docker executor (binary builds)
|
||||
workdir="/"
|
||||
fi
|
||||
envfile="$workdir/env"
|
||||
touch "$envfile"
|
||||
chmod +x "$envfile"
|
||||
# We need to write an envfile to persist these variables to following
|
||||
# steps, but the location of the envfile depends on the circleci executor
|
||||
if [[ "$(uname)" == Darwin ]]; then
|
||||
# macos executor (builds and tests)
|
||||
workdir="/Users/distiller/project"
|
||||
elif [[ "$OSTYPE" == "msys" ]]; then
|
||||
# windows executor (builds and tests)
|
||||
workdir="/c/w"
|
||||
elif [[ -d "/home/circleci/project" ]]; then
|
||||
# machine executor (binary tests)
|
||||
workdir="/home/circleci/project"
|
||||
else
|
||||
# docker executor (binary builds)
|
||||
workdir="/"
|
||||
fi
|
||||
envfile="$workdir/env"
|
||||
touch "$envfile"
|
||||
chmod +x "$envfile"
|
||||
|
||||
# Parse the BUILD_ENVIRONMENT to package type, python, and cuda
|
||||
configs=($BUILD_ENVIRONMENT)
|
||||
export PACKAGE_TYPE="${configs[0]}"
|
||||
export DESIRED_PYTHON="${configs[1]}"
|
||||
export DESIRED_CUDA="${configs[2]}"
|
||||
if [[ "${BUILD_FOR_SYSTEM:-}" == "windows" ]]; then
|
||||
export DESIRED_DEVTOOLSET=""
|
||||
export LIBTORCH_CONFIG="${configs[3]:-}"
|
||||
if [[ "$LIBTORCH_CONFIG" == 'debug' ]]; then
|
||||
export DEBUG=1
|
||||
fi
|
||||
else
|
||||
export DESIRED_DEVTOOLSET="${configs[3]:-}"
|
||||
# Parse the BUILD_ENVIRONMENT to package type, python, and cuda
|
||||
configs=($BUILD_ENVIRONMENT)
|
||||
export PACKAGE_TYPE="${configs[0]}"
|
||||
export DESIRED_PYTHON="${configs[1]}"
|
||||
export DESIRED_CUDA="${configs[2]}"
|
||||
if [[ "${BUILD_FOR_SYSTEM:-}" == "windows" ]]; then
|
||||
export DESIRED_DEVTOOLSET=""
|
||||
export LIBTORCH_CONFIG="${configs[3]:-}"
|
||||
if [[ "$LIBTORCH_CONFIG" == 'debug' ]]; then
|
||||
export DEBUG=1
|
||||
fi
|
||||
else
|
||||
envfile=${BINARY_ENV_FILE:-/tmp/env}
|
||||
workdir="/pytorch"
|
||||
export DESIRED_DEVTOOLSET="${configs[3]:-}"
|
||||
fi
|
||||
|
||||
if [[ "$PACKAGE_TYPE" == 'libtorch' ]]; then
|
||||
export BUILD_PYTHONLESS=1
|
||||
fi
|
||||
@ -70,30 +62,18 @@ if [[ -z "$DOCKER_IMAGE" ]]; then
|
||||
if [[ "$PACKAGE_TYPE" == conda ]]; then
|
||||
export DOCKER_IMAGE="pytorch/conda-cuda"
|
||||
elif [[ "$DESIRED_CUDA" == cpu ]]; then
|
||||
export DOCKER_IMAGE="pytorch/manylinux-cpu"
|
||||
export DOCKER_IMAGE="pytorch/manylinux-cuda100"
|
||||
else
|
||||
export DOCKER_IMAGE="pytorch/manylinux-cuda${DESIRED_CUDA:2}"
|
||||
fi
|
||||
fi
|
||||
|
||||
USE_GOLD_LINKER="OFF"
|
||||
# GOLD linker can not be used if CUPTI is statically linked into PyTorch, see https://github.com/pytorch/pytorch/issues/57744
|
||||
if [[ ${DESIRED_CUDA} == "cpu" ]]; then
|
||||
USE_GOLD_LINKER="ON"
|
||||
fi
|
||||
|
||||
USE_WHOLE_CUDNN="OFF"
|
||||
# Link whole cuDNN for CUDA-11.1 to include fp16 fast kernels
|
||||
if [[ "$(uname)" == "Linux" && "${DESIRED_CUDA}" == "cu111" ]]; then
|
||||
USE_WHOLE_CUDNN="ON"
|
||||
fi
|
||||
|
||||
# Default to nightly, since that's where this normally uploads to
|
||||
PIP_UPLOAD_FOLDER='nightly/'
|
||||
# We put this here so that OVERRIDE_PACKAGE_VERSION below can read from it
|
||||
export DATE="$(date -u +%Y%m%d)"
|
||||
#TODO: We should be pulling semver version from the base version.txt
|
||||
BASE_BUILD_VERSION="1.11.0.dev$DATE"
|
||||
BASE_BUILD_VERSION="1.7.0.dev$DATE"
|
||||
# Change BASE_BUILD_VERSION to git tag when on a git tag
|
||||
# Use 'git -C' to make doubly sure we're in the correct directory for checking
|
||||
# the git tag
|
||||
@ -105,7 +85,7 @@ if tagged_version >/dev/null; then
|
||||
# Turns tag v1.6.0-rc1 -> v1.6.0
|
||||
BASE_BUILD_VERSION="$(tagged_version | sed -e 's/^v//' -e 's/-.*$//')"
|
||||
fi
|
||||
if [[ "$(uname)" == 'Darwin' ]] || [[ "$PACKAGE_TYPE" == conda ]]; then
|
||||
if [[ "$(uname)" == 'Darwin' ]] || [[ "$DESIRED_CUDA" == "cu102" ]] || [[ "$PACKAGE_TYPE" == conda ]]; then
|
||||
export PYTORCH_BUILD_VERSION="${BASE_BUILD_VERSION}"
|
||||
else
|
||||
export PYTORCH_BUILD_VERSION="${BASE_BUILD_VERSION}+$DESIRED_CUDA"
|
||||
@ -120,14 +100,8 @@ if [[ "$PACKAGE_TYPE" == libtorch ]]; then
|
||||
POSSIBLE_JAVA_HOMES+=(/usr/local)
|
||||
POSSIBLE_JAVA_HOMES+=(/usr/lib/jvm/java-8-openjdk-amd64)
|
||||
POSSIBLE_JAVA_HOMES+=(/Library/Java/JavaVirtualMachines/*.jdk/Contents/Home)
|
||||
# Add the Windows-specific JNI path
|
||||
POSSIBLE_JAVA_HOMES+=("$PWD/.circleci/windows-jni/")
|
||||
for JH in "${POSSIBLE_JAVA_HOMES[@]}" ; do
|
||||
if [[ -e "$JH/include/jni.h" ]] ; then
|
||||
# Skip if we're not on Windows but haven't found a JAVA_HOME
|
||||
if [[ "$JH" == "$PWD/.circleci/windows-jni/" && "$OSTYPE" != "msys" ]] ; then
|
||||
break
|
||||
fi
|
||||
echo "Found jni.h under $JH"
|
||||
JAVA_HOME="$JH"
|
||||
BUILD_JNI=ON
|
||||
@ -139,24 +113,24 @@ if [[ "$PACKAGE_TYPE" == libtorch ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
cat >"$envfile" <<EOL
|
||||
cat >>"$envfile" <<EOL
|
||||
# =================== The following code will be executed inside Docker container ===================
|
||||
export TZ=UTC
|
||||
echo "Running on $(uname -a) at $(date)"
|
||||
|
||||
export PACKAGE_TYPE="$PACKAGE_TYPE"
|
||||
export DESIRED_PYTHON="${DESIRED_PYTHON:-}"
|
||||
export DESIRED_PYTHON="$DESIRED_PYTHON"
|
||||
export DESIRED_CUDA="$DESIRED_CUDA"
|
||||
export LIBTORCH_VARIANT="${LIBTORCH_VARIANT:-}"
|
||||
export BUILD_PYTHONLESS="${BUILD_PYTHONLESS:-}"
|
||||
export DESIRED_DEVTOOLSET="${DESIRED_DEVTOOLSET:-}"
|
||||
export DESIRED_DEVTOOLSET="$DESIRED_DEVTOOLSET"
|
||||
if [[ "${BUILD_FOR_SYSTEM:-}" == "windows" ]]; then
|
||||
export LIBTORCH_CONFIG="${LIBTORCH_CONFIG:-}"
|
||||
export DEBUG="${DEBUG:-}"
|
||||
fi
|
||||
|
||||
export DATE="$DATE"
|
||||
export NIGHTLIES_DATE_PREAMBLE=1.11.0.dev
|
||||
export NIGHTLIES_DATE_PREAMBLE=1.7.0.dev
|
||||
export PYTORCH_BUILD_VERSION="$PYTORCH_BUILD_VERSION"
|
||||
export PYTORCH_BUILD_NUMBER="$PYTORCH_BUILD_NUMBER"
|
||||
export OVERRIDE_PACKAGE_VERSION="$PYTORCH_BUILD_VERSION"
|
||||
@ -164,7 +138,6 @@ export OVERRIDE_PACKAGE_VERSION="$PYTORCH_BUILD_VERSION"
|
||||
# TODO: We don't need this anymore IIUC
|
||||
export TORCH_PACKAGE_NAME='torch'
|
||||
export TORCH_CONDA_BUILD_FOLDER='pytorch-nightly'
|
||||
export ANACONDA_USER='pytorch'
|
||||
|
||||
export USE_FBGEMM=1
|
||||
export JAVA_HOME=$JAVA_HOME
|
||||
@ -172,49 +145,25 @@ export BUILD_JNI=$BUILD_JNI
|
||||
export PIP_UPLOAD_FOLDER="$PIP_UPLOAD_FOLDER"
|
||||
export DOCKER_IMAGE="$DOCKER_IMAGE"
|
||||
|
||||
export workdir="$workdir"
|
||||
export MAC_PACKAGE_WORK_DIR="$workdir"
|
||||
if [[ "$OSTYPE" == "msys" ]]; then
|
||||
export PYTORCH_ROOT="$workdir/p"
|
||||
export BUILDER_ROOT="$workdir/b"
|
||||
else
|
||||
export PYTORCH_ROOT="$workdir/pytorch"
|
||||
export BUILDER_ROOT="$workdir/builder"
|
||||
fi
|
||||
export MINICONDA_ROOT="$workdir/miniconda"
|
||||
export PYTORCH_FINAL_PACKAGE_DIR="$workdir/final_pkgs"
|
||||
|
||||
export USE_GOLD_LINKER="${USE_GOLD_LINKER}"
|
||||
export USE_GLOO_WITH_OPENSSL="ON"
|
||||
export USE_WHOLE_CUDNN="${USE_WHOLE_CUDNN}"
|
||||
export CIRCLE_TAG="${CIRCLE_TAG:-}"
|
||||
export CIRCLE_SHA1="$CIRCLE_SHA1"
|
||||
export CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-}"
|
||||
export CIRCLE_BRANCH="$CIRCLE_BRANCH"
|
||||
# =================== The above code will be executed inside Docker container ===================
|
||||
EOL
|
||||
|
||||
# nproc doesn't exist on darwin
|
||||
if [[ "$(uname)" != Darwin ]]; then
|
||||
# Because most Circle executors only have 20 CPUs, using more causes OOMs w/ Ninja and nvcc parallelization
|
||||
MEMORY_LIMIT_MAX_JOBS=18
|
||||
NUM_CPUS=$(( $(nproc) - 2 ))
|
||||
|
||||
# Defaults here for **binary** linux builds so they can be changed in one place
|
||||
export MAX_JOBS=${MAX_JOBS:-$(( ${NUM_CPUS} > ${MEMORY_LIMIT_MAX_JOBS} ? ${MEMORY_LIMIT_MAX_JOBS} : ${NUM_CPUS} ))}
|
||||
|
||||
cat >>"$envfile" <<EOL
|
||||
export MAX_JOBS="${MAX_JOBS}"
|
||||
EOL
|
||||
fi
|
||||
|
||||
if [[ -z "${IS_GHA:-}" ]]; then
|
||||
cat >>"$envfile" <<EOL
|
||||
export workdir="$workdir"
|
||||
export MAC_PACKAGE_WORK_DIR="$workdir"
|
||||
if [[ "$OSTYPE" == "msys" ]]; then
|
||||
export PYTORCH_ROOT="$workdir/p"
|
||||
export BUILDER_ROOT="$workdir/b"
|
||||
else
|
||||
export PYTORCH_ROOT="$workdir/pytorch"
|
||||
export BUILDER_ROOT="$workdir/builder"
|
||||
fi
|
||||
export MINICONDA_ROOT="$workdir/miniconda"
|
||||
export PYTORCH_FINAL_PACKAGE_DIR="$workdir/final_pkgs"
|
||||
|
||||
export CIRCLE_TAG="${CIRCLE_TAG:-}"
|
||||
export CIRCLE_SHA1="$CIRCLE_SHA1"
|
||||
export CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-}"
|
||||
export CIRCLE_BRANCH="$CIRCLE_BRANCH"
|
||||
export CIRCLE_WORKFLOW_ID="$CIRCLE_WORKFLOW_ID"
|
||||
EOL
|
||||
fi
|
||||
|
||||
echo 'retry () {' >> "$envfile"
|
||||
echo ' $* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)' >> "$envfile"
|
||||
echo '}' >> "$envfile"
|
||||
|
||||
@ -63,10 +63,6 @@ s3_upload() {
|
||||
)
|
||||
}
|
||||
|
||||
# Install dependencies (should be a no-op if previously installed)
|
||||
conda install -yq anaconda-client
|
||||
pip install -q awscli
|
||||
|
||||
case "${PACKAGE_TYPE}" in
|
||||
conda)
|
||||
conda_upload
|
||||
|
||||
@ -8,45 +8,11 @@ export CUDA_VERSION="${DESIRED_CUDA/cu/}"
|
||||
export USE_SCCACHE=1
|
||||
export SCCACHE_BUCKET=ossci-compiler-cache-windows
|
||||
export NIGHTLIES_PYTORCH_ROOT="$PYTORCH_ROOT"
|
||||
export VC_YEAR=2019
|
||||
|
||||
if [[ "${DESIRED_CUDA}" == *"cu11"* ]]; then
|
||||
export BUILD_SPLIT_CUDA=ON
|
||||
fi
|
||||
|
||||
echo "Free Space for CUDA DEBUG BUILD"
|
||||
if [[ "$CIRCLECI" == 'true' ]]; then
|
||||
if [[ -d "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community" ]]; then
|
||||
rm -rf "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community"
|
||||
fi
|
||||
|
||||
if [[ -d "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0" ]]; then
|
||||
rm -rf "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0"
|
||||
fi
|
||||
|
||||
if [[ -d "C:\\Program Files (x86)\\Microsoft.NET" ]]; then
|
||||
rm -rf "C:\\Program Files (x86)\\Microsoft.NET"
|
||||
fi
|
||||
|
||||
if [[ -d "C:\\Program Files\\dotnet" ]]; then
|
||||
rm -rf "C:\\Program Files\\dotnet"
|
||||
fi
|
||||
|
||||
if [[ -d "C:\\Program Files (x86)\\dotnet" ]]; then
|
||||
rm -rf "C:\\Program Files (x86)\\dotnet"
|
||||
fi
|
||||
|
||||
if [[ -d "C:\\Program Files (x86)\\Microsoft SQL Server" ]]; then
|
||||
rm -rf "C:\\Program Files (x86)\\Microsoft SQL Server"
|
||||
fi
|
||||
|
||||
if [[ -d "C:\\Program Files (x86)\\Xamarin" ]]; then
|
||||
rm -rf "C:\\Program Files (x86)\\Xamarin"
|
||||
fi
|
||||
|
||||
if [[ -d "C:\\Program Files (x86)\\Google" ]]; then
|
||||
rm -rf "C:\\Program Files (x86)\\Google"
|
||||
fi
|
||||
if [[ "$CUDA_VERSION" == "92" || "$CUDA_VERSION" == "100" ]]; then
|
||||
export VC_YEAR=2017
|
||||
else
|
||||
export VC_YEAR=2019
|
||||
fi
|
||||
|
||||
set +x
|
||||
@ -61,11 +27,6 @@ if [[ "$CIRCLECI" == 'true' && -d "C:\\ProgramData\\Microsoft\\VisualStudio\\Pac
|
||||
mv _Instances "C:\\ProgramData\\Microsoft\\VisualStudio\\Packages"
|
||||
fi
|
||||
|
||||
if [[ "$CIRCLECI" == 'true' && -d "C:\\Microsoft" ]]; then
|
||||
# don't use quotes here
|
||||
rm -rf /c/Microsoft/AndroidNDK*
|
||||
fi
|
||||
|
||||
echo "Free space on filesystem before build:"
|
||||
df -h
|
||||
|
||||
|
||||
@ -4,7 +4,13 @@ set -eux -o pipefail
|
||||
source "/c/w/env"
|
||||
|
||||
export CUDA_VERSION="${DESIRED_CUDA/cu/}"
|
||||
export VC_YEAR=2019
|
||||
export VC_YEAR=2017
|
||||
|
||||
if [[ "$CUDA_VERSION" == "92" || "$CUDA_VERSION" == "100" ]]; then
|
||||
export VC_YEAR=2017
|
||||
else
|
||||
export VC_YEAR=2019
|
||||
fi
|
||||
|
||||
pushd "$BUILDER_ROOT"
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ export ANDROID_HOME=/opt/android/sdk
|
||||
|
||||
# Must be in sync with GRADLE_VERSION in docker image for android
|
||||
# https://github.com/pietern/pytorch-dockerfiles/blob/master/build.sh#L155
|
||||
export GRADLE_VERSION=6.8.3
|
||||
export GRADLE_VERSION=4.10.3
|
||||
export GRADLE_HOME=/opt/gradle/gradle-$GRADLE_VERSION
|
||||
export GRADLE_PATH=$GRADLE_HOME/bin/gradle
|
||||
|
||||
|
||||
@ -10,27 +10,18 @@ pt_checkout="/var/lib/jenkins/workspace"
|
||||
# Since we're cat-ing this file, we need to escape all $'s
|
||||
echo "cpp_doc_push_script.sh: Invoked with $*"
|
||||
|
||||
# for statements like ${1:-${DOCS_INSTALL_PATH:-docs/}}
|
||||
# the order of operations goes:
|
||||
# 1. Check if there's an argument $1
|
||||
# 2. If no argument check for environment var DOCS_INSTALL_PATH
|
||||
# 3. If no environment var fall back to default 'docs/'
|
||||
|
||||
# NOTE: It might seem weird to gather the second argument before gathering the first argument
|
||||
# but since DOCS_INSTALL_PATH can be derived from DOCS_VERSION it's probably better to
|
||||
# try and gather it first, just so we don't potentially break people who rely on this script
|
||||
# Argument 2: What version of the Python API docs we are building.
|
||||
version="${2:-${DOCS_VERSION:-master}}"
|
||||
if [ -z "$version" ]; then
|
||||
echo "error: cpp_doc_push_script.sh: version (arg2) not specified"
|
||||
# Argument 1: Where to copy the built documentation for Python API to
|
||||
# (pytorch.github.io/$install_path)
|
||||
install_path="$1"
|
||||
if [ -z "$install_path" ]; then
|
||||
echo "error: cpp_doc_push_script.sh: install_path (arg1) not specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Argument 1: Where to copy the built documentation for Python API to
|
||||
# (pytorch.github.io/$install_path)
|
||||
install_path="${1:-${DOCS_INSTALL_PATH:-docs/${DOCS_VERSION}}}"
|
||||
if [ -z "$install_path" ]; then
|
||||
echo "error: cpp_doc_push_script.sh: install_path (arg1) not specified"
|
||||
# Argument 2: What version of the Python API docs we are building.
|
||||
version="$2"
|
||||
if [ -z "$version" ]; then
|
||||
echo "error: cpp_doc_push_script.sh: version (arg2) not specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -65,7 +56,7 @@ cp torch/_utils_internal.py tools/shared
|
||||
|
||||
# Generate PyTorch files
|
||||
time python tools/setup_helpers/generate_code.py \
|
||||
--native-functions-path aten/src/ATen/native/native_functions.yaml \
|
||||
--declarations-path build/aten/src/ATen/Declarations.yaml \
|
||||
--nn-path aten/src/
|
||||
|
||||
# Build the docs
|
||||
@ -96,12 +87,8 @@ git status
|
||||
git config user.email "soumith+bot@pytorch.org"
|
||||
git config user.name "pytorchbot"
|
||||
# If there aren't changes, don't make a commit; push is no-op
|
||||
git commit -m "Generate C++ docs from pytorch/pytorch@${GITHUB_SHA}" || true
|
||||
git commit -m "Automatic sync on $(date)" || true
|
||||
git status
|
||||
|
||||
if [[ "${WITH_PUSH:-}" == true ]]; then
|
||||
git push -u origin
|
||||
fi
|
||||
|
||||
popd
|
||||
# =================== The above code **should** be executed inside Docker container ===================
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
set "DRIVER_DOWNLOAD_LINK=https://s3.amazonaws.com/ossci-windows/452.39-data-center-tesla-desktop-win10-64bit-international.exe"
|
||||
curl --retry 3 -kL %DRIVER_DOWNLOAD_LINK% --output 452.39-data-center-tesla-desktop-win10-64bit-international.exe
|
||||
set "DRIVER_DOWNLOAD_LINK=https://s3.amazonaws.com/ossci-windows/451.82-tesla-desktop-winserver-2019-2016-international.exe"
|
||||
curl --retry 3 -kL %DRIVER_DOWNLOAD_LINK% --output 451.82-tesla-desktop-winserver-2019-2016-international.exe
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
start /wait 452.39-data-center-tesla-desktop-win10-64bit-international.exe -s -noreboot
|
||||
start /wait 451.82-tesla-desktop-winserver-2019-2016-international.exe -s -noreboot
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
del 452.39-data-center-tesla-desktop-win10-64bit-international.exe || ver > NUL
|
||||
del 451.82-tesla-desktop-winserver-2019-2016-international.exe || ver > NUL
|
||||
|
||||
@ -5,7 +5,7 @@ set -eu -o pipefail
|
||||
export ANDROID_NDK_HOME=/opt/ndk
|
||||
export ANDROID_HOME=/opt/android/sdk
|
||||
|
||||
export GRADLE_VERSION=6.8.3
|
||||
export GRADLE_VERSION=4.10.3
|
||||
export GRADLE_HOME=/opt/gradle/gradle-$GRADLE_VERSION
|
||||
export GRADLE_PATH=$GRADLE_HOME/bin/gradle
|
||||
|
||||
@ -35,9 +35,7 @@ else
|
||||
echo "ndk.dir=/opt/ndk" >> $GRADLE_LOCAL_PROPERTIES
|
||||
|
||||
echo "SONATYPE_NEXUS_USERNAME=${SONATYPE_NEXUS_USERNAME}" >> $GRADLE_PROPERTIES
|
||||
echo "mavenCentralRepositoryUsername=${SONATYPE_NEXUS_USERNAME}" >> $GRADLE_PROPERTIES
|
||||
echo "SONATYPE_NEXUS_PASSWORD=${SONATYPE_NEXUS_PASSWORD}" >> $GRADLE_PROPERTIES
|
||||
echo "mavenCentralRepositoryPassword=${SONATYPE_NEXUS_PASSWORD}" >> $GRADLE_PROPERTIES
|
||||
|
||||
echo "signing.keyId=${ANDROID_SIGN_KEY}" >> $GRADLE_PROPERTIES
|
||||
echo "signing.password=${ANDROID_SIGN_PASS}" >> $GRADLE_PROPERTIES
|
||||
|
||||
@ -13,27 +13,18 @@ echo "python_doc_push_script.sh: Invoked with $*"
|
||||
|
||||
set -ex
|
||||
|
||||
# for statements like ${1:-${DOCS_INSTALL_PATH:-docs/}}
|
||||
# the order of operations goes:
|
||||
# 1. Check if there's an argument $1
|
||||
# 2. If no argument check for environment var DOCS_INSTALL_PATH
|
||||
# 3. If no environment var fall back to default 'docs/'
|
||||
|
||||
# NOTE: It might seem weird to gather the second argument before gathering the first argument
|
||||
# but since DOCS_INSTALL_PATH can be derived from DOCS_VERSION it's probably better to
|
||||
# try and gather it first, just so we don't potentially break people who rely on this script
|
||||
# Argument 2: What version of the docs we are building.
|
||||
version="${2:-${DOCS_VERSION:-master}}"
|
||||
if [ -z "$version" ]; then
|
||||
echo "error: python_doc_push_script.sh: version (arg2) not specified"
|
||||
# Argument 1: Where to copy the built documentation to
|
||||
# (pytorch.github.io/$install_path)
|
||||
install_path="$1"
|
||||
if [ -z "$install_path" ]; then
|
||||
echo "error: python_doc_push_script.sh: install_path (arg1) not specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Argument 1: Where to copy the built documentation to
|
||||
# (pytorch.github.io/$install_path)
|
||||
install_path="${1:-${DOCS_INSTALL_PATH:-docs/${DOCS_VERSION}}}"
|
||||
if [ -z "$install_path" ]; then
|
||||
echo "error: python_doc_push_script.sh: install_path (arg1) not specified"
|
||||
# Argument 2: What version of the docs we are building.
|
||||
version="$2"
|
||||
if [ -z "$version" ]; then
|
||||
echo "error: python_doc_push_script.sh: version (arg2) not specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -43,7 +34,7 @@ if [ "$version" == "master" ]; then
|
||||
fi
|
||||
|
||||
# Argument 3: The branch to push to. Usually is "site"
|
||||
branch="${3:-${DOCS_BRANCH:-site}}"
|
||||
branch="$3"
|
||||
if [ -z "$branch" ]; then
|
||||
echo "error: python_doc_push_script.sh: branch (arg3) not specified"
|
||||
exit 1
|
||||
@ -51,28 +42,7 @@ fi
|
||||
|
||||
echo "install_path: $install_path version: $version"
|
||||
|
||||
|
||||
build_docs () {
|
||||
set +e
|
||||
set -o pipefail
|
||||
make $1 2>&1 | tee /tmp/docs_build.txt
|
||||
code=$?
|
||||
if [ $code -ne 0 ]; then
|
||||
set +x
|
||||
echo =========================
|
||||
grep "WARNING:" /tmp/docs_build.txt
|
||||
echo =========================
|
||||
echo Docs build failed. If the failure is not clear, scan back in the log
|
||||
echo for any WARNINGS or for the line "build finished with problems"
|
||||
echo "(tried to echo the WARNINGS above the ==== line)"
|
||||
echo =========================
|
||||
fi
|
||||
set -ex
|
||||
return $code
|
||||
}
|
||||
|
||||
|
||||
git clone https://github.com/pytorch/pytorch.github.io -b $branch --depth 1
|
||||
git clone https://github.com/pytorch/pytorch.github.io -b $branch
|
||||
pushd pytorch.github.io
|
||||
|
||||
export LC_ALL=C
|
||||
@ -82,13 +52,15 @@ rm -rf pytorch || true
|
||||
|
||||
# Get all the documentation sources, put them in one place
|
||||
pushd "$pt_checkout"
|
||||
checkout_install_torchvision
|
||||
pushd docs
|
||||
rm -rf source/torchvision
|
||||
cp -a ../vision/docs/source source/torchvision
|
||||
|
||||
# Build the docs
|
||||
pip -q install -r requirements.txt
|
||||
if [ "$is_master_doc" = true ]; then
|
||||
build_docs html
|
||||
[ $? -eq 0 ] || exit $?
|
||||
make html
|
||||
make coverage
|
||||
# Now we have the coverage report, we need to make sure it is empty.
|
||||
# Count the number of lines in the file and turn that number into a variable
|
||||
@ -109,9 +81,8 @@ if [ "$is_master_doc" = true ]; then
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# skip coverage, format for stable or tags
|
||||
build_docs html-stable
|
||||
[ $? -eq 0 ] || exit $?
|
||||
# Don't fail the build on coverage problems
|
||||
make html-stable
|
||||
fi
|
||||
|
||||
# Move them into the docs repo
|
||||
@ -120,6 +91,14 @@ popd
|
||||
git rm -rf "$install_path" || true
|
||||
mv "$pt_checkout/docs/build/html" "$install_path"
|
||||
|
||||
# Add the version handler by search and replace.
|
||||
# XXX: Consider moving this to the docs Makefile or site build
|
||||
if [ "$is_master_doc" = true ]; then
|
||||
find "$install_path" -name "*.html" -print0 | xargs -0 perl -pi -w -e "s@master\s+\((\d\.\d\.[A-Fa-f0-9]+\+[A-Fa-f0-9]+)\s+\)@<a href='http://pytorch.org/docs/versions.html'>\1 \▼</a>@g"
|
||||
else
|
||||
find "$install_path" -name "*.html" -print0 | xargs -0 perl -pi -w -e "s@master\s+\((\d\.\d\.[A-Fa-f0-9]+\+[A-Fa-f0-9]+)\s+\)@<a href='http://pytorch.org/docs/versions.html'>$version \▼</a>@g"
|
||||
fi
|
||||
|
||||
# Prevent Google from indexing $install_path/_modules. This folder contains
|
||||
# generated source files.
|
||||
# NB: the following only works on gnu sed. The sed shipped with mac os is different.
|
||||
@ -131,12 +110,8 @@ git status
|
||||
git config user.email "soumith+bot@pytorch.org"
|
||||
git config user.name "pytorchbot"
|
||||
# If there aren't changes, don't make a commit; push is no-op
|
||||
git commit -m "Generate Python docs from pytorch/pytorch@${GITHUB_SHA}" || true
|
||||
git commit -m "auto-generating sphinx docs" || true
|
||||
git status
|
||||
|
||||
if [[ "${WITH_PUSH:-}" == true ]]; then
|
||||
git push -u origin "${branch}"
|
||||
fi
|
||||
|
||||
popd
|
||||
# =================== The above code **should** be executed inside Docker container ===================
|
||||
|
||||
@ -7,9 +7,6 @@ sudo rm -f /etc/apt/heroku.list
|
||||
sudo rm -f /etc/apt/openjdk-r-ubuntu-ppa-xenial.list
|
||||
sudo rm -f /etc/apt/partner.list
|
||||
|
||||
# To increase the network reliability, let apt decide which mirror is best to use
|
||||
sudo sed -i -e 's/http:\/\/.*archive/mirror:\/\/mirrors/' -e 's/\/ubuntu\//\/mirrors.txt/' /etc/apt/sources.list
|
||||
|
||||
retry () {
|
||||
$* || $* || $* || $* || $*
|
||||
}
|
||||
@ -27,12 +24,10 @@ retry sudo apt-get -y install \
|
||||
echo "== DOCKER VERSION =="
|
||||
docker version
|
||||
|
||||
if ! command -v aws >/dev/null; then
|
||||
retry sudo pip3 -q install awscli==1.19.64
|
||||
fi
|
||||
retry sudo pip -q install awscli==1.16.35
|
||||
|
||||
if [ -n "${USE_CUDA_DOCKER_RUNTIME:-}" ]; then
|
||||
DRIVER_FN="NVIDIA-Linux-x86_64-495.44.run"
|
||||
DRIVER_FN="NVIDIA-Linux-x86_64-450.51.06.run"
|
||||
wget "https://s3.amazonaws.com/ossci-linux/nvidia_driver/$DRIVER_FN"
|
||||
sudo /bin/bash "$DRIVER_FN" -s --no-drm || (sudo cat /var/log/nvidia-installer.log && false)
|
||||
nvidia-smi
|
||||
@ -43,9 +38,9 @@ if [ -n "${USE_CUDA_DOCKER_RUNTIME:-}" ]; then
|
||||
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
|
||||
curl -s -L "https://nvidia.github.io/nvidia-docker/${distribution}/nvidia-docker.list" | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
|
||||
|
||||
retry sudo apt-get update -qq
|
||||
sudo apt-get update -qq
|
||||
# Necessary to get the `--gpus` flag to function within docker
|
||||
retry sudo apt-get install -y nvidia-container-toolkit
|
||||
sudo apt-get install -y nvidia-container-toolkit
|
||||
sudo systemctl restart docker
|
||||
else
|
||||
# Explicitly remove nvidia docker apt repositories if not building for cuda
|
||||
@ -53,51 +48,43 @@ else
|
||||
fi
|
||||
|
||||
add_to_env_file() {
|
||||
local name=$1
|
||||
local value=$2
|
||||
case "$value" in
|
||||
*\ *)
|
||||
# BASH_ENV should be set by CircleCI
|
||||
echo "${name}='${value}'" >> "${BASH_ENV:-/tmp/env}"
|
||||
;;
|
||||
*)
|
||||
echo "${name}=${value}" >> "${BASH_ENV:-/tmp/env}"
|
||||
;;
|
||||
esac
|
||||
local content
|
||||
content=$1
|
||||
# BASH_ENV should be set by CircleCI
|
||||
echo "${content}" >> "${BASH_ENV:-/tmp/env}"
|
||||
}
|
||||
|
||||
add_to_env_file IN_CI 1
|
||||
add_to_env_file CI_MASTER "${CI_MASTER:-}"
|
||||
add_to_env_file COMMIT_SOURCE "${CIRCLE_BRANCH:-}"
|
||||
add_to_env_file BUILD_ENVIRONMENT "${BUILD_ENVIRONMENT}"
|
||||
add_to_env_file CIRCLE_PULL_REQUEST "${CIRCLE_PULL_REQUEST}"
|
||||
add_to_env_file "IN_CIRCLECI=1"
|
||||
add_to_env_file "COMMIT_SOURCE=${CIRCLE_BRANCH:-}"
|
||||
add_to_env_file "BUILD_ENVIRONMENT=${BUILD_ENVIRONMENT}"
|
||||
add_to_env_file "CIRCLE_PULL_REQUEST=${CIRCLE_PULL_REQUEST}"
|
||||
|
||||
|
||||
if [[ "${BUILD_ENVIRONMENT}" == *-build ]]; then
|
||||
add_to_env_file SCCACHE_BUCKET ossci-compiler-cache-circleci-v2
|
||||
add_to_env_file "SCCACHE_BUCKET=ossci-compiler-cache-circleci-v2"
|
||||
|
||||
SCCACHE_MAX_JOBS=$(( $(nproc) - 1 ))
|
||||
MEMORY_LIMIT_MAX_JOBS=8 # the "large" resource class on CircleCI has 32 CPU cores, if we use all of them we'll OOM
|
||||
MAX_JOBS=$(( ${SCCACHE_MAX_JOBS} > ${MEMORY_LIMIT_MAX_JOBS} ? ${MEMORY_LIMIT_MAX_JOBS} : ${SCCACHE_MAX_JOBS} ))
|
||||
add_to_env_file MAX_JOBS "${MAX_JOBS}"
|
||||
add_to_env_file "MAX_JOBS=${MAX_JOBS}"
|
||||
|
||||
if [ -n "${USE_CUDA_DOCKER_RUNTIME:-}" ]; then
|
||||
add_to_env_file TORCH_CUDA_ARCH_LIST 5.2
|
||||
add_to_env_file "TORCH_CUDA_ARCH_LIST=5.2"
|
||||
fi
|
||||
|
||||
if [[ "${BUILD_ENVIRONMENT}" == *xla* ]]; then
|
||||
# This IAM user allows write access to S3 bucket for sccache & bazels3cache
|
||||
set +x
|
||||
add_to_env_file XLA_CLANG_CACHE_S3_BUCKET_NAME "${XLA_CLANG_CACHE_S3_BUCKET_NAME:-}"
|
||||
add_to_env_file AWS_ACCESS_KEY_ID "${CIRCLECI_AWS_ACCESS_KEY_FOR_SCCACHE_AND_XLA_BAZEL_S3_BUCKET_V2:-}"
|
||||
add_to_env_file AWS_SECRET_ACCESS_KEY "${CIRCLECI_AWS_SECRET_KEY_FOR_SCCACHE_AND_XLA_BAZEL_S3_BUCKET_V2:-}"
|
||||
add_to_env_file "XLA_CLANG_CACHE_S3_BUCKET_NAME=${XLA_CLANG_CACHE_S3_BUCKET_NAME:-}"
|
||||
add_to_env_file "AWS_ACCESS_KEY_ID=${CIRCLECI_AWS_ACCESS_KEY_FOR_SCCACHE_AND_XLA_BAZEL_S3_BUCKET_V2:-}"
|
||||
add_to_env_file "AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_SCCACHE_AND_XLA_BAZEL_S3_BUCKET_V2:-}"
|
||||
set -x
|
||||
else
|
||||
# This IAM user allows write access to S3 bucket for sccache
|
||||
set +x
|
||||
add_to_env_file XLA_CLANG_CACHE_S3_BUCKET_NAME "${XLA_CLANG_CACHE_S3_BUCKET_NAME:-}"
|
||||
add_to_env_file AWS_ACCESS_KEY_ID "${CIRCLECI_AWS_ACCESS_KEY_FOR_SCCACHE_S3_BUCKET_V4:-}"
|
||||
add_to_env_file AWS_SECRET_ACCESS_KEY "${CIRCLECI_AWS_SECRET_KEY_FOR_SCCACHE_S3_BUCKET_V4:-}"
|
||||
add_to_env_file "XLA_CLANG_CACHE_S3_BUCKET_NAME=${XLA_CLANG_CACHE_S3_BUCKET_NAME:-}"
|
||||
add_to_env_file "AWS_ACCESS_KEY_ID=${CIRCLECI_AWS_ACCESS_KEY_FOR_SCCACHE_S3_BUCKET_V4:-}"
|
||||
add_to_env_file "AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_SCCACHE_S3_BUCKET_V4:-}"
|
||||
set -x
|
||||
fi
|
||||
fi
|
||||
@ -106,7 +93,5 @@ fi
|
||||
set +x
|
||||
export AWS_ACCESS_KEY_ID=${CIRCLECI_AWS_ACCESS_KEY_FOR_ECR_READ_WRITE_V4:-}
|
||||
export AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_ECR_READ_WRITE_V4:-}
|
||||
export AWS_ACCOUNT_ID=$(aws sts get-caller-identity|grep Account|cut -f4 -d\")
|
||||
export AWS_REGION=us-east-1
|
||||
aws ecr get-login-password --region $AWS_REGION|docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com
|
||||
eval "$(aws ecr get-login --region us-east-1 --no-include-email)"
|
||||
set -x
|
||||
|
||||
@ -1,140 +0,0 @@
|
||||
# Documentation: https://docs.microsoft.com/en-us/rest/api/azure/devops/build/?view=azure-devops-rest-6.0
|
||||
|
||||
import re
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import requests
|
||||
import time
|
||||
|
||||
AZURE_PIPELINE_BASE_URL = "https://aiinfra.visualstudio.com/PyTorch/"
|
||||
AZURE_DEVOPS_PAT_BASE64 = os.environ.get("AZURE_DEVOPS_PAT_BASE64_SECRET", "")
|
||||
PIPELINE_ID = "911"
|
||||
PROJECT_ID = "0628bce4-2d33-499e-bac5-530e12db160f"
|
||||
TARGET_BRANCH = os.environ.get("CIRCLE_BRANCH", "master")
|
||||
TARGET_COMMIT = os.environ.get("CIRCLE_SHA1", "")
|
||||
|
||||
build_base_url = AZURE_PIPELINE_BASE_URL + "_apis/build/builds?api-version=6.0"
|
||||
|
||||
s = requests.Session()
|
||||
s.headers.update({"Authorization": "Basic " + AZURE_DEVOPS_PAT_BASE64})
|
||||
|
||||
def submit_build(pipeline_id, project_id, source_branch, source_version):
|
||||
print("Submitting build for branch: " + source_branch)
|
||||
print("Commit SHA1: ", source_version)
|
||||
|
||||
run_build_raw = s.post(build_base_url, json={
|
||||
"definition": {"id": pipeline_id},
|
||||
"project": {"id": project_id},
|
||||
"sourceBranch": source_branch,
|
||||
"sourceVersion": source_version
|
||||
})
|
||||
|
||||
try:
|
||||
run_build_json = run_build_raw.json()
|
||||
except json.decoder.JSONDecodeError as e:
|
||||
print(e)
|
||||
print("Failed to parse the response. Check if the Azure DevOps PAT is incorrect or expired.")
|
||||
sys.exit(-1)
|
||||
|
||||
build_id = run_build_json['id']
|
||||
|
||||
print("Submitted bulid: " + str(build_id))
|
||||
print("Bulid URL: " + run_build_json['url'])
|
||||
return build_id
|
||||
|
||||
def get_build(_id):
|
||||
get_build_url = AZURE_PIPELINE_BASE_URL + f"/_apis/build/builds/{_id}?api-version=6.0"
|
||||
get_build_raw = s.get(get_build_url)
|
||||
return get_build_raw.json()
|
||||
|
||||
def get_build_logs(_id):
|
||||
get_build_logs_url = AZURE_PIPELINE_BASE_URL + f"/_apis/build/builds/{_id}/logs?api-version=6.0"
|
||||
get_build_logs_raw = s.get(get_build_logs_url)
|
||||
return get_build_logs_raw.json()
|
||||
|
||||
def get_log_content(url):
|
||||
resp = s.get(url)
|
||||
return resp.text
|
||||
|
||||
def wait_for_build(_id):
|
||||
build_detail = get_build(_id)
|
||||
build_status = build_detail['status']
|
||||
|
||||
while build_status == 'notStarted':
|
||||
print('Waiting for run to start: ' + str(_id))
|
||||
sys.stdout.flush()
|
||||
try:
|
||||
build_detail = get_build(_id)
|
||||
build_status = build_detail['status']
|
||||
except Exception as e:
|
||||
print("Error getting build")
|
||||
print(e)
|
||||
|
||||
time.sleep(30)
|
||||
|
||||
print("Bulid started: ", str(_id))
|
||||
|
||||
handled_logs = set()
|
||||
while build_status == 'inProgress':
|
||||
try:
|
||||
print("Waiting for log: " + str(_id))
|
||||
logs = get_build_logs(_id)
|
||||
except Exception as e:
|
||||
print("Error fetching logs")
|
||||
print(e)
|
||||
time.sleep(30)
|
||||
continue
|
||||
|
||||
for log in logs['value']:
|
||||
log_id = log['id']
|
||||
if log_id in handled_logs:
|
||||
continue
|
||||
handled_logs.add(log_id)
|
||||
print('Fetching log: \n' + log['url'])
|
||||
try:
|
||||
log_content = get_log_content(log['url'])
|
||||
print(log_content)
|
||||
except Exception as e:
|
||||
print("Error getting log content")
|
||||
print(e)
|
||||
sys.stdout.flush()
|
||||
build_detail = get_build(_id)
|
||||
build_status = build_detail['status']
|
||||
time.sleep(30)
|
||||
|
||||
build_result = build_detail['result']
|
||||
|
||||
print("Bulid status: " + build_status)
|
||||
print("Bulid result: " + build_result)
|
||||
|
||||
return build_status, build_result
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Convert the branch name for Azure DevOps
|
||||
match = re.search(r'pull/(\d+)', TARGET_BRANCH)
|
||||
if match is not None:
|
||||
pr_num = match.group(1)
|
||||
SOURCE_BRANCH = f'refs/pull/{pr_num}/head'
|
||||
else:
|
||||
SOURCE_BRANCH = f'refs/heads/{TARGET_BRANCH}'
|
||||
|
||||
MAX_RETRY = 2
|
||||
retry = MAX_RETRY
|
||||
|
||||
while retry > 0:
|
||||
build_id = submit_build(PIPELINE_ID, PROJECT_ID, SOURCE_BRANCH, TARGET_COMMIT)
|
||||
build_status, build_result = wait_for_build(build_id)
|
||||
|
||||
if build_result != 'succeeded':
|
||||
retry = retry - 1
|
||||
if retry > 0:
|
||||
print("Retrying... remaining attempt: " + str(retry))
|
||||
# Wait a bit before retrying
|
||||
time.sleep((MAX_RETRY - retry) * 120)
|
||||
continue
|
||||
else:
|
||||
print("No more chance to retry. Giving up.")
|
||||
sys.exit(-1)
|
||||
else:
|
||||
break
|
||||
147
.circleci/scripts/upload_binary_size_to_scuba.py
Normal file
147
.circleci/scripts/upload_binary_size_to_scuba.py
Normal file
@ -0,0 +1,147 @@
|
||||
import glob
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import os.path
|
||||
import pathlib
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
import zipfile
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
def get_size(file_dir):
|
||||
try:
|
||||
# we should only expect one file, if no, something is wrong
|
||||
file_name = glob.glob(os.path.join(file_dir, "*"))[0]
|
||||
return os.stat(file_name).st_size
|
||||
except:
|
||||
logging.exception(f"error getting file from: {file_dir}")
|
||||
return 0
|
||||
|
||||
|
||||
def build_message(size):
|
||||
pkg_type, py_ver, cu_ver, *_ = os.environ.get("BUILD_ENVIRONMENT", "").split() + [
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
]
|
||||
os_name = os.uname()[0].lower()
|
||||
if os_name == "darwin":
|
||||
os_name = "macos"
|
||||
return {
|
||||
"normal": {
|
||||
"os": os_name,
|
||||
"pkg_type": pkg_type,
|
||||
"py_ver": py_ver,
|
||||
"cu_ver": cu_ver,
|
||||
"pr": os.environ.get("CIRCLE_PR_NUMBER"),
|
||||
"build_num": os.environ.get("CIRCLE_BUILD_NUM"),
|
||||
"sha1": os.environ.get("CIRCLE_SHA1"),
|
||||
"branch": os.environ.get("CIRCLE_BRANCH"),
|
||||
},
|
||||
"int": {
|
||||
"time": int(time.time()),
|
||||
"size": size,
|
||||
"commit_time": int(os.environ.get("COMMIT_TIME", "0")),
|
||||
"run_duration": int(time.time() - os.path.getmtime(os.path.realpath(__file__))),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def send_message(messages):
|
||||
access_token = os.environ.get("SCRIBE_GRAPHQL_ACCESS_TOKEN")
|
||||
if not access_token:
|
||||
raise ValueError("Can't find access token from environment variable")
|
||||
url = "https://graph.facebook.com/scribe_logs"
|
||||
r = requests.post(
|
||||
url,
|
||||
data={
|
||||
"access_token": access_token,
|
||||
"logs": json.dumps(
|
||||
[
|
||||
{
|
||||
"category": "perfpipe_pytorch_binary_size",
|
||||
"message": json.dumps(message),
|
||||
"line_escape": False,
|
||||
}
|
||||
for message in messages
|
||||
]
|
||||
),
|
||||
},
|
||||
)
|
||||
print(r.text)
|
||||
r.raise_for_status()
|
||||
|
||||
|
||||
def report_android_sizes(file_dir):
|
||||
def gen_sizes():
|
||||
# we should only expect one file, if no, something is wrong
|
||||
aar_files = list(pathlib.Path(file_dir).rglob("pytorch_android-*.aar"))
|
||||
if len(aar_files) != 1:
|
||||
logging.exception(f"error getting aar files from: {file_dir} / {aar_files}")
|
||||
return
|
||||
|
||||
aar_file = aar_files[0]
|
||||
zf = zipfile.ZipFile(aar_file)
|
||||
for info in zf.infolist():
|
||||
# Scan ".so" libs in `jni` folder. Examples:
|
||||
# jni/arm64-v8a/libfbjni.so
|
||||
# jni/arm64-v8a/libpytorch_jni.so
|
||||
m = re.match(r"^jni/([^/]+)/(.*\.so)$", info.filename)
|
||||
if not m:
|
||||
continue
|
||||
arch, lib = m.groups()
|
||||
# report per architecture library size
|
||||
yield [arch, lib, info.compress_size, info.file_size]
|
||||
|
||||
# report whole package size
|
||||
yield ["aar", aar_file.name, os.stat(aar_file).st_size, 0]
|
||||
|
||||
def gen_messages():
|
||||
android_build_type = os.environ.get("ANDROID_BUILD_TYPE")
|
||||
for arch, lib, comp_size, uncomp_size in gen_sizes():
|
||||
print(android_build_type, arch, lib, comp_size, uncomp_size)
|
||||
yield {
|
||||
"normal": {
|
||||
"os": "android",
|
||||
# TODO: create dedicated columns
|
||||
"pkg_type": "{}/{}/{}".format(android_build_type, arch, lib),
|
||||
"cu_ver": "", # dummy value for derived field `build_name`
|
||||
"py_ver": "", # dummy value for derived field `build_name`
|
||||
"pr": os.environ.get("CIRCLE_PR_NUMBER"),
|
||||
"build_num": os.environ.get("CIRCLE_BUILD_NUM"),
|
||||
"sha1": os.environ.get("CIRCLE_SHA1"),
|
||||
"branch": os.environ.get("CIRCLE_BRANCH"),
|
||||
},
|
||||
"int": {
|
||||
"time": int(time.time()),
|
||||
"commit_time": int(os.environ.get("COMMIT_TIME", "0")),
|
||||
"run_duration": int(time.time() - os.path.getmtime(os.path.realpath(__file__))),
|
||||
"size": comp_size,
|
||||
"raw_size": uncomp_size,
|
||||
},
|
||||
}
|
||||
|
||||
send_message(list(gen_messages()))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
file_dir = os.environ.get(
|
||||
"PYTORCH_FINAL_PACKAGE_DIR", "/home/circleci/project/final_pkgs"
|
||||
)
|
||||
if len(sys.argv) == 2:
|
||||
file_dir = sys.argv[1]
|
||||
print("checking dir: " + file_dir)
|
||||
|
||||
if "-android" in os.environ.get("BUILD_ENVIRONMENT", ""):
|
||||
report_android_sizes(file_dir)
|
||||
else:
|
||||
size = get_size(file_dir)
|
||||
if size != 0:
|
||||
try:
|
||||
send_message([build_message(size)])
|
||||
except:
|
||||
logging.exception("can't send message")
|
||||
@ -1,10 +1,7 @@
|
||||
# https://developercommunity.visualstudio.com/t/install-specific-version-of-vs-component/1142479
|
||||
# Where to find the links: https://docs.microsoft.com/en-us/visualstudio/releases/2019/history#release-dates-and-build-numbers
|
||||
|
||||
# BuildTools from S3
|
||||
$VS_DOWNLOAD_LINK = "https://s3.amazonaws.com/ossci-windows/vs${env:VS_VERSION}_BuildTools.exe"
|
||||
$VS_DOWNLOAD_LINK = "https://aka.ms/vs/15/release/vs_buildtools.exe"
|
||||
$COLLECT_DOWNLOAD_LINK = "https://aka.ms/vscollect.exe"
|
||||
$VS_INSTALL_ARGS = @("--nocache","--quiet","--wait", "--add Microsoft.VisualStudio.Workload.VCTools",
|
||||
"--add Microsoft.VisualStudio.Component.VC.Tools.14.13",
|
||||
"--add Microsoft.Component.MSBuild",
|
||||
"--add Microsoft.VisualStudio.Component.Roslyn.Compiler",
|
||||
"--add Microsoft.VisualStudio.Component.TextTemplating",
|
||||
@ -14,45 +11,17 @@ $VS_INSTALL_ARGS = @("--nocache","--quiet","--wait", "--add Microsoft.VisualStud
|
||||
"--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
|
||||
"--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81")
|
||||
|
||||
if (${env:INSTALL_WINDOWS_SDK} -eq "1") {
|
||||
$VS_INSTALL_ARGS += "--add Microsoft.VisualStudio.Component.Windows10SDK.19041"
|
||||
}
|
||||
|
||||
if (Test-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe") {
|
||||
$VS_VERSION_major = [int] ${env:VS_VERSION}.split(".")[0]
|
||||
$existingPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -products "Microsoft.VisualStudio.Product.BuildTools" -version "[${env:VS_VERSION}, ${env:VS_VERSION_major + 1})" -property installationPath
|
||||
if (($existingPath -ne $null) -and (!${env:CIRCLECI})) {
|
||||
echo "Found correctly versioned existing BuildTools installation in $existingPath"
|
||||
exit 0
|
||||
}
|
||||
$pathToRemove = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -products "Microsoft.VisualStudio.Product.BuildTools" -property installationPath
|
||||
}
|
||||
|
||||
echo "Downloading VS installer from S3."
|
||||
curl.exe --retry 3 -kL $VS_DOWNLOAD_LINK --output vs_installer.exe
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
echo "Download of the VS 2019 Version ${env:VS_VERSION} installer failed"
|
||||
echo "Download of the VS 2017 installer failed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ($pathToRemove -ne $null) {
|
||||
echo "Uninstalling $pathToRemove."
|
||||
$VS_UNINSTALL_ARGS = @("uninstall", "--installPath", "`"$pathToRemove`"", "--quiet","--wait")
|
||||
$process = Start-Process "${PWD}\vs_installer.exe" -ArgumentList $VS_UNINSTALL_ARGS -NoNewWindow -Wait -PassThru
|
||||
$exitCode = $process.ExitCode
|
||||
if (($exitCode -ne 0) -and ($exitCode -ne 3010)) {
|
||||
echo "Original BuildTools uninstall failed with code $exitCode"
|
||||
exit 1
|
||||
}
|
||||
echo "Other versioned BuildTools uninstalled."
|
||||
}
|
||||
|
||||
echo "Installing Visual Studio version ${env:VS_VERSION}."
|
||||
$process = Start-Process "${PWD}\vs_installer.exe" -ArgumentList $VS_INSTALL_ARGS -NoNewWindow -Wait -PassThru
|
||||
Remove-Item -Path vs_installer.exe -Force
|
||||
$exitCode = $process.ExitCode
|
||||
if (($exitCode -ne 0) -and ($exitCode -ne 3010)) {
|
||||
echo "VS 2019 installer exited with code $exitCode, which should be one of [0, 3010]."
|
||||
echo "VS 2017 installer exited with code $exitCode, which should be one of [0, 3010]."
|
||||
curl.exe --retry 3 -kL $COLLECT_DOWNLOAD_LINK --output Collect.exe
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
echo "Download of the VS Collect tool failed."
|
||||
@ -60,6 +29,6 @@ if (($exitCode -ne 0) -and ($exitCode -ne 3010)) {
|
||||
}
|
||||
Start-Process "${PWD}\Collect.exe" -NoNewWindow -Wait -PassThru
|
||||
New-Item -Path "C:\w\build-results" -ItemType "directory" -Force
|
||||
Copy-Item -Path "${env:TEMP}\vslogs.zip" -Destination "C:\w\build-results\"
|
||||
Copy-Item -Path "C:\Users\circleci\AppData\Local\Temp\vslogs.zip" -Destination "C:\w\build-results\"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
$CMATH_DOWNLOAD_LINK = "https://raw.githubusercontent.com/microsoft/STL/12c684bba78f9b032050526abdebf14f58ca26a3/stl/inc/cmath"
|
||||
$VC14_28_INSTALL_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include"
|
||||
|
||||
curl.exe --retry 3 -kL $CMATH_DOWNLOAD_LINK --output "$home\cmath"
|
||||
Move-Item -Path "$home\cmath" -Destination "$VC14_28_INSTALL_PATH" -Force
|
||||
@ -1,78 +1,57 @@
|
||||
#!/bin/bash
|
||||
set -eux -o pipefail
|
||||
|
||||
case ${CUDA_VERSION} in
|
||||
10.1)
|
||||
cuda_installer_name="cuda_10.1.243_426.00_win10"
|
||||
cuda_install_packages="nvcc_10.1 cuobjdump_10.1 nvprune_10.1 cupti_10.1 cublas_10.1 cublas_dev_10.1 cudart_10.1 cufft_10.1 cufft_dev_10.1 curand_10.1 curand_dev_10.1 cusolver_10.1 cusolver_dev_10.1 cusparse_10.1 cusparse_dev_10.1 nvgraph_10.1 nvgraph_dev_10.1 npp_10.1 npp_dev_10.1 nvrtc_10.1 nvrtc_dev_10.1 nvml_dev_10.1"
|
||||
;;
|
||||
10.2)
|
||||
cuda_installer_name="cuda_10.2.89_441.22_win10"
|
||||
cuda_install_packages="nvcc_10.2 cuobjdump_10.2 nvprune_10.2 cupti_10.2 cublas_10.2 cublas_dev_10.2 cudart_10.2 cufft_10.2 cufft_dev_10.2 curand_10.2 curand_dev_10.2 cusolver_10.2 cusolver_dev_10.2 cusparse_10.2 cusparse_dev_10.2 nvgraph_10.2 nvgraph_dev_10.2 npp_10.2 npp_dev_10.2 nvrtc_10.2 nvrtc_dev_10.2 nvml_dev_10.2"
|
||||
;;
|
||||
11.1)
|
||||
cuda_installer_name="cuda_11.1.1_456.81_win10"
|
||||
cuda_install_packages="nvcc_11.1 cuobjdump_11.1 nvprune_11.1 nvprof_11.1 cupti_11.1 cublas_11.1 cublas_dev_11.1 cudart_11.1 cufft_11.1 cufft_dev_11.1 curand_11.1 curand_dev_11.1 cusolver_11.1 cusolver_dev_11.1 cusparse_11.1 cusparse_dev_11.1 npp_11.1 npp_dev_11.1 nvrtc_11.1 nvrtc_dev_11.1 nvml_dev_11.1"
|
||||
;;
|
||||
11.3)
|
||||
cuda_installer_name="cuda_11.3.0_465.89_win10"
|
||||
cuda_install_packages="thrust_11.3 nvcc_11.3 cuobjdump_11.3 nvprune_11.3 nvprof_11.3 cupti_11.3 cublas_11.3 cublas_dev_11.3 cudart_11.3 cufft_11.3 cufft_dev_11.3 curand_11.3 curand_dev_11.3 cusolver_11.3 cusolver_dev_11.3 cusparse_11.3 cusparse_dev_11.3 npp_11.3 npp_dev_11.3 nvrtc_11.3 nvrtc_dev_11.3 nvml_dev_11.3"
|
||||
;;
|
||||
11.5)
|
||||
cuda_installer_name="cuda_11.5.0_496.13_win10"
|
||||
cuda_install_packages="thrust_11.5 nvcc_11.5 cuobjdump_11.5 nvprune_11.5 nvprof_11.5 cupti_11.5 cublas_11.5 cublas_dev_11.5 cudart_11.5 cufft_11.5 cufft_dev_11.5 curand_11.5 curand_dev_11.5 cusolver_11.5 cusolver_dev_11.5 cusparse_11.5 cusparse_dev_11.5 npp_11.5 npp_dev_11.5 nvrtc_11.5 nvrtc_dev_11.5 nvml_dev_11.5"
|
||||
;;
|
||||
*)
|
||||
echo "CUDA_VERSION $CUDA_VERSION is not supported yet"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [[ -f "/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${CUDA_VERSION}/bin/nvcc.exe" ]]; then
|
||||
echo "Existing CUDA v${CUDA_VERSION} installation found, skipping install"
|
||||
if [[ "$CUDA_VERSION" == "10" ]]; then
|
||||
cuda_complete_version="10.1"
|
||||
cuda_installer_name="cuda_10.1.243_426.00_win10"
|
||||
msbuild_project_dir="CUDAVisualStudioIntegration/extras/visual_studio_integration/MSBuildExtensions"
|
||||
cuda_install_packages="nvcc_10.1 cuobjdump_10.1 nvprune_10.1 cupti_10.1 cublas_10.1 cublas_dev_10.1 cudart_10.1 cufft_10.1 cufft_dev_10.1 curand_10.1 curand_dev_10.1 cusolver_10.1 cusolver_dev_10.1 cusparse_10.1 cusparse_dev_10.1 nvgraph_10.1 nvgraph_dev_10.1 npp_10.1 npp_dev_10.1 nvrtc_10.1 nvrtc_dev_10.1 nvml_dev_10.1"
|
||||
elif [[ "$CUDA_VERSION" == "11" ]]; then
|
||||
cuda_complete_version="11.0"
|
||||
cuda_installer_name="cuda_11.0.2_451.48_win10"
|
||||
msbuild_project_dir="visual_studio_integration/CUDAVisualStudioIntegration/extras/visual_studio_integration/MSBuildExtensions"
|
||||
cuda_install_packages="nvcc_11.0 cuobjdump_11.0 nvprune_11.0 nvprof_11.0 cupti_11.0 cublas_11.0 cublas_dev_11.0 cudart_11.0 cufft_11.0 cufft_dev_11.0 curand_11.0 curand_dev_11.0 cusolver_11.0 cusolver_dev_11.0 cusparse_11.0 cusparse_dev_11.0 npp_11.0 npp_dev_11.0 nvrtc_11.0 nvrtc_dev_11.0 nvml_dev_11.0"
|
||||
else
|
||||
tmp_dir=$(mktemp -d)
|
||||
(
|
||||
# no need to popd after, the subshell shouldn't affect the parent shell
|
||||
pushd "${tmp_dir}"
|
||||
cuda_installer_link="https://ossci-windows.s3.amazonaws.com/${cuda_installer_name}.exe"
|
||||
|
||||
curl --retry 3 -kLO $cuda_installer_link
|
||||
7z x ${cuda_installer_name}.exe -o${cuda_installer_name}
|
||||
pushd ${cuda_installer_name}
|
||||
mkdir cuda_install_logs
|
||||
|
||||
set +e
|
||||
|
||||
# This breaks for some reason if you quote cuda_install_packages
|
||||
# shellcheck disable=SC2086
|
||||
./setup.exe -s ${cuda_install_packages} -loglevel:6 -log:"$(pwd -W)/cuda_install_logs"
|
||||
|
||||
set -e
|
||||
|
||||
if [[ ! -f "/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${CUDA_VERSION}/bin/nvcc.exe" ]]; then
|
||||
echo "CUDA installation failed"
|
||||
mkdir -p /c/w/build-results
|
||||
7z a "c:\\w\\build-results\\cuda_install_logs.7z" cuda_install_logs
|
||||
exit 1
|
||||
fi
|
||||
)
|
||||
rm -rf "${tmp_dir}"
|
||||
echo "CUDA_VERSION $CUDA_VERSION is not supported yet"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -f "/c/Program Files/NVIDIA Corporation/NvToolsExt/bin/x64/nvToolsExt64_1.dll" ]]; then
|
||||
echo "Existing nvtools installation found, skipping install"
|
||||
cuda_installer_link="https://ossci-windows.s3.amazonaws.com/${cuda_installer_name}.exe"
|
||||
|
||||
curl --retry 3 -kLO $cuda_installer_link
|
||||
7z x ${cuda_installer_name}.exe -o${cuda_installer_name}
|
||||
cd ${cuda_installer_name}
|
||||
mkdir cuda_install_logs
|
||||
|
||||
set +e
|
||||
|
||||
./setup.exe -s ${cuda_install_packages} -loglevel:6 -log:"$(pwd -W)/cuda_install_logs"
|
||||
|
||||
set -e
|
||||
|
||||
if [[ "${VC_YEAR}" == "2017" ]]; then
|
||||
cp -r ${msbuild_project_dir}/* "C:/Program Files (x86)/Microsoft Visual Studio/2017/${VC_PRODUCT}/Common7/IDE/VC/VCTargets/BuildCustomizations/"
|
||||
else
|
||||
# create tmp dir for download
|
||||
tmp_dir=$(mktemp -d)
|
||||
(
|
||||
# no need to popd after, the subshell shouldn't affect the parent shell
|
||||
pushd "${tmp_dir}"
|
||||
curl --retry 3 -kLO https://ossci-windows.s3.amazonaws.com/NvToolsExt.7z
|
||||
7z x NvToolsExt.7z -oNvToolsExt
|
||||
mkdir -p "C:/Program Files/NVIDIA Corporation/NvToolsExt"
|
||||
cp -r NvToolsExt/* "C:/Program Files/NVIDIA Corporation/NvToolsExt/"
|
||||
)
|
||||
rm -rf "${tmp_dir}"
|
||||
cp -r ${msbuild_project_dir}/* "C:/Program Files (x86)/Microsoft Visual Studio/2019/${VC_PRODUCT}/MSBuild/Microsoft/VC/v160/BuildCustomizations/"
|
||||
fi
|
||||
|
||||
if ! ls "/c/Program Files/NVIDIA Corporation/NvToolsExt/bin/x64/nvToolsExt64_1.dll"
|
||||
then
|
||||
curl --retry 3 -kLO https://ossci-windows.s3.amazonaws.com/NvToolsExt.7z
|
||||
7z x NvToolsExt.7z -oNvToolsExt
|
||||
mkdir -p "C:/Program Files/NVIDIA Corporation/NvToolsExt"
|
||||
cp -r NvToolsExt/* "C:/Program Files/NVIDIA Corporation/NvToolsExt/"
|
||||
export NVTOOLSEXT_PATH="C:\\Program Files\\NVIDIA Corporation\\NvToolsExt\\"
|
||||
fi
|
||||
|
||||
if ! ls "/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${cuda_complete_version}/bin/nvcc.exe"
|
||||
then
|
||||
echo "CUDA installation failed"
|
||||
mkdir -p /c/w/build-results
|
||||
7z a "c:\\w\\build-results\\cuda_install_logs.7z" cuda_install_logs
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ..
|
||||
rm -rf ./${cuda_installer_name}
|
||||
rm -f ./${cuda_installer_name}.exe
|
||||
|
||||
@ -1,49 +1,21 @@
|
||||
#!/bin/bash
|
||||
set -eux -o pipefail
|
||||
|
||||
# This is typically blank but for CUDA 10* it'll be set to 10
|
||||
windows_version_qualifier=""
|
||||
|
||||
case ${CUDA_VERSION} in
|
||||
10.1)
|
||||
archive_version="v7.6.4.38"
|
||||
windows_version_qualifier="10"
|
||||
;;
|
||||
10.2)
|
||||
archive_version="v7.6.5.32"
|
||||
windows_version_qualifier="10"
|
||||
;;
|
||||
11.1)
|
||||
archive_version="v8.0.5.39"
|
||||
;;
|
||||
11.3)
|
||||
archive_version="v8.2.0.53"
|
||||
;;
|
||||
11.5)
|
||||
archive_version="v8.2.0.53"
|
||||
;;
|
||||
*)
|
||||
echo "CUDA_VERSION: ${CUDA_VERSION} not supported yet"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
cudnn_installer_name="cudnn_installer.zip"
|
||||
cudnn_installer_link="https://ossci-windows.s3.amazonaws.com/cudnn-${CUDA_VERSION}-windows${windows_version_qualifier}-x64-${archive_version}.zip"
|
||||
cudnn_install_folder="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${CUDA_VERSION}/"
|
||||
|
||||
if [[ -f "${cudnn_install_folder}/include/cudnn.h" ]]; then
|
||||
echo "Existing cudnn installation found, skipping install..."
|
||||
if [[ "$CUDA_VERSION" == "10" ]]; then
|
||||
cuda_complete_version="10.1"
|
||||
cudnn_installer_name="cudnn-10.1-windows10-x64-v7.6.4.38"
|
||||
elif [[ "$CUDA_VERSION" == "11" ]]; then
|
||||
cuda_complete_version="11.0"
|
||||
cudnn_installer_name="cudnn-11.0-windows-x64-v8.0.2.39"
|
||||
else
|
||||
tmp_dir=$(mktemp -d)
|
||||
(
|
||||
pushd "${tmp_dir}"
|
||||
curl --retry 3 -o "${cudnn_installer_name}" "$cudnn_installer_link"
|
||||
7z x "${cudnn_installer_name}" -ocudnn
|
||||
# Use '${var:?}/*' to avoid potentially expanding to '/*'
|
||||
# Remove all of the directories before attempting to copy files
|
||||
rm -rf "${cudnn_install_folder:?}/*"
|
||||
cp -rf cudnn/cuda/* "${cudnn_install_folder}"
|
||||
)
|
||||
rm -rf "${tmp_dir}"
|
||||
echo "CUDNN for CUDA_VERSION $CUDA_VERSION is not supported yet"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cudnn_installer_link="https://ossci-windows.s3.amazonaws.com/${cudnn_installer_name}.zip"
|
||||
|
||||
curl --retry 3 -O $cudnn_installer_link
|
||||
7z x ${cudnn_installer_name}.zip -ocudnn
|
||||
cp -r cudnn/cuda/* "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${cuda_complete_version}/"
|
||||
rm -rf cudnn
|
||||
rm -f ${cudnn_installer_name}.zip
|
||||
|
||||
@ -15,15 +15,11 @@ pytorch_params: &pytorch_params
|
||||
build_only:
|
||||
type: string
|
||||
default: ""
|
||||
ci_master:
|
||||
type: string
|
||||
default: ""
|
||||
environment:
|
||||
BUILD_ENVIRONMENT: << parameters.build_environment >>
|
||||
DOCKER_IMAGE: << parameters.docker_image >>
|
||||
USE_CUDA_DOCKER_RUNTIME: << parameters.use_cuda_docker_runtime >>
|
||||
BUILD_ONLY: << parameters.build_only >>
|
||||
CI_MASTER: << pipeline.parameters.run_master_build >>
|
||||
resource_class: << parameters.resource_class >>
|
||||
|
||||
pytorch_ios_params: &pytorch_ios_params
|
||||
@ -40,23 +36,11 @@ pytorch_ios_params: &pytorch_ios_params
|
||||
op_list:
|
||||
type: string
|
||||
default: ""
|
||||
use_metal:
|
||||
type: string
|
||||
default: "0"
|
||||
lite_interpreter:
|
||||
type: string
|
||||
default: "1"
|
||||
use_coreml:
|
||||
type: string
|
||||
default: "0"
|
||||
environment:
|
||||
BUILD_ENVIRONMENT: << parameters.build_environment >>
|
||||
IOS_ARCH: << parameters.ios_arch >>
|
||||
IOS_PLATFORM: << parameters.ios_platform >>
|
||||
SELECTED_OP_LIST: << parameters.op_list >>
|
||||
USE_PYTORCH_METAL: << parameters.use_metal >>
|
||||
BUILD_LITE_INTERPRETER: << parameters.lite_interpreter >>
|
||||
USE_COREML_DELEGATE: << parameters.use_coreml >>
|
||||
|
||||
pytorch_windows_params: &pytorch_windows_params
|
||||
parameters:
|
||||
@ -71,13 +55,10 @@ pytorch_windows_params: &pytorch_windows_params
|
||||
default: ""
|
||||
cuda_version:
|
||||
type: string
|
||||
default: "10.1"
|
||||
default: "10"
|
||||
python_version:
|
||||
type: string
|
||||
default: "3.8"
|
||||
vs_version:
|
||||
type: string
|
||||
default: "16.8.6"
|
||||
default: "3.6"
|
||||
vc_version:
|
||||
type: string
|
||||
default: "14.16"
|
||||
@ -95,11 +76,10 @@ pytorch_windows_params: &pytorch_windows_params
|
||||
SCCACHE_BUCKET: "ossci-compiler-cache"
|
||||
CUDA_VERSION: <<parameters.cuda_version>>
|
||||
PYTHON_VERSION: <<parameters.python_version>>
|
||||
VS_VERSION: <<parameters.vs_version>>
|
||||
VC_VERSION: <<parameters.vc_version>>
|
||||
VC_YEAR: <<parameters.vc_year>>
|
||||
VC_PRODUCT: <<parameters.vc_product>>
|
||||
USE_CUDA: <<parameters.use_cuda>>
|
||||
TORCH_CUDA_ARCH_LIST: "5.2 7.5"
|
||||
TORCH_CUDA_ARCH_LIST: "7.5"
|
||||
JOB_BASE_NAME: <<parameters.test_name>>
|
||||
JOB_EXECUTOR: <<parameters.executor>>
|
||||
|
||||
@ -103,7 +103,7 @@ commands:
|
||||
name: (Optional) Merge target branch
|
||||
no_output_timeout: "10m"
|
||||
command: |
|
||||
if [[ -n "$CIRCLE_PULL_REQUEST" && "$CIRCLE_BRANCH" != "nightly" ]]; then
|
||||
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
|
||||
PR_NUM=$(basename $CIRCLE_PULL_REQUEST)
|
||||
CIRCLE_PR_BASE_BRANCH=$(curl -s https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$PR_NUM | jq -r '.base.ref')
|
||||
if [[ "${BUILD_ENVIRONMENT}" == *"xla"* || "${BUILD_ENVIRONMENT}" == *"gcc5"* ]] ; then
|
||||
@ -171,4 +171,4 @@ commands:
|
||||
cd ~/project
|
||||
export ANDROID_BUILD_TYPE="<< parameters.build_type >>"
|
||||
export COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba android
|
||||
python3 .circleci/scripts/upload_binary_size_to_scuba.py android
|
||||
|
||||
@ -11,21 +11,19 @@ parameters:
|
||||
run_binary_tests:
|
||||
type: boolean
|
||||
default: false
|
||||
run_build:
|
||||
type: boolean
|
||||
default: true
|
||||
run_master_build:
|
||||
type: boolean
|
||||
default: false
|
||||
run_slow_gradcheck_build:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
docker_config_defaults: &docker_config_defaults
|
||||
user: jenkins
|
||||
aws_auth:
|
||||
# This IAM user only allows read-write access to ECR
|
||||
aws_access_key_id: ${CIRCLECI_AWS_ACCESS_KEY_FOR_ECR_READ_WRITE_V4}
|
||||
aws_secret_access_key: ${CIRCLECI_AWS_SECRET_KEY_FOR_ECR_READ_WRITE_V4}
|
||||
|
||||
executors:
|
||||
windows-with-nvidia-gpu:
|
||||
machine:
|
||||
resource_class: windows.gpu.nvidia.medium
|
||||
image: windows-server-2019-nvidia:previous
|
||||
image: windows-server-2019-nvidia:stable
|
||||
shell: bash.exe
|
||||
|
||||
windows-xlarge-cpu-with-nvidia-cuda:
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
jobs:
|
||||
binary_linux_build:
|
||||
<<: *binary_linux_build_params
|
||||
steps:
|
||||
@ -23,14 +22,14 @@ jobs:
|
||||
command: |
|
||||
ls -lah /final_pkgs
|
||||
- run:
|
||||
name: upload build & binary data
|
||||
name: save binary size
|
||||
no_output_timeout: "5m"
|
||||
command: |
|
||||
source /env
|
||||
cd /pytorch && export COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
python3 -mpip install requests && \
|
||||
SCRIBE_GRAPHQL_ACCESS_TOKEN=${SCRIBE_GRAPHQL_ACCESS_TOKEN} \
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
python3 /pytorch/.circleci/scripts/upload_binary_size_to_scuba.py || exit 0
|
||||
- persist_to_workspace:
|
||||
root: /
|
||||
paths: final_pkgs
|
||||
@ -46,7 +45,7 @@ jobs:
|
||||
binary_linux_test:
|
||||
<<: *binary_linux_test_upload_params
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
# See Note [Workspace for CircleCI scripts] in job-specs-setup.yml
|
||||
- checkout
|
||||
@ -109,7 +108,7 @@ jobs:
|
||||
smoke_linux_test:
|
||||
<<: *binary_linux_test_upload_params
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
- checkout
|
||||
- calculate_docker_image_tag
|
||||
@ -136,7 +135,7 @@ jobs:
|
||||
smoke_mac_test:
|
||||
<<: *binary_linux_test_upload_params
|
||||
macos:
|
||||
xcode: "12.0"
|
||||
xcode: "11.2.1"
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
@ -161,7 +160,7 @@ jobs:
|
||||
binary_mac_build:
|
||||
<<: *binary_mac_params
|
||||
macos:
|
||||
xcode: "12.0"
|
||||
xcode: "11.2.1"
|
||||
steps:
|
||||
# See Note [Workspace for CircleCI scripts] in job-specs-setup.yml
|
||||
- checkout
|
||||
@ -175,7 +174,7 @@ jobs:
|
||||
|
||||
- run:
|
||||
name: Build
|
||||
no_output_timeout: "90m"
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
# Do not set -u here; there is some problem with CircleCI
|
||||
# variable expansion with PROMPT_COMMAND
|
||||
@ -199,48 +198,10 @@ jobs:
|
||||
root: /Users/distiller/project
|
||||
paths: final_pkgs
|
||||
|
||||
- store_artifacts:
|
||||
path: /Users/distiller/project/final_pkgs
|
||||
|
||||
binary_macos_arm64_build:
|
||||
<<: *binary_mac_params
|
||||
macos:
|
||||
xcode: "12.3.0"
|
||||
steps:
|
||||
# See Note [Workspace for CircleCI scripts] in job-specs-setup.yml
|
||||
- checkout
|
||||
- run:
|
||||
<<: *binary_checkout
|
||||
- run:
|
||||
<<: *binary_populate_env
|
||||
- brew_update
|
||||
- run:
|
||||
<<: *binary_install_miniconda
|
||||
|
||||
- run:
|
||||
name: Build
|
||||
no_output_timeout: "90m"
|
||||
command: |
|
||||
# Do not set -u here; there is some problem with CircleCI
|
||||
# variable expansion with PROMPT_COMMAND
|
||||
set -ex -o pipefail
|
||||
export CROSS_COMPILE_ARM64=1
|
||||
script="/Users/distiller/project/pytorch/.circleci/scripts/binary_macos_build.sh"
|
||||
cat "$script"
|
||||
source "$script"
|
||||
|
||||
- persist_to_workspace:
|
||||
root: /Users/distiller/project
|
||||
paths: final_pkgs
|
||||
|
||||
- store_artifacts:
|
||||
path: /Users/distiller/project/final_pkgs
|
||||
|
||||
|
||||
binary_ios_build:
|
||||
<<: *pytorch_ios_params
|
||||
macos:
|
||||
xcode: "12.5.1"
|
||||
xcode: "12.0"
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: ~/workspace
|
||||
@ -267,7 +228,7 @@ jobs:
|
||||
binary_ios_upload:
|
||||
<<: *pytorch_ios_params
|
||||
macos:
|
||||
xcode: "12.5.1"
|
||||
xcode: "12.0"
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: ~/workspace
|
||||
@ -309,8 +270,6 @@ jobs:
|
||||
- persist_to_workspace:
|
||||
root: "C:/w"
|
||||
paths: final_pkgs
|
||||
- store_artifacts:
|
||||
path: C:/w/final_pkgs
|
||||
|
||||
binary_windows_test:
|
||||
<<: *binary_windows_params
|
||||
@ -393,3 +352,4 @@ jobs:
|
||||
command: |
|
||||
ANACONDA_API_TOKEN="${CONDA_PYTORCHBOT_TOKEN}" \
|
||||
scripts/release/anaconda-prune/run.sh
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
# then install the one with the most recent version.
|
||||
update_s3_htmls: &update_s3_htmls
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
image: ubuntu-1604:202007-01
|
||||
resource_class: medium
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
type: string
|
||||
default: ""
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
image: ubuntu-1604:202007-01
|
||||
resource_class: large
|
||||
environment:
|
||||
IMAGE_NAME: << parameters.image_name >>
|
||||
@ -20,10 +20,7 @@
|
||||
set +x
|
||||
export AWS_ACCESS_KEY_ID=${CIRCLECI_AWS_ACCESS_KEY_FOR_DOCKER_BUILDER_V1}
|
||||
export AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_DOCKER_BUILDER_V1}
|
||||
export AWS_ACCOUNT_ID=$(aws sts get-caller-identity|grep Account|cut -f4 -d\")
|
||||
export AWS_REGION=us-east-1
|
||||
aws ecr get-login-password --region $AWS_REGION|docker login --username AWS \
|
||||
--password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com
|
||||
eval $(aws ecr get-login --no-include-email --region us-east-1)
|
||||
set -x
|
||||
# Check if image already exists, if it does then skip building it
|
||||
if docker manifest inspect "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/${IMAGE_NAME}:${DOCKER_TAG}"; then
|
||||
@ -54,3 +51,58 @@
|
||||
export AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_DOCKER_BUILDER_V1}
|
||||
set -x
|
||||
cd .circleci/docker && ./build_docker.sh
|
||||
docker_for_ecr_gc_build_job:
|
||||
machine:
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: build_docker_image_for_ecr_gc
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
cd .circleci/ecr_gc_docker
|
||||
docker build . -t 308535385114.dkr.ecr.us-east-1.amazonaws.com/gc/ecr
|
||||
set +x
|
||||
export AWS_ACCESS_KEY_ID=${CIRCLECI_AWS_ACCESS_KEY_FOR_DOCKER_BUILDER_V1}
|
||||
export AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_DOCKER_BUILDER_V1}
|
||||
eval $(aws ecr get-login --no-include-email --region us-east-1)
|
||||
set -x
|
||||
docker push 308535385114.dkr.ecr.us-east-1.amazonaws.com/gc/ecr
|
||||
ecr_gc_job:
|
||||
parameters:
|
||||
project:
|
||||
type: string
|
||||
default: "pytorch"
|
||||
tags_to_keep: # comma separate values
|
||||
type: string
|
||||
environment:
|
||||
PROJECT: << parameters.project >>
|
||||
# TODO: Remove legacy image tags once we feel comfortable with new docker image tags
|
||||
IMAGE_TAG: << parameters.tags_to_keep >>
|
||||
docker:
|
||||
- image: 308535385114.dkr.ecr.us-east-1.amazonaws.com/gc/ecr
|
||||
aws_auth:
|
||||
aws_access_key_id: ${CIRCLECI_AWS_ACCESS_KEY_FOR_DOCKER_BUILDER_V1}
|
||||
aws_secret_access_key: ${CIRCLECI_AWS_SECRET_KEY_FOR_DOCKER_BUILDER_V1}
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
# NOTE: see 'docker_build_job' for how these tags actually get built
|
||||
name: dynamically generate tags to keep
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
GENERATED_IMAGE_TAG=$(\
|
||||
git log --oneline --pretty='%H' .circleci/docker \
|
||||
| xargs -I '{}' git rev-parse '{}:.circleci/docker' \
|
||||
| paste -sd "," -)
|
||||
echo "export GENERATED_IMAGE_TAG='${GENERATED_IMAGE_TAG}'" >> ${BASH_ENV}
|
||||
- run:
|
||||
name: garbage collecting for ecr images
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
set +x
|
||||
export AWS_ACCESS_KEY_ID=${CIRCLECI_AWS_ACCESS_KEY_FOR_DOCKER_BUILDER_V1}
|
||||
export AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_DOCKER_BUILDER_V1}
|
||||
set -x
|
||||
/usr/bin/gc.py --filter-prefix ${PROJECT} --ignore-tags "${IMAGE_TAG},${GENERATED_IMAGE_TAG}"
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
pytorch_doc_push:
|
||||
resource_class: medium
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
image: ubuntu-1604:202007-01
|
||||
parameters:
|
||||
branch:
|
||||
type: string
|
||||
@ -27,10 +27,10 @@
|
||||
pytorch_python_doc_build:
|
||||
environment:
|
||||
BUILD_ENVIRONMENT: pytorch-python-doc-push
|
||||
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-py3.7-gcc5.4"
|
||||
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-py3.6-gcc5.4"
|
||||
resource_class: large
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
- checkout
|
||||
- calculate_docker_image_tag
|
||||
@ -41,16 +41,15 @@
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
set -ex
|
||||
export COMMIT_DOCKER_IMAGE=${DOCKER_IMAGE}:build-${DOCKER_TAG}-${CIRCLE_SHA1}
|
||||
export COMMIT_DOCKER_IMAGE=${DOCKER_IMAGE}:${DOCKER_TAG}-${CIRCLE_SHA1}
|
||||
echo "DOCKER_IMAGE: "${COMMIT_DOCKER_IMAGE}
|
||||
# turn v1.12.0rc3 into 1.12.0
|
||||
tag=$(echo $CIRCLE_TAG | sed -e 's/v*\([0-9.]*\).*/\1/')
|
||||
tag=${CIRCLE_TAG:1:5}
|
||||
target=${tag:-master}
|
||||
echo "building for ${target}"
|
||||
time docker pull ${COMMIT_DOCKER_IMAGE} >/dev/null
|
||||
export id=$(docker run --env-file "${BASH_ENV}" --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -t -d -w /var/lib/jenkins ${COMMIT_DOCKER_IMAGE})
|
||||
|
||||
export COMMAND='((echo "sudo chown -R jenkins workspace && cd workspace && '"export CIRCLE_SHA1='$CIRCLE_SHA1'"' && . ./.circleci/scripts/python_doc_push_script.sh docs/'$target' '$target' site") | docker exec -u jenkins -i "$id" bash) 2>&1'
|
||||
export COMMAND='((echo "sudo chown -R jenkins workspace && cd workspace && . ./.circleci/scripts/python_doc_push_script.sh docs/'$target' '$target' site") | docker exec -u jenkins -i "$id" bash) 2>&1'
|
||||
|
||||
echo ${COMMAND} > ./command.sh && unbuffer bash ./command.sh | ts
|
||||
|
||||
@ -73,10 +72,10 @@
|
||||
pytorch_cpp_doc_build:
|
||||
environment:
|
||||
BUILD_ENVIRONMENT: pytorch-cpp-doc-push
|
||||
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-py3.7-gcc5.4"
|
||||
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-py3.6-gcc5.4"
|
||||
resource_class: large
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
- checkout
|
||||
- calculate_docker_image_tag
|
||||
@ -87,17 +86,15 @@
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
set -ex
|
||||
export COMMIT_DOCKER_IMAGE=${DOCKER_IMAGE}:build-${DOCKER_TAG}-${CIRCLE_SHA1}
|
||||
export COMMIT_DOCKER_IMAGE=${DOCKER_IMAGE}:${DOCKER_TAG}-${CIRCLE_SHA1}
|
||||
echo "DOCKER_IMAGE: "${COMMIT_DOCKER_IMAGE}
|
||||
# turn v1.12.0rc3 into 1.12.0
|
||||
tag=$(echo $CIRCLE_TAG | sed -e 's/v*\([0-9.]*\).*/\1/')
|
||||
tag=${CIRCLE_TAG:1:5}
|
||||
target=${tag:-master}
|
||||
echo "building for ${target}"
|
||||
time docker pull ${COMMIT_DOCKER_IMAGE} >/dev/null
|
||||
export id=$(docker run --env-file "${BASH_ENV}" --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -t -d -w /var/lib/jenkins ${COMMIT_DOCKER_IMAGE})
|
||||
|
||||
export COMMAND='((echo "sudo chown -R jenkins workspace && cd workspace && '"export CIRCLE_SHA1='$CIRCLE_SHA1'"' && . ./.circleci/scripts/cpp_doc_push_script.sh docs/"$target" master") | docker exec -u jenkins -i "$id" bash) 2>&1'
|
||||
export COMMAND='((echo "sudo chown -R jenkins workspace && cd workspace && . ./.circleci/scripts/cpp_doc_push_script.sh docs/"$target" master") | docker exec -u jenkins -i "$id" bash) 2>&1'
|
||||
|
||||
echo ${COMMAND} > ./command.sh && unbuffer bash ./command.sh | ts
|
||||
|
||||
@ -114,49 +111,11 @@
|
||||
paths:
|
||||
- .
|
||||
|
||||
pytorch_macos_10_15_py3_build:
|
||||
environment:
|
||||
BUILD_ENVIRONMENT: pytorch-macos-10.15-py3-arm64-build
|
||||
macos:
|
||||
xcode: "12.3.0"
|
||||
steps:
|
||||
- checkout
|
||||
- run_brew_for_macos_build
|
||||
- run:
|
||||
name: Build
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
set -e
|
||||
export IN_CI=1
|
||||
export CROSS_COMPILE_ARM64=1
|
||||
export JOB_BASE_NAME=$CIRCLE_JOB
|
||||
|
||||
# Install sccache
|
||||
sudo curl --retry 3 https://s3.amazonaws.com/ossci-macos/sccache_v2.15 --output /usr/local/bin/sccache
|
||||
sudo chmod +x /usr/local/bin/sccache
|
||||
export SCCACHE_BUCKET=ossci-compiler-cache-circleci-v2
|
||||
|
||||
# This IAM user allows write access to S3 bucket for sccache
|
||||
set +x
|
||||
export AWS_ACCESS_KEY_ID=${CIRCLECI_AWS_ACCESS_KEY_FOR_SCCACHE_S3_BUCKET_V4}
|
||||
export AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_SCCACHE_S3_BUCKET_V4}
|
||||
set -x
|
||||
|
||||
chmod a+x .jenkins/pytorch/macos-build.sh
|
||||
unbuffer .jenkins/pytorch/macos-build.sh 2>&1 | ts
|
||||
|
||||
- persist_to_workspace:
|
||||
root: /Users/distiller/workspace/
|
||||
paths:
|
||||
- miniconda3
|
||||
- store_artifacts:
|
||||
path: /Users/distiller/project/dist
|
||||
|
||||
pytorch_macos_10_13_py3_build:
|
||||
environment:
|
||||
BUILD_ENVIRONMENT: pytorch-macos-10.13-py3-build
|
||||
macos:
|
||||
xcode: "12.0"
|
||||
xcode: "11.2.1"
|
||||
steps:
|
||||
- checkout
|
||||
- run_brew_for_macos_build
|
||||
@ -165,11 +124,10 @@
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
set -e
|
||||
export IN_CI=1
|
||||
export JOB_BASE_NAME=$CIRCLE_JOB
|
||||
export IN_CIRCLECI=1
|
||||
|
||||
# Install sccache
|
||||
sudo curl --retry 3 https://s3.amazonaws.com/ossci-macos/sccache_v2.15 --output /usr/local/bin/sccache
|
||||
sudo curl --retry 3 https://s3.amazonaws.com/ossci-macos/sccache --output /usr/local/bin/sccache
|
||||
sudo chmod +x /usr/local/bin/sccache
|
||||
export SCCACHE_BUCKET=ossci-compiler-cache-circleci-v2
|
||||
|
||||
@ -191,7 +149,7 @@
|
||||
environment:
|
||||
BUILD_ENVIRONMENT: pytorch-macos-10.13-py3-test
|
||||
macos:
|
||||
xcode: "12.0"
|
||||
xcode: "11.2.1"
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
@ -202,50 +160,10 @@
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
set -e
|
||||
export IN_CI=1
|
||||
export JOB_BASE_NAME=$CIRCLE_JOB
|
||||
export IN_CIRCLECI=1
|
||||
|
||||
chmod a+x .jenkins/pytorch/macos-test.sh
|
||||
unbuffer .jenkins/pytorch/macos-test.sh 2>&1 | ts
|
||||
- run:
|
||||
name: Report results
|
||||
no_output_timeout: "5m"
|
||||
command: |
|
||||
set -ex
|
||||
source /Users/distiller/workspace/miniconda3/bin/activate
|
||||
python3 -m pip install boto3==1.19.12
|
||||
|
||||
export IN_CI=1
|
||||
export JOB_BASE_NAME=$CIRCLE_JOB
|
||||
|
||||
# Using the same IAM user to write stats to our OSS bucket
|
||||
export AWS_ACCESS_KEY_ID=${CIRCLECI_AWS_ACCESS_KEY_FOR_SCCACHE_S3_BUCKET_V4}
|
||||
export AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_SCCACHE_S3_BUCKET_V4}
|
||||
python -m tools.stats.print_test_stats --upload-to-s3 --compare-with-s3 test
|
||||
when: always
|
||||
- store_test_results:
|
||||
path: test/test-reports
|
||||
|
||||
pytorch_macos_10_13_py3_lite_interpreter_build_test:
|
||||
environment:
|
||||
BUILD_ENVIRONMENT: pytorch-macos-10.13-py3-test
|
||||
macos:
|
||||
xcode: "12.0"
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: ~/workspace
|
||||
- run_brew_for_macos_build
|
||||
- run:
|
||||
name: Test
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
set -e
|
||||
export IN_CI=1
|
||||
export BUILD_LITE_INTERPRETER=1
|
||||
export JOB_BASE_NAME=$CIRCLE_JOB
|
||||
chmod a+x ${HOME}/project/.jenkins/pytorch/macos-lite-interpreter-build-test.sh
|
||||
unbuffer ${HOME}/project/.jenkins/pytorch/macos-lite-interpreter-build-test.sh 2>&1 | ts
|
||||
- store_test_results:
|
||||
path: test/test-reports
|
||||
|
||||
@ -253,10 +171,10 @@
|
||||
environment:
|
||||
BUILD_ENVIRONMENT: pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-build
|
||||
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-py3-clang5-android-ndk-r19c"
|
||||
PYTHON_VERSION: "3.7"
|
||||
PYTHON_VERSION: "3.6"
|
||||
resource_class: large
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
- checkout
|
||||
- calculate_docker_image_tag
|
||||
@ -267,7 +185,7 @@
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
set -eux
|
||||
docker_image_commit=${DOCKER_IMAGE}:build-${DOCKER_TAG}-${CIRCLE_SHA1}
|
||||
docker_image_commit=${DOCKER_IMAGE}:${DOCKER_TAG}-${CIRCLE_SHA1}
|
||||
|
||||
docker_image_libtorch_android_x86_32=${docker_image_commit}-android-x86_32
|
||||
docker_image_libtorch_android_x86_64=${docker_image_commit}-android-x86_64
|
||||
@ -341,22 +259,22 @@
|
||||
pytorch_android_publish_snapshot:
|
||||
environment:
|
||||
BUILD_ENVIRONMENT: pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-publish-snapshot
|
||||
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-py3-clang5-android-ndk-r19c"
|
||||
PYTHON_VERSION: "3.7"
|
||||
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-py3-clang5-android-ndk-r19c:ab1632df-fa59-40e6-8c23-98e004f61148"
|
||||
PYTHON_VERSION: "3.6"
|
||||
resource_class: large
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
- checkout
|
||||
- calculate_docker_image_tag
|
||||
- setup_linux_system_environment
|
||||
- checkout
|
||||
- setup_ci_environment
|
||||
- run:
|
||||
name: pytorch android gradle build
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
set -eux
|
||||
docker_image_commit=${DOCKER_IMAGE}:build-${DOCKER_TAG}-${CIRCLE_SHA1}
|
||||
docker_image_commit=${DOCKER_IMAGE}-${CIRCLE_SHA1}
|
||||
|
||||
docker_image_libtorch_android_x86_32_gradle=${docker_image_commit}-android-x86_32-gradle
|
||||
|
||||
@ -378,10 +296,10 @@
|
||||
environment:
|
||||
BUILD_ENVIRONMENT: pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-build-only-x86_32
|
||||
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-py3-clang5-android-ndk-r19c"
|
||||
PYTHON_VERSION: "3.7"
|
||||
PYTHON_VERSION: "3.6"
|
||||
resource_class: large
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
- checkout
|
||||
- calculate_docker_image_tag
|
||||
@ -393,7 +311,7 @@
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
set -e
|
||||
docker_image_libtorch_android_x86_32=${DOCKER_IMAGE}:build-${DOCKER_TAG}-${CIRCLE_SHA1}-android-x86_32
|
||||
docker_image_libtorch_android_x86_32=${DOCKER_IMAGE}:${DOCKER_TAG}-${CIRCLE_SHA1}-android-x86_32
|
||||
echo "docker_image_libtorch_android_x86_32: "${docker_image_libtorch_android_x86_32}
|
||||
|
||||
# x86
|
||||
@ -416,10 +334,50 @@
|
||||
path: ~/workspace/build_android_x86_32_artifacts/artifacts.tgz
|
||||
destination: artifacts.tgz
|
||||
|
||||
pytorch_android_gradle_custom_build_single:
|
||||
environment:
|
||||
BUILD_ENVIRONMENT: pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-custom-build-single
|
||||
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-py3-clang5-android-ndk-r19c"
|
||||
PYTHON_VERSION: "3.6"
|
||||
resource_class: large
|
||||
machine:
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
- checkout
|
||||
- calculate_docker_image_tag
|
||||
- setup_linux_system_environment
|
||||
- checkout
|
||||
- calculate_docker_image_tag
|
||||
- setup_ci_environment
|
||||
- run:
|
||||
name: pytorch android gradle custom build single architecture (for PR)
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
set -e
|
||||
# Unlike other gradle jobs, it's not worth building libtorch in a separate CI job and share via docker, because:
|
||||
# 1) Not shareable: it's custom selective build, which is different from default libtorch mobile build;
|
||||
# 2) Not parallelizable by architecture: it only builds libtorch for one architecture;
|
||||
|
||||
echo "DOCKER_IMAGE: ${DOCKER_IMAGE}:${DOCKER_TAG}"
|
||||
time docker pull ${DOCKER_IMAGE}:${DOCKER_TAG} >/dev/null
|
||||
|
||||
git submodule sync && git submodule update -q --init --recursive
|
||||
VOLUME_MOUNTS="-v /home/circleci/project/:/var/lib/jenkins/workspace"
|
||||
export id=$(docker run --env-file "${BASH_ENV}" ${VOLUME_MOUNTS} --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -t -d -w /var/lib/jenkins ${DOCKER_IMAGE}:${DOCKER_TAG})
|
||||
|
||||
export COMMAND='((echo "export GRADLE_OFFLINE=1" && echo "sudo chown -R jenkins workspace && cd workspace && ./.circleci/scripts/build_android_gradle.sh") | docker exec -u jenkins -i "$id" bash) 2>&1'
|
||||
echo ${COMMAND} > ./command.sh && unbuffer bash ./command.sh | ts
|
||||
|
||||
# Skip docker push as this job is purely for size analysis purpose.
|
||||
# Result binaries are already in `/home/circleci/project/` as it's mounted instead of copied.
|
||||
|
||||
- upload_binary_size_for_android_build:
|
||||
build_type: custom-build-single
|
||||
|
||||
pytorch_ios_build:
|
||||
<<: *pytorch_ios_params
|
||||
macos:
|
||||
xcode: "12.5.1"
|
||||
xcode: "12.0"
|
||||
steps:
|
||||
- checkout
|
||||
- run_brew_for_ios_build
|
||||
@ -433,17 +391,16 @@
|
||||
# install fastlane
|
||||
sudo gem install bundler && bundle install
|
||||
# install certificates
|
||||
echo ${IOS_CERT_KEY_2022} >> cert.txt
|
||||
echo ${IOS_CERT_KEY} >> cert.txt
|
||||
base64 --decode cert.txt -o Certificates.p12
|
||||
rm cert.txt
|
||||
bundle exec fastlane install_root_cert
|
||||
bundle exec fastlane install_dev_cert
|
||||
bundle exec fastlane install_cert
|
||||
# install the provisioning profile
|
||||
PROFILE=PyTorch_CI_2022.mobileprovision
|
||||
PROFILE=PyTorch_CI_2021.mobileprovision
|
||||
PROVISIONING_PROFILES=~/Library/MobileDevice/Provisioning\ Profiles
|
||||
mkdir -pv "${PROVISIONING_PROFILES}"
|
||||
cd "${PROVISIONING_PROFILES}"
|
||||
echo ${IOS_SIGN_KEY_2022} >> cert.txt
|
||||
echo ${IOS_SIGN_KEY} >> cert.txt
|
||||
base64 --decode cert.txt -o ${PROFILE}
|
||||
rm cert.txt
|
||||
- run:
|
||||
@ -451,7 +408,7 @@
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
set -e
|
||||
export IN_CI=1
|
||||
export IN_CIRCLECI=1
|
||||
WORKSPACE=/Users/distiller/workspace
|
||||
PROJ_ROOT=/Users/distiller/project
|
||||
export TCLLIBPATH="/usr/local/lib"
|
||||
@ -468,12 +425,12 @@
|
||||
$* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)
|
||||
}
|
||||
|
||||
retry conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi requests typing_extensions --yes
|
||||
retry conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing requests --yes
|
||||
|
||||
# sync submodules
|
||||
cd ${PROJ_ROOT}
|
||||
git submodule sync
|
||||
git submodule update --init --recursive --depth 1 --jobs 0
|
||||
git submodule update --init --recursive
|
||||
|
||||
# export
|
||||
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
|
||||
@ -482,9 +439,6 @@
|
||||
chmod a+x ${PROJ_ROOT}/scripts/build_ios.sh
|
||||
echo "IOS_ARCH: ${IOS_ARCH}"
|
||||
echo "IOS_PLATFORM: ${IOS_PLATFORM}"
|
||||
echo "USE_PYTORCH_METAL": "${USE_METAL}"
|
||||
echo "BUILD_LITE_INTERPRETER": "${BUILD_LITE_INTERPRETER}"
|
||||
echo "USE_COREML_DELEGATE": "${USE_COREML_DELEGATE}"
|
||||
|
||||
#check the custom build flag
|
||||
echo "SELECTED_OP_LIST: ${SELECTED_OP_LIST}"
|
||||
@ -493,10 +447,6 @@
|
||||
fi
|
||||
export IOS_ARCH=${IOS_ARCH}
|
||||
export IOS_PLATFORM=${IOS_PLATFORM}
|
||||
export USE_COREML_DELEGATE=${USE_COREML_DELEGATE}
|
||||
if [ ${IOS_PLATFORM} != "SIMULATOR" ]; then
|
||||
export USE_PYTORCH_METAL=${USE_METAL}
|
||||
fi
|
||||
unbuffer ${PROJ_ROOT}/scripts/build_ios.sh 2>&1 | ts
|
||||
- run:
|
||||
name: Run Build Test
|
||||
@ -504,7 +454,7 @@
|
||||
command: |
|
||||
set -e
|
||||
PROJ_ROOT=/Users/distiller/project
|
||||
PROFILE=PyTorch_CI_2022
|
||||
PROFILE=PyTorch_CI_2021
|
||||
# run the ruby build script
|
||||
if ! [ -x "$(command -v xcodebuild)" ]; then
|
||||
echo 'Error: xcodebuild is not installed.'
|
||||
@ -532,40 +482,18 @@
|
||||
WORKSPACE=/Users/distiller/workspace
|
||||
PROJ_ROOT=/Users/distiller/project
|
||||
source ~/anaconda/bin/activate
|
||||
# use the pytorch nightly build to generate models
|
||||
pip3 install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
|
||||
# generate models for differnet backends
|
||||
pip install torch torchvision --progress-bar off
|
||||
#run unit test
|
||||
cd ${PROJ_ROOT}/ios/TestApp/benchmark
|
||||
mkdir -p ../models
|
||||
if [ ${USE_COREML_DELEGATE} == 1 ]; then
|
||||
pip install coremltools==5.0b5
|
||||
pip install six
|
||||
python coreml_backend.py
|
||||
else
|
||||
python trace_model.py
|
||||
fi
|
||||
if [ ${BUILD_LITE_INTERPRETER} == 1 ]; then
|
||||
echo "Setting up the TestApp for LiteInterpreter"
|
||||
ruby setup.rb --lite 1
|
||||
else
|
||||
echo "Setting up the TestApp for Full JIT"
|
||||
ruby setup.rb
|
||||
fi
|
||||
python trace_model.py
|
||||
ruby setup.rb
|
||||
cd ${PROJ_ROOT}/ios/TestApp
|
||||
instruments -s -devices
|
||||
if [ ${BUILD_LITE_INTERPRETER} == 1 ]; then
|
||||
if [ ${USE_COREML_DELEGATE} == 1 ]; then
|
||||
fastlane scan --only_testing TestAppTests/TestAppTests/testCoreML
|
||||
else
|
||||
fastlane scan --only_testing TestAppTests/TestAppTests/testLiteInterpreter
|
||||
fi
|
||||
else
|
||||
fastlane scan --only_testing TestAppTests/TestAppTests/testFullJIT
|
||||
fi
|
||||
fastlane scan
|
||||
pytorch_linux_bazel_build:
|
||||
<<: *pytorch_params
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
- checkout
|
||||
- calculate_docker_image_tag
|
||||
@ -583,7 +511,7 @@
|
||||
|
||||
echo "Do NOT merge master branch into $CIRCLE_BRANCH in environment $BUILD_ENVIRONMENT"
|
||||
|
||||
git submodule sync && git submodule update -q --init --recursive --depth 1 --jobs 0
|
||||
git submodule sync && git submodule update -q --init --recursive
|
||||
|
||||
docker cp /home/circleci/project/. $id:/var/lib/jenkins/workspace
|
||||
|
||||
@ -594,7 +522,7 @@
|
||||
# Push intermediate Docker image for next phase to use
|
||||
if [ -z "${BUILD_ONLY}" ]; then
|
||||
# Augment our output image name with bazel to avoid collisions
|
||||
output_image=${DOCKER_IMAGE}:build-${DOCKER_TAG}-bazel-${CIRCLE_SHA1}
|
||||
output_image=${DOCKER_IMAGE}:${DOCKER_TAG}-bazel-${CIRCLE_SHA1}
|
||||
export COMMIT_DOCKER_IMAGE=$output_image
|
||||
docker commit "$id" ${COMMIT_DOCKER_IMAGE}
|
||||
time docker push ${COMMIT_DOCKER_IMAGE}
|
||||
@ -603,7 +531,7 @@
|
||||
pytorch_linux_bazel_test:
|
||||
<<: *pytorch_params
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
- checkout
|
||||
- calculate_docker_image_tag
|
||||
@ -614,7 +542,7 @@
|
||||
no_output_timeout: "90m"
|
||||
command: |
|
||||
set -e
|
||||
output_image=${DOCKER_IMAGE}:build-${DOCKER_TAG}-bazel-${CIRCLE_SHA1}
|
||||
output_image=${DOCKER_IMAGE}:${DOCKER_TAG}-bazel-${CIRCLE_SHA1}
|
||||
export COMMIT_DOCKER_IMAGE=$output_image
|
||||
echo "DOCKER_IMAGE: "${COMMIT_DOCKER_IMAGE}
|
||||
|
||||
@ -644,26 +572,13 @@
|
||||
- store_test_results:
|
||||
path: bazel-testlogs
|
||||
|
||||
pytorch_windows_test_multigpu:
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Test
|
||||
no_output_timeout: "90m"
|
||||
command: |
|
||||
set -e
|
||||
python3 -m pip install requests
|
||||
python3 ./.circleci/scripts/trigger_azure_pipeline.py
|
||||
|
||||
pytorch_doc_test:
|
||||
environment:
|
||||
BUILD_ENVIRONMENT: pytorch-doc-test
|
||||
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-py3.7-gcc5.4"
|
||||
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-py3.6-gcc5.4"
|
||||
resource_class: medium
|
||||
machine:
|
||||
image: ubuntu-2004:202104-01
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
- checkout
|
||||
- calculate_docker_image_tag
|
||||
@ -674,7 +589,7 @@
|
||||
no_output_timeout: "30m"
|
||||
command: |
|
||||
set -ex
|
||||
export COMMIT_DOCKER_IMAGE=${DOCKER_IMAGE}:build-${DOCKER_TAG}-${CIRCLE_SHA1}
|
||||
export COMMIT_DOCKER_IMAGE=${DOCKER_IMAGE}:${DOCKER_TAG}-${CIRCLE_SHA1}
|
||||
echo "DOCKER_IMAGE: "${COMMIT_DOCKER_IMAGE}
|
||||
time docker pull ${COMMIT_DOCKER_IMAGE} >/dev/null
|
||||
export id=$(docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -t -d -w /var/lib/jenkins ${COMMIT_DOCKER_IMAGE})
|
||||
|
||||
356
.circleci/verbatim-sources/job-specs/pytorch-job-specs.yml
Normal file
356
.circleci/verbatim-sources/job-specs/pytorch-job-specs.yml
Normal file
@ -0,0 +1,356 @@
|
||||
jobs:
|
||||
pytorch_linux_build:
|
||||
<<: *pytorch_params
|
||||
machine:
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
# See Note [Workspace for CircleCI scripts] in job-specs-setup.yml
|
||||
- checkout
|
||||
- calculate_docker_image_tag
|
||||
- setup_linux_system_environment
|
||||
- optional_merge_target_branch
|
||||
- setup_ci_environment
|
||||
- run:
|
||||
name: Build
|
||||
no_output_timeout: "1h"
|
||||
command: |
|
||||
set -e
|
||||
# TODO: Remove this after we figure out why rocm tests are failing
|
||||
if [[ "${DOCKER_IMAGE}" == *rocm3.5* ]]; then
|
||||
export DOCKER_TAG="ab1632df-fa59-40e6-8c23-98e004f61148"
|
||||
fi
|
||||
if [[ "${DOCKER_IMAGE}" == *rocm3.7* ]]; then
|
||||
export DOCKER_TAG="1045c7b891104cb4fd23399eab413b6213e48aeb"
|
||||
fi
|
||||
if [[ ${BUILD_ENVIRONMENT} == *"pure_torch"* ]]; then
|
||||
echo 'BUILD_CAFFE2=OFF' >> "${BASH_ENV}"
|
||||
fi
|
||||
if [[ ${BUILD_ENVIRONMENT} == *"paralleltbb"* ]]; then
|
||||
echo 'ATEN_THREADING=TBB' >> "${BASH_ENV}"
|
||||
echo 'USE_TBB=1' >> "${BASH_ENV}"
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"parallelnative"* ]]; then
|
||||
echo 'ATEN_THREADING=NATIVE' >> "${BASH_ENV}"
|
||||
fi
|
||||
echo "Parallel backend flags: "${PARALLEL_FLAGS}
|
||||
# Pull Docker image and run build
|
||||
echo "DOCKER_IMAGE: "${DOCKER_IMAGE}:${DOCKER_TAG}
|
||||
time docker pull ${DOCKER_IMAGE}:${DOCKER_TAG} >/dev/null
|
||||
export id=$(docker run --env-file "${BASH_ENV}" --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -t -d -w /var/lib/jenkins ${DOCKER_IMAGE}:${DOCKER_TAG})
|
||||
|
||||
git submodule sync && git submodule update -q --init --recursive
|
||||
|
||||
docker cp /home/circleci/project/. $id:/var/lib/jenkins/workspace
|
||||
|
||||
export COMMAND='((echo "sudo chown -R jenkins workspace && cd workspace && .jenkins/pytorch/build.sh && find ${BUILD_ROOT} -type f -name "*.a" -or -name "*.o" -delete") | docker exec -u jenkins -i "$id" bash) 2>&1'
|
||||
|
||||
echo ${COMMAND} > ./command.sh && unbuffer bash ./command.sh | ts
|
||||
|
||||
# Copy dist folder back
|
||||
docker cp $id:/var/lib/jenkins/workspace/dist /home/circleci/project/. || echo "Dist folder not found"
|
||||
|
||||
# Push intermediate Docker image for next phase to use
|
||||
if [ -z "${BUILD_ONLY}" ]; then
|
||||
# Note [Special build images]
|
||||
# The xla build uses the same docker image as
|
||||
# pytorch-linux-trusty-py3.6-gcc5.4-build. In the push step, we have to
|
||||
# distinguish between them so the test can pick up the correct image.
|
||||
output_image=${DOCKER_IMAGE}:${DOCKER_TAG}-${CIRCLE_SHA1}
|
||||
if [[ ${BUILD_ENVIRONMENT} == *"xla"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-xla
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"libtorch"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-libtorch
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"paralleltbb"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-paralleltbb
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"parallelnative"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-parallelnative
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"android-ndk-r19c-x86_64"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-android-x86_64
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"android-ndk-r19c-arm-v7a"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-android-arm-v7a
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"android-ndk-r19c-arm-v8a"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-android-arm-v8a
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"android-ndk-r19c-x86_32"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-android-x86_32
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"android-ndk-r19c-vulkan-x86_32"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-android-vulkan-x86_32
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"vulkan-linux"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-vulkan
|
||||
else
|
||||
export COMMIT_DOCKER_IMAGE=$output_image
|
||||
fi
|
||||
docker commit "$id" ${COMMIT_DOCKER_IMAGE}
|
||||
time docker push ${COMMIT_DOCKER_IMAGE}
|
||||
fi
|
||||
- store_artifacts:
|
||||
path: /home/circleci/project/dist
|
||||
|
||||
pytorch_linux_test:
|
||||
<<: *pytorch_params
|
||||
machine:
|
||||
image: ubuntu-1604:202007-01
|
||||
steps:
|
||||
# See Note [Workspace for CircleCI scripts] in job-specs-setup.yml
|
||||
- checkout
|
||||
- calculate_docker_image_tag
|
||||
- setup_linux_system_environment
|
||||
- setup_ci_environment
|
||||
- run:
|
||||
name: Download Docker image
|
||||
no_output_timeout: "90m"
|
||||
command: |
|
||||
set -e
|
||||
export PYTHONUNBUFFERED=1
|
||||
# TODO: Remove this after we figure out why rocm tests are failing
|
||||
if [[ "${DOCKER_IMAGE}" == *rocm3.5* ]]; then
|
||||
export DOCKER_TAG="ab1632df-fa59-40e6-8c23-98e004f61148"
|
||||
fi
|
||||
if [[ "${DOCKER_IMAGE}" == *rocm3.7* ]]; then
|
||||
export DOCKER_TAG="1045c7b891104cb4fd23399eab413b6213e48aeb"
|
||||
fi
|
||||
# See Note [Special build images]
|
||||
output_image=${DOCKER_IMAGE}:${DOCKER_TAG}-${CIRCLE_SHA1}
|
||||
if [[ ${BUILD_ENVIRONMENT} == *"xla"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-xla
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"libtorch"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-libtorch
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"paralleltbb"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-paralleltbb
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"parallelnative"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-parallelnative
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"vulkan-linux"* ]]; then
|
||||
export COMMIT_DOCKER_IMAGE=$output_image-vulkan
|
||||
else
|
||||
export COMMIT_DOCKER_IMAGE=$output_image
|
||||
fi
|
||||
echo "DOCKER_IMAGE: "${COMMIT_DOCKER_IMAGE}
|
||||
|
||||
if [[ ${BUILD_ENVIRONMENT} == *"paralleltbb"* ]]; then
|
||||
echo 'ATEN_THREADING=TBB' >> "${BASH_ENV}"
|
||||
echo 'USE_TBB=1' >> "${BASH_ENV}"
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"parallelnative"* ]]; then
|
||||
echo 'ATEN_THREADING=NATIVE' >> "${BASH_ENV}"
|
||||
fi
|
||||
echo "Parallel backend flags: "${PARALLEL_FLAGS}
|
||||
|
||||
time docker pull ${COMMIT_DOCKER_IMAGE} >/dev/null
|
||||
|
||||
# TODO: Make this less painful
|
||||
if [ -n "${USE_CUDA_DOCKER_RUNTIME}" ]; then
|
||||
export id=$(docker run --env-file "${BASH_ENV}" --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --gpus all --shm-size=2g -t -d -w /var/lib/jenkins ${COMMIT_DOCKER_IMAGE})
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *"rocm"* ]]; then
|
||||
hostname
|
||||
export id=$(docker run --env-file "${BASH_ENV}" --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --shm-size=8g --ipc=host --device /dev/kfd --device /dev/dri --group-add video -t -d -w /var/lib/jenkins ${COMMIT_DOCKER_IMAGE})
|
||||
else
|
||||
export id=$(docker run --env-file "${BASH_ENV}" --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -t -d -w /var/lib/jenkins ${COMMIT_DOCKER_IMAGE})
|
||||
fi
|
||||
echo "id=${id}" >> "${BASH_ENV}"
|
||||
|
||||
- run:
|
||||
name: Check for no AVX instruction by default
|
||||
no_output_timeout: "20m"
|
||||
command: |
|
||||
set -e
|
||||
is_vanilla_build() {
|
||||
if [ "${BUILD_ENVIRONMENT}" == "pytorch-linux-bionic-py3.6-clang9-test" ]; then
|
||||
return 0
|
||||
fi
|
||||
if [ "${BUILD_ENVIRONMENT}" == "pytorch-linux-xenial-py3.6-gcc5.4-test" ]; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
if is_vanilla_build; then
|
||||
echo "apt-get update && apt-get install -y qemu-user gdb" | docker exec -u root -i "$id" bash
|
||||
echo "cd workspace/build; qemu-x86_64 -g 2345 -cpu Broadwell -E ATEN_CPU_CAPABILITY=default ./bin/basic --gtest_filter=BasicTest.BasicTestCPU & gdb ./bin/basic -ex 'set pagination off' -ex 'target remote :2345' -ex 'continue' -ex 'bt' -ex='set confirm off' -ex 'quit \$_isvoid(\$_exitcode)'" | docker exec -u jenkins -i "$id" bash
|
||||
else
|
||||
echo "Skipping for ${BUILD_ENVIRONMENT}"
|
||||
fi
|
||||
- run:
|
||||
name: Run tests
|
||||
no_output_timeout: "90m"
|
||||
command: |
|
||||
set -e
|
||||
|
||||
cat >docker_commands.sh \<<EOL
|
||||
# =================== The following code will be executed inside Docker container ===================
|
||||
set -ex
|
||||
export SCRIBE_GRAPHQL_ACCESS_TOKEN="${SCRIBE_GRAPHQL_ACCESS_TOKEN}"
|
||||
${PARALLEL_FLAGS}
|
||||
cd workspace
|
||||
EOL
|
||||
if [[ ${BUILD_ENVIRONMENT} == *"multigpu"* ]]; then
|
||||
echo ".jenkins/pytorch/multigpu-test.sh" >> docker_commands.sh
|
||||
elif [[ ${BUILD_ENVIRONMENT} == *onnx* ]]; then
|
||||
echo "pip install click mock tabulate networkx==2.0" >> docker_commands.sh
|
||||
echo "pip -q install --user -b /tmp/pip_install_onnx \"file:///var/lib/jenkins/workspace/third_party/onnx#egg=onnx\"" >> docker_commands.sh
|
||||
echo ".jenkins/caffe2/test.sh" >> docker_commands.sh
|
||||
else
|
||||
echo ".jenkins/pytorch/test.sh" >> docker_commands.sh
|
||||
fi
|
||||
echo "(cat docker_commands.sh | docker exec -u jenkins -i "$id" bash) 2>&1" > command.sh
|
||||
unbuffer bash command.sh | ts
|
||||
- run:
|
||||
name: Report results
|
||||
no_output_timeout: "5m"
|
||||
command: |
|
||||
set -e
|
||||
docker stats --all --no-stream
|
||||
|
||||
cat >docker_commands.sh \<<EOL
|
||||
# =================== The following code will be executed inside Docker container ===================
|
||||
set -ex
|
||||
export BUILD_ENVIRONMENT=${BUILD_ENVIRONMENT}
|
||||
export SCRIBE_GRAPHQL_ACCESS_TOKEN="${SCRIBE_GRAPHQL_ACCESS_TOKEN}"
|
||||
export CIRCLE_TAG="${CIRCLE_TAG:-}"
|
||||
export CIRCLE_SHA1="$CIRCLE_SHA1"
|
||||
export CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-}"
|
||||
export CIRCLE_BRANCH="$CIRCLE_BRANCH"
|
||||
export CIRCLE_JOB="$CIRCLE_JOB"
|
||||
cd workspace
|
||||
python test/print_test_stats.py test
|
||||
EOL
|
||||
echo "(cat docker_commands.sh | docker exec -u jenkins -i "$id" bash) 2>&1" > command.sh
|
||||
unbuffer bash command.sh | ts
|
||||
|
||||
echo "Retrieving test reports"
|
||||
docker cp $id:/var/lib/jenkins/workspace/test/test-reports ./ || echo 'No test reports found!'
|
||||
if [[ ${BUILD_ENVIRONMENT} == *"coverage"* ]]; then
|
||||
echo "Retrieving coverage report"
|
||||
docker cp $id:/var/lib/jenkins/workspace/test/.coverage ./test
|
||||
docker cp $id:/var/lib/jenkins/workspace/test/coverage.xml ./test
|
||||
python3 -mpip install codecov
|
||||
python3 -mcodecov
|
||||
fi
|
||||
when: always
|
||||
- store_test_results:
|
||||
path: test-reports
|
||||
|
||||
pytorch_windows_build:
|
||||
<<: *pytorch_windows_params
|
||||
parameters:
|
||||
executor:
|
||||
type: string
|
||||
default: "windows-xlarge-cpu-with-nvidia-cuda"
|
||||
build_environment:
|
||||
type: string
|
||||
default: ""
|
||||
test_name:
|
||||
type: string
|
||||
default: ""
|
||||
cuda_version:
|
||||
type: string
|
||||
default: "10"
|
||||
python_version:
|
||||
type: string
|
||||
default: "3.6"
|
||||
vc_version:
|
||||
type: string
|
||||
default: "14.16"
|
||||
vc_year:
|
||||
type: string
|
||||
default: "2019"
|
||||
vc_product:
|
||||
type: string
|
||||
default: "BuildTools"
|
||||
use_cuda:
|
||||
type: string
|
||||
default: ""
|
||||
executor: <<parameters.executor>>
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Install Cuda
|
||||
no_output_timeout: 30m
|
||||
command: |
|
||||
if [[ "${USE_CUDA}" == "1" ]]; then
|
||||
.circleci/scripts/windows_cuda_install.sh
|
||||
fi
|
||||
- run:
|
||||
name: Install Cudnn
|
||||
command : |
|
||||
if [[ "${USE_CUDA}" == "1" ]]; then
|
||||
.circleci/scripts/windows_cudnn_install.sh
|
||||
fi
|
||||
- run:
|
||||
name: Build
|
||||
no_output_timeout: "90m"
|
||||
command: |
|
||||
set -e
|
||||
set +x
|
||||
export AWS_ACCESS_KEY_ID=${CIRCLECI_AWS_ACCESS_KEY_FOR_WIN_BUILD_V1}
|
||||
export AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_WIN_BUILD_V1}
|
||||
set -x
|
||||
.jenkins/pytorch/win-build.sh
|
||||
- persist_to_workspace:
|
||||
root: "C:/w"
|
||||
paths: build-results
|
||||
- store_artifacts:
|
||||
path: C:/w/build-results
|
||||
|
||||
pytorch_windows_test:
|
||||
<<: *pytorch_windows_params
|
||||
parameters:
|
||||
executor:
|
||||
type: string
|
||||
default: "windows-medium-cpu-with-nvidia-cuda"
|
||||
build_environment:
|
||||
type: string
|
||||
default: ""
|
||||
test_name:
|
||||
type: string
|
||||
default: ""
|
||||
cuda_version:
|
||||
type: string
|
||||
default: "10"
|
||||
python_version:
|
||||
type: string
|
||||
default: "3.6"
|
||||
vc_version:
|
||||
type: string
|
||||
default: "14.16"
|
||||
vc_year:
|
||||
type: string
|
||||
default: "2019"
|
||||
vc_product:
|
||||
type: string
|
||||
default: "BuildTools"
|
||||
use_cuda:
|
||||
type: string
|
||||
default: ""
|
||||
executor: <<parameters.executor>>
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: c:/users/circleci/workspace
|
||||
- run:
|
||||
name: Install Cuda
|
||||
no_output_timeout: 30m
|
||||
command: |
|
||||
if [[ "${CUDA_VERSION}" != "cpu" ]]; then
|
||||
if [[ "${CUDA_VERSION}" != "10" || "${JOB_EXECUTOR}" != "windows-with-nvidia-gpu" ]]; then
|
||||
.circleci/scripts/windows_cuda_install.sh
|
||||
fi
|
||||
if [[ "${CUDA_VERSION}" != "10" && "${JOB_EXECUTOR}" == "windows-with-nvidia-gpu" ]]; then
|
||||
.circleci/scripts/driver_update.bat
|
||||
fi
|
||||
fi
|
||||
- run:
|
||||
name: Install Cudnn
|
||||
command : |
|
||||
if [[ "${CUDA_VERSION}" != "cpu" ]]; then
|
||||
.circleci/scripts/windows_cudnn_install.sh
|
||||
fi
|
||||
- run:
|
||||
name: Test
|
||||
no_output_timeout: "30m"
|
||||
command: |
|
||||
set -e
|
||||
export IN_CIRCLECI=1
|
||||
set +x
|
||||
export AWS_ACCESS_KEY_ID=${CIRCLECI_AWS_ACCESS_KEY_FOR_WIN_BUILD_V1}
|
||||
export AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_WIN_BUILD_V1}
|
||||
set -x
|
||||
.jenkins/pytorch/win-test.sh
|
||||
- store_test_results:
|
||||
path: test/test-reports
|
||||
@ -26,7 +26,6 @@
|
||||
# (smoke tests and upload jobs do not need the pytorch repo).
|
||||
binary_checkout: &binary_checkout
|
||||
name: Checkout pytorch/builder repo
|
||||
no_output_timeout: "30m"
|
||||
command: .circleci/scripts/binary_checkout.sh
|
||||
|
||||
# Parses circleci arguments in a consistent way, essentially routing to the
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user