Skip to content

Commit

Permalink
Pull request to run CI for pytorch#72556 (pytorch#73404)
Browse files Browse the repository at this point in the history
Summary:
This PR moves the Dockerfile conda dependencies into a requirements-ci.txt (and begins the requirements file for other parts of CI as well).  Packages are listed alphabetically in the requirements-ci.txt.  Uncommented packages before the mkl package have been tested and confirmed to work on all platforms.  Commented out packages before mkl have broken at least one platform and so have been comment out.  There appears to be some randomness with certain platforms not passing tests so it might be good to run a number of tests for the same configuration to confirm if it is indeed these commented out packages that cause the errors.

Remaining is to test all commented out packages to ensure they work on all platforms.  This will likely involve repeat runs of the same configurations to ensure it is indeed the packages that break the platforms and not random errors.

This PR makes progress on task pytorch#72556

Pull Request resolved: pytorch#73404

Reviewed By: janeyx99

Differential Revision: D34730797

Pulled By: kstant0725

fbshipit-source-id: 3e4b171720fa33b604cebb9c6101d38ba11f2f8b
(cherry picked from commit 99cc445)
  • Loading branch information
kstant0725 authored and pytorchmergebot committed Mar 24, 2022
1 parent 23383b1 commit ff58899
Show file tree
Hide file tree
Showing 7 changed files with 221 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .circleci/docker/centos-rocm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ RUN bash ./install_user.sh && rm install_user.sh
# Install conda and other packages (e.g., numpy, pytest)
ENV PATH /opt/conda/bin:$PATH
ARG ANACONDA_PYTHON_VERSION
ADD requirements-ci.txt /opt/conda/requirements-ci.txt
ADD ./common/install_conda.sh install_conda.sh
RUN bash ./install_conda.sh && rm install_conda.sh
RUN rm /opt/conda/requirements-ci.txt

# (optional) Install protobuf for ONNX
ARG PROTOBUF
Expand Down
18 changes: 2 additions & 16 deletions .circleci/docker/common/install_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
;;
esac

mkdir /opt/conda
mkdir -p /opt/conda
chown jenkins:jenkins /opt/conda

# Work around bug where devtoolset replaces sudo and breaks it.
Expand Down Expand Up @@ -94,21 +94,7 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
conda_install nnpack -c killeent

# Install some other packages, including those needed for Python test reporting
# Pin SciPy because of failing distribution tests (see #60347)
# 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
# Pin unittest-xml-reporting to freeze printing test summary logic, related: https://github.com/pytorch/pytorch/issues/69014
as_jenkins pip install --progress-bar off pytest \
scipy==1.6.3 \
scikit-image \
psutil \
"unittest-xml-reporting<=3.2.0,>=2.0.0" \
boto3==1.16.34 \
hypothesis==4.53.2 \
expecttest==0.1.3 \
mypy==0.812 \
tb-nightly \
librosa>=0.6.2
as_jenkins pip install --progress-bar off -r /opt/conda/requirements-ci.txt

# Install numba only on python-3.8 or below
# For numba issue see https://github.com/pytorch/pytorch/issues/51511
Expand Down
210 changes: 210 additions & 0 deletions .circleci/docker/requirements-ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
# Python dependencies required for unit tests

#awscli==1.6 #this breaks some platforms
#Description: AWS command line interface
#Pinned versions: 1.6
#test that import:

boto3==1.19.12
#Description: AWS SDK for python
#Pinned versions: 1.19.12, 1.16.34
#test that import:

click
#Description: Command Line Interface Creation Kit
#Pinned versions:
#test that import:

coremltools==5.0b5
#Description: Apple framework for ML integration
#Pinned versions: 5.0b5
#test that import:

#dataclasses #this breaks some platforms
#Description: Provides decorators for auto adding special methods to user classes
#Pinned versions:
#test that import:

expecttest==0.1.3
#Description: method for writing tests where test framework auto populates
# the expected output based on previous runs
#Pinned versions: 0.1.3
#test that import:

flatbuffers==2.0
#Description: cross platform serialization library
#Pinned versions: 2.0
#test that import:

#future #this breaks linux-bionic-rocm4.5-py3.7
#Description: compatibility layer between python 2 and python 3
#Pinned versions:
#test that import:

hypothesis==4.53.2
# Pin hypothesis to avoid flakiness: https://github.com/pytorch/pytorch/issues/31136
#Description: advanced library for generating parametrized tests
#Pinned versions: 3.44.6, 4.53.2
#test that import: test_xnnpack_integration.py, test_pruning_op.py, test_nn.py

junitparser==2.1.1
#Description: unitparser handles JUnit/xUnit Result XML files
#Pinned versions: 2.1.1
#test that import:

librosa>=0.6.2
#Description: A python package for music and audio analysis
#Pinned versions: >=0.6.2
#test that import: test_spectral_ops.py

#mkl #this breaks linux-bionic-rocm4.5-py3.7
#Description: Intel oneAPI Math Kernel Library
#Pinned versions:
#test that import: test_profiler.py, test_public_bindings.py, test_testing.py,
#test_nn.py, test_mkldnn.py, test_jit.py, test_fx_experimental.py,
#test_autograd.py

#mkl-devel
# see mkl

#mock # breaks ci/circleci: docker-pytorch-linux-xenial-py3-clang5-android-ndk-r19c
#Description: A testing library that allows you to replace parts of your
#system under test with mock objects
#Pinned versions:
#test that import: test_module_init.py, test_modules.py, test_nn.py,
#test_testing.py

#MonkeyType # breaks pytorch-xla-linux-bionic-py3.7-clang8
#Description: collects runtime types of function arguments and return
#values, and can automatically generate stub files
#Pinned versions:
#test that import:

mypy==0.812
# Pin MyPy version because new errors are likely to appear with each release
#Description: linter
#Pinned versions: 0.812
#test that import: test_typing.py, test_type_hints.py

#networkx
#Description: creation, manipulation, and study of
#the structure, dynamics, and functions of complex networks
#Pinned versions: 2.0
#test that import:

#ninja
#Description: build system. Note that it install from
#here breaks things so it is commented out
#Pinned versions: 1.10.0.post1
#test that import: run_test.py, test_cpp_extensions_aot.py,test_determination.py

#numba
#Description: Just-In-Time Compiler for Numerical Functions
#Pinned versions: 0.54.1, 0.49.0, <=0.49.1
#test that import: test_numba_integration.py

#numpy
#Description: Provides N-dimensional arrays and linear algebra
#Pinned versions: 1.20
#test that import: test_view_ops.py, test_unary_ufuncs.py, test_type_promotion.py,
#test_type_info.py, test_torch.py, test_tensorexpr_pybind.py, test_tensorexpr.py,
#test_tensorboard.py, test_tensor_creation_ops.py, test_static_runtime.py,
#test_spectral_ops.py, test_sort_and_select.py, test_shape_ops.py,
#test_segment_reductions.py, test_reductions.py, test_pruning_op.py,
#test_overrides.py, test_numpy_interop.py, test_numba_integration.py
#test_nn.py, test_namedtensor.py, test_linalg.py, test_jit_cuda_fuser.py,
#test_jit.py, test_indexing.py, test_datapipe.py, test_dataloader.py,
#test_binary_ufuncs.py

#onnxruntime
#Description: scoring engine for Open Neural Network Exchange (ONNX) models
#Pinned versions: 1.9.0
#test that import:

#pillow
#Description: Python Imaging Library fork
#Pinned versions:
#test that import:

#protobuf
#Description: Google’s data interchange format
#Pinned versions:
#test that import: test_tensorboard.py

psutil
#Description: information on running processes and system utilization
#Pinned versions:
#test that import: test_profiler.py, test_openmp.py, test_dataloader.py

pytest
#Description: testing framework
#Pinned versions:
#test that import: test_typing.py, test_cpp_extensions_aot.py, run_test.py

#pytest-benchmark
#Description: fixture for benchmarking code
#Pinned versions: 3.2.3
#test that import:

#pytest-sugar
#Description: shows failures and errors instantly
#Pinned versions:
#test that import:

#PyYAML
#Description: data serialization format
#Pinned versions:
#test that import:

#requests
#Description: HTTP library
#Pinned versions:
#test that import: test_type_promotion.py

#rich
#Description: rich text and beautiful formatting in the terminal
#Pinned versions: 10.9.0
#test that import:

scikit-image
#Description: image processing routines
#Pinned versions:
#test that import: test_nn.py

#scikit-learn
#Description: machine learning package
#Pinned versions: 0.20.3
#test that import:

scipy==1.6.3
# Pin SciPy because of failing distribution tests (see #60347)
#Description: scientific python
#Pinned versions: 1.6.3
#test that import: test_unary_ufuncs.py, test_torch.py,test_tensor_creation_ops.py
#test_spectral_ops.py, test_sparse_csr.py, test_reductions.py,test_nn.py
#test_linalg.py, test_binary_ufuncs.py

#tabulate
#Description: Pretty-print tabular data
#Pinned versions:
#test that import:

tb-nightly
#Description: TensorBoard
#Pinned versions:
#test that import:

#typing-extensions
#Description: type hints for python
#Pinned versions:
#test that import:

#virtualenv
#Description: virtual environment for python
#Pinned versions:
#test that import:

unittest-xml-reporting<=3.2.0,>=2.0.0
#Description: saves unit test results to xml
#Pinned versions:
#test that import:
2 changes: 2 additions & 0 deletions .circleci/docker/ubuntu-cuda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ RUN bash ./install_katex.sh && rm install_katex.sh
# Install conda and other packages (e.g., numpy, pytest)
ENV PATH /opt/conda/bin:$PATH
ARG ANACONDA_PYTHON_VERSION
ADD requirements-ci.txt /opt/conda/requirements-ci.txt
ADD ./common/install_conda.sh install_conda.sh
RUN bash ./install_conda.sh && rm install_conda.sh
RUN rm /opt/conda/requirements-ci.txt

# Install gcc
ARG GCC_VERSION
Expand Down
2 changes: 2 additions & 0 deletions .circleci/docker/ubuntu-rocm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ RUN bash ./install_user.sh && rm install_user.sh
# Install conda and other packages (e.g., numpy, pytest)
ENV PATH /opt/conda/bin:$PATH
ARG ANACONDA_PYTHON_VERSION
ADD requirements-ci.txt /opt/conda/requirements-ci.txt
ADD ./common/install_conda.sh install_conda.sh
RUN bash ./install_conda.sh && rm install_conda.sh
RUN rm /opt/conda/requirements-ci.txt

# Install gcc
ARG GCC_VERSION
Expand Down
2 changes: 2 additions & 0 deletions .circleci/docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ RUN bash ./install_katex.sh && rm install_katex.sh
# Install conda and other packages (e.g., numpy, pytest)
ENV PATH /opt/conda/bin:$PATH
ARG ANACONDA_PYTHON_VERSION
ADD requirements-ci.txt /opt/conda/requirements-ci.txt
ADD ./common/install_conda.sh install_conda.sh
RUN bash ./install_conda.sh && rm install_conda.sh
RUN rm /opt/conda/requirements-ci.txt

# Install gcc
ARG GCC_VERSION
Expand Down
2 changes: 1 addition & 1 deletion mypy_plugins/check_mypy_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def get_correct_mypy_version():
# there's probably a more elegant way to do this
match, = re.finditer(
r'mypy==(\d+(?:\.\d+)*)',
Path('.circleci/docker/common/install_conda.sh').read_text(),
Path('.circleci/docker/requirements-ci.txt').read_text(),
)
version, = match.groups()
return version
Expand Down

0 comments on commit ff58899

Please sign in to comment.