Skip to content

Commit

Permalink
Update on "Add scalar.conj() and update backward formulas for add and…
Browse files Browse the repository at this point in the history
… sub"

1. Added `conj` method for scalar similar to numpy.
2. Updates backward formulas for add and sub to work correctly for R -> C cases and for the case when alpha is complex.
3. Enabled complex backward for nonzero (no formula update needed).


Differential Revision: [D24529227](https://our.internmc.facebook.com/intern/diff/D24529227)

[ghstack-poisoned]
  • Loading branch information
anjali411 committed Nov 2, 2020
2 parents 2a07016 + 0d6bf88 commit 5b6d3a7
Show file tree
Hide file tree
Showing 317 changed files with 7,657 additions and 2,152 deletions.
1 change: 1 addition & 0 deletions .circleci/cimodel/data/dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
ROCM_VERSIONS = [
"3.7",
"3.8",
"3.9",
]

ROCM_VERSION_LABELS = ["rocm" + v for v in ROCM_VERSIONS]
Expand Down
8 changes: 6 additions & 2 deletions .circleci/cimodel/data/pytorch_build_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
]),
]),
]),
("11.1", [
("11.0", [
("3.8", [
X(True),
("libtorch", [
Expand All @@ -84,7 +84,11 @@
("gcc", [
("9", [
("3.8", [
("coverage", [XImportant(True)]),
("coverage", [
(True, [
("shard_test", [XImportant(True)]),
]),
]),
]),
]),
]),
Expand Down
9 changes: 5 additions & 4 deletions .circleci/cimodel/data/pytorch_build_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def instantiate_configs():
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_coverage = fc.find_prop("is_coverage") 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
Expand Down Expand Up @@ -311,6 +312,10 @@ def instantiate_configs():
python_version = fc.find_prop("pyver")
parms_list[0] = fc.find_prop("abbreviated_pyver")

if is_coverage:
parms_list_ignored_for_docker_image.append("coverage")
python_version = fc.find_prop("pyver")

if is_onnx:
parms_list.append("onnx")
python_version = fc.find_prop("pyver")
Expand All @@ -325,17 +330,13 @@ def instantiate_configs():
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
is_coverage = fc.find_prop("is_coverage") or False
shard_test = fc.find_prop("shard_test") 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"]


gpu_resource = None
if cuda_version and cuda_version != "10":
Expand Down
201 changes: 183 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,11 @@ jobs:
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"
echo "Retrieving Python coverage report"
docker cp $id:/var/lib/jenkins/workspace/test/.coverage ./test
docker cp $id:/var/lib/jenkins/workspace/test/coverage.xml ./test
echo "Retrieving C++ coverage report"
docker cp $id:/var/lib/jenkins/workspace/build/coverage.info ./test
python3 -mpip install codecov
python3 -mcodecov
fi
Expand Down Expand Up @@ -2179,6 +2181,39 @@ workflows:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
docker_image: "pytorch/manylinux-rocm:3.8"
- binary_linux_build:
name: binary_linux_manywheel_3_6m_rocm3_9_devtoolset7_nightly_build
build_environment: "manywheel 3.6m rocm3.9 devtoolset7"
filters:
branches:
only:
- /.*/
tags:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
docker_image: "pytorch/manylinux-rocm:3.9"
- binary_linux_build:
name: binary_linux_manywheel_3_7m_rocm3_9_devtoolset7_nightly_build
build_environment: "manywheel 3.7m rocm3.9 devtoolset7"
filters:
branches:
only:
- /.*/
tags:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
docker_image: "pytorch/manylinux-rocm:3.9"
- binary_linux_build:
name: binary_linux_manywheel_3_8m_rocm3_9_devtoolset7_nightly_build
build_environment: "manywheel 3.8m rocm3.9 devtoolset7"
filters:
branches:
only:
- /.*/
tags:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
docker_image: "pytorch/manylinux-rocm:3.9"
- binary_linux_build:
name: binary_linux_conda_3_6_cpu_devtoolset7_nightly_build
build_environment: "conda 3.6 cpu devtoolset7"
Expand Down Expand Up @@ -3523,6 +3558,51 @@ workflows:
docker_image: "pytorch/manylinux-rocm:3.8"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- binary_linux_test:
name: binary_linux_manywheel_3_6m_rocm3_9_devtoolset7_nightly_test
build_environment: "manywheel 3.6m rocm3.9 devtoolset7"
filters:
branches:
only:
- /.*/
tags:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
requires:
- binary_linux_manywheel_3_6m_rocm3_9_devtoolset7_nightly_build
docker_image: "pytorch/manylinux-rocm:3.9"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- binary_linux_test:
name: binary_linux_manywheel_3_7m_rocm3_9_devtoolset7_nightly_test
build_environment: "manywheel 3.7m rocm3.9 devtoolset7"
filters:
branches:
only:
- /.*/
tags:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
requires:
- binary_linux_manywheel_3_7m_rocm3_9_devtoolset7_nightly_build
docker_image: "pytorch/manylinux-rocm:3.9"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- binary_linux_test:
name: binary_linux_manywheel_3_8m_rocm3_9_devtoolset7_nightly_test
build_environment: "manywheel 3.8m rocm3.9 devtoolset7"
filters:
branches:
only:
- /.*/
tags:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
requires:
- binary_linux_manywheel_3_8m_rocm3_9_devtoolset7_nightly_build
docker_image: "pytorch/manylinux-rocm:3.9"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- binary_linux_test:
name: binary_linux_conda_3_6_cpu_devtoolset7_nightly_test
build_environment: "conda 3.6 cpu devtoolset7"
Expand Down Expand Up @@ -5068,6 +5148,48 @@ workflows:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
package_type: manywheel
upload_subfolder: rocm3.8
- binary_upload:
name: binary_linux_manywheel_3_6m_rocm3_9_devtoolset7_nightly_upload
context: org-member
requires:
- binary_linux_manywheel_3_6m_rocm3_9_devtoolset7_nightly_test
filters:
branches:
only:
- nightly
tags:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
package_type: manywheel
upload_subfolder: rocm3.9
- binary_upload:
name: binary_linux_manywheel_3_7m_rocm3_9_devtoolset7_nightly_upload
context: org-member
requires:
- binary_linux_manywheel_3_7m_rocm3_9_devtoolset7_nightly_test
filters:
branches:
only:
- nightly
tags:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
package_type: manywheel
upload_subfolder: rocm3.9
- binary_upload:
name: binary_linux_manywheel_3_8m_rocm3_9_devtoolset7_nightly_upload
context: org-member
requires:
- binary_linux_manywheel_3_8m_rocm3_9_devtoolset7_nightly_test
filters:
branches:
only:
- nightly
tags:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
package_type: manywheel
upload_subfolder: rocm3.9
- binary_upload:
name: binary_linux_conda_3_6_cpu_devtoolset7_nightly_upload
context: org-member
Expand Down Expand Up @@ -6806,37 +6928,37 @@ workflows:
build_environment: "pytorch-libtorch-linux-xenial-cuda10.2-cudnn7-py3-gcc7-build"
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda10.2-cudnn7-py3-gcc7"
- pytorch_linux_build:
name: pytorch_linux_xenial_cuda11_1_cudnn8_py3_gcc7_build
name: pytorch_linux_xenial_cuda11_0_cudnn8_py3_gcc7_build
requires:
- "docker-pytorch-linux-xenial-cuda11.1-cudnn8-py3-gcc7"
- "docker-pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7"
filters:
branches:
only:
- master
- /ci-all\/.*/
- /release\/.*/
build_environment: "pytorch-linux-xenial-cuda11.1-cudnn8-py3-gcc7-build"
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda11.1-cudnn8-py3-gcc7"
build_environment: "pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7-build"
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7"
- pytorch_linux_test:
name: pytorch_linux_xenial_cuda11_1_cudnn8_py3_gcc7_test
name: pytorch_linux_xenial_cuda11_0_cudnn8_py3_gcc7_test
requires:
- pytorch_linux_xenial_cuda11_1_cudnn8_py3_gcc7_build
- pytorch_linux_xenial_cuda11_0_cudnn8_py3_gcc7_build
filters:
branches:
only:
- master
- /ci-all\/.*/
- /release\/.*/
build_environment: "pytorch-linux-xenial-cuda11.1-cudnn8-py3-gcc7-test"
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda11.1-cudnn8-py3-gcc7"
build_environment: "pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7-test"
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- pytorch_linux_build:
name: pytorch_libtorch_linux_xenial_cuda11_1_cudnn8_py3_gcc7_build
name: pytorch_libtorch_linux_xenial_cuda11_0_cudnn8_py3_gcc7_build
requires:
- "docker-pytorch-linux-xenial-cuda11.1-cudnn8-py3-gcc7"
build_environment: "pytorch-libtorch-linux-xenial-cuda11.1-cudnn8-py3-gcc7-build"
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda11.1-cudnn8-py3-gcc7"
- "docker-pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7"
build_environment: "pytorch-libtorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7-build"
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7"
- pytorch_linux_build:
name: pytorch_linux_bionic_py3_6_clang9_build
requires:
Expand Down Expand Up @@ -6877,16 +6999,23 @@ workflows:
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-bionic-py3.6-clang9"
resource_class: large
- pytorch_linux_build:
name: pytorch_linux_bionic_py3_8_gcc9_build
name: pytorch_linux_bionic_py3_8_gcc9_coverage_build
requires:
- "docker-pytorch-linux-bionic-py3.8-gcc9"
build_environment: "pytorch-linux-bionic-py3.8-gcc9-build"
build_environment: "pytorch-linux-bionic-py3.8-gcc9-coverage-build"
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-bionic-py3.8-gcc9"
- pytorch_linux_test:
name: pytorch_linux_bionic_py3_8_gcc9_coverage_test1
requires:
- pytorch_linux_bionic_py3_8_gcc9_coverage_build
build_environment: "pytorch-linux-bionic-py3.8-gcc9-coverage-test1"
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-bionic-py3.8-gcc9"
resource_class: large
- pytorch_linux_test:
name: pytorch_linux_bionic_py3_8_gcc9_coverage_test
name: pytorch_linux_bionic_py3_8_gcc9_coverage_test2
requires:
- pytorch_linux_bionic_py3_8_gcc9_build
build_environment: "pytorch-linux-bionic-py3.8-gcc9-coverage_test"
- pytorch_linux_bionic_py3_8_gcc9_coverage_build
build_environment: "pytorch-linux-bionic-py3.8-gcc9-coverage-test2"
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-bionic-py3.8-gcc9"
resource_class: large
- pytorch_linux_build:
Expand Down Expand Up @@ -7661,6 +7790,42 @@ workflows:
docker_image: "pytorch/manylinux-rocm:3.8"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- smoke_linux_test:
name: smoke_linux_manywheel_3_6m_rocm3_9_devtoolset7_nightly
build_environment: "manywheel 3.6m rocm3.9 devtoolset7"
requires:
- update_s3_htmls
filters:
branches:
only:
- postnightly
docker_image: "pytorch/manylinux-rocm:3.9"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- smoke_linux_test:
name: smoke_linux_manywheel_3_7m_rocm3_9_devtoolset7_nightly
build_environment: "manywheel 3.7m rocm3.9 devtoolset7"
requires:
- update_s3_htmls
filters:
branches:
only:
- postnightly
docker_image: "pytorch/manylinux-rocm:3.9"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- smoke_linux_test:
name: smoke_linux_manywheel_3_8m_rocm3_9_devtoolset7_nightly
build_environment: "manywheel 3.8m rocm3.9 devtoolset7"
requires:
- update_s3_htmls
filters:
branches:
only:
- postnightly
docker_image: "pytorch/manylinux-rocm:3.9"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- smoke_linux_test:
name: smoke_linux_conda_3_6_cpu_devtoolset7_nightly
build_environment: "conda 3.6 cpu devtoolset7"
Expand Down
2 changes: 1 addition & 1 deletion .circleci/docker/centos-rocm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,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
# Install conda and other packages (e.g., numpy, coverage, pytest)
ENV PATH /opt/conda/bin:$PATH
ARG ANACONDA_PYTHON_VERSION
ADD ./common/install_conda.sh install_conda.sh
Expand Down
4 changes: 2 additions & 2 deletions .circleci/docker/common/install_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
# TODO: This isn't working atm
conda_install nnpack -c killeent

# Install some other packages
# Install some other packages, including those needed for Python test reporting
# TODO: Why is scipy pinned
# 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
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 unittest-xml-reporting coverage

popd
fi
2 changes: 1 addition & 1 deletion .circleci/docker/ubuntu-cuda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ARG KATEX
ADD ./common/install_katex.sh install_katex.sh
RUN bash ./install_katex.sh && rm install_katex.sh

# Install conda
# Install conda and other packages (e.g., numpy, coverage, pytest)
ENV PATH /opt/conda/bin:$PATH
ARG ANACONDA_PYTHON_VERSION
ADD ./common/install_conda.sh install_conda.sh
Expand Down
2 changes: 1 addition & 1 deletion .circleci/docker/ubuntu-rocm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ 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
# Install conda and other packages (e.g., numpy, coverage, pytest)
ENV PATH /opt/conda/bin:$PATH
ARG ANACONDA_PYTHON_VERSION
ADD ./common/install_conda.sh install_conda.sh
Expand Down
2 changes: 1 addition & 1 deletion .circleci/docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
# Install conda and other packages (e.g., numpy, coverage, pytest)
ENV PATH /opt/conda/bin:$PATH
ARG ANACONDA_PYTHON_VERSION
ADD ./common/install_conda.sh install_conda.sh
Expand Down

0 comments on commit 5b6d3a7

Please sign in to comment.