Skip to content

Commit c17425d

Browse files
committed
Update base for Update on "Add formulas and basic tests"
RFC: pytorch/rfcs#11 This PR adds: - Codegen support to define forward grad formulas and few manual formulas - Codegen support to automatically generate formulas as well as few usage - Codegen support to materialize undefined tangents when no value is provided - Tests for basic forward grad components Codegen generated examples. (note that some namings here are not up to date with the latest version, in particular the "legacy" namings that have been removed) For each of them, the only part that is changed is the if statement before the return checking for fw grad defined. - For manual entry: ```yaml - name: max(Tensor self) -> Tensor self: evenly_distribute_backward(grad, self, result) result: max_forward(self_t, self_p, result) ``` ```cpp Tensor max(const Tensor & self) { auto& self_ = unpack(self, "self", 0); auto _any_requires_grad = compute_requires_grad( self ); (void)_any_requires_grad; std::shared_ptr<MaxBackward1> grad_fn; if (_any_requires_grad) { grad_fn = std::shared_ptr<MaxBackward1>(new MaxBackward1(), deleteNode); grad_fn->set_next_edges(collect_next_edges( self )); grad_fn->self_ = SavedVariable(self, false); } #ifndef NDEBUG c10::optional<Storage> self__storage_saved = self_.has_storage() ? c10::optional<Storage>(self_.storage()) : c10::nullopt; c10::intrusive_ptr<TensorImpl> self__impl_saved; if (self_.defined()) self__impl_saved = self_.getIntrusivePtr(); #endif auto tmp = ([&]() { at::AutoNonVariableTypeMode non_var_type_mode(true); return at::max(self_); })(); auto result = std::move(tmp); #ifndef NDEBUG if (self__storage_saved.has_value()) AT_ASSERT(self__storage_saved.value().is_alias_of(self_.storage())); if (self__impl_saved) AT_ASSERT(self__impl_saved == self_.getIntrusivePtr()); #endif if (grad_fn) { set_history(flatten_tensor_args( result ), grad_fn); } throw_error_for_complex_autograd(result, "max"); if (isFwGradDefined(self)) { auto self_t_raw = toLegacyFwGrad(self); auto self_t = self_t_raw.defined() ? self_t_raw : at::zeros_like(toLegacyTensor(self)); auto self_p = toLegacyPrimal(self); auto result_new_fw_grad = max_forward(self_t, self_p, result); if (result_new_fw_grad.defined()) { result.set_fw_grad(result_new_fw_grad, /* level */ 0, /* is_inplace_op */ false); } } if (grad_fn) { grad_fn->result_ = SavedVariable(result, true); } return result; } ``` - For element wise entry: ```yaml - name: abs(Tensor self) -> Tensor self: grad * self.sgn() result: auto_element_wise ``` ```cpp Tensor abs(const Tensor & self) { auto& self_ = unpack(self, "self", 0); auto _any_requires_grad = compute_requires_grad( self ); (void)_any_requires_grad; std::shared_ptr<AbsBackward> grad_fn; if (_any_requires_grad) { grad_fn = std::shared_ptr<AbsBackward>(new AbsBackward(), deleteNode); grad_fn->set_next_edges(collect_next_edges( self )); grad_fn->self_ = SavedVariable(self, false); } #ifndef NDEBUG c10::optional<Storage> self__storage_saved = self_.has_storage() ? c10::optional<Storage>(self_.storage()) : c10::nullopt; c10::intrusive_ptr<TensorImpl> self__impl_saved; if (self_.defined()) self__impl_saved = self_.getIntrusivePtr(); #endif auto tmp = ([&]() { at::AutoNonVariableTypeMode non_var_type_mode(true); return at::abs(self_); })(); auto result = std::move(tmp); #ifndef NDEBUG if (self__storage_saved.has_value()) AT_ASSERT(self__storage_saved.value().is_alias_of(self_.storage())); if (self__impl_saved) AT_ASSERT(self__impl_saved == self_.getIntrusivePtr()); #endif if (grad_fn) { set_history(flatten_tensor_args( result ), grad_fn); } throw_error_for_complex_autograd(result, "abs"); if (isFwGradDefined(self)) { auto self_t_raw = toLegacyFwGrad(self); auto self_t = self_t_raw.defined() ? self_t_raw : at::zeros_like(toLegacyTensor(self)); auto self_p = toLegacyPrimal(self); auto result_new_fw_grad = self_t * self_p.sgn(); if (result_new_fw_grad.defined()) { result.set_fw_grad(result_new_fw_grad, /* level */ 0, /* is_inplace_op */ false); } } return result; } ``` - For linear entry: ```yaml - name: clone(Tensor self, *, MemoryFormat? memory_format=None) -> Tensor self: grad result: auto_linear ``` ```cpp Tensor clone(const Tensor & self, c10::optional<MemoryFormat> memory_format) { auto& self_ = unpack(self, "self", 0); auto _any_requires_grad = compute_requires_grad( self ); (void)_any_requires_grad; std::shared_ptr<CloneBackward> grad_fn; if (_any_requires_grad) { grad_fn = std::shared_ptr<CloneBackward>(new CloneBackward(), deleteNode); grad_fn->set_next_edges(collect_next_edges( self )); } #ifndef NDEBUG c10::optional<Storage> self__storage_saved = self_.has_storage() ? c10::optional<Storage>(self_.storage()) : c10::nullopt; c10::intrusive_ptr<TensorImpl> self__impl_saved; if (self_.defined()) self__impl_saved = self_.getIntrusivePtr(); #endif auto tmp = ([&]() { at::AutoNonVariableTypeMode non_var_type_mode(true); return at::clone(self_, memory_format); })(); auto result = std::move(tmp); #ifndef NDEBUG if (self__storage_saved.has_value()) AT_ASSERT(self__storage_saved.value().is_alias_of(self_.storage())); if (self__impl_saved) AT_ASSERT(self__impl_saved == self_.getIntrusivePtr()); #endif if (grad_fn) { set_history(flatten_tensor_args( result ), grad_fn); } if (isFwGradDefined(self)) { auto self_t_raw = toLegacyFwGrad(self); auto self_t = self_t_raw.defined() ? self_t_raw : at::zeros_like(toLegacyTensor(self)); auto result_new_fw_grad = at::clone(self_t, memory_format); if (result_new_fw_grad.defined()) { result.set_fw_grad(result_new_fw_grad, /* level */ 0, /* is_inplace_op */ false); } } return result; } ``` - For no entry: ```yaml - name: angle(Tensor self) -> Tensor self: angle_backward(grad, self) ``` ```cpp Tensor angle(const Tensor & self) { auto& self_ = unpack(self, "self", 0); auto _any_requires_grad = compute_requires_grad( self ); (void)_any_requires_grad; std::shared_ptr<AngleBackward> grad_fn; if (_any_requires_grad) { grad_fn = std::shared_ptr<AngleBackward>(new AngleBackward(), deleteNode); grad_fn->set_next_edges(collect_next_edges( self )); grad_fn->self_ = SavedVariable(self, false); } #ifndef NDEBUG c10::optional<Storage> self__storage_saved = self_.has_storage() ? c10::optional<Storage>(self_.storage()) : c10::nullopt; c10::intrusive_ptr<TensorImpl> self__impl_saved; if (self_.defined()) self__impl_saved = self_.getIntrusivePtr(); #endif auto tmp = ([&]() { at::AutoNonVariableTypeMode non_var_type_mode(true); return at::angle(self_); })(); auto result = std::move(tmp); #ifndef NDEBUG if (self__storage_saved.has_value()) AT_ASSERT(self__storage_saved.value().is_alias_of(self_.storage())); if (self__impl_saved) AT_ASSERT(self__impl_saved == self_.getIntrusivePtr()); #endif if (grad_fn) { set_history(flatten_tensor_args( result ), grad_fn); } throw_error_for_complex_autograd(result, "angle"); TORCH_CHECK(!(isFwGradDefined(self)), "Trying to use forward AD with angle that does not support it."); return result; } ``` Differential Revision: [D25607505](https://our.internmc.facebook.com/intern/diff/D25607505) [ghstack-poisoned]
2 parents bd05009 + 86b1f4e commit c17425d

File tree

552 files changed

+17010
-7150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

552 files changed

+17010
-7150
lines changed

.circleci/cimodel/data/simple/docker_definitions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
"pytorch-linux-bionic-py3.6-clang9",
1111
"pytorch-linux-bionic-cuda10.2-cudnn7-py3.6-clang9",
1212
"pytorch-linux-bionic-py3.8-gcc9",
13-
"pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4",
14-
"pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7",
1513
"pytorch-linux-xenial-cuda10-cudnn7-py3-gcc7",
1614
"pytorch-linux-xenial-cuda10.1-cudnn7-py3-gcc7",
1715
"pytorch-linux-xenial-cuda10.2-cudnn7-py3-gcc7",

.circleci/config.yml

Lines changed: 12 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ jobs:
472472
473473
docker cp /home/circleci/project/. $id:/var/lib/jenkins/workspace
474474
475-
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'
475+
export COMMAND='((echo "sudo chown -R jenkins workspace && export CIRCLE_JOB="$CIRCLE_JOB" && 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'
476476
477477
echo ${COMMAND} > ./command.sh && unbuffer bash ./command.sh | ts
478478
@@ -603,6 +603,7 @@ jobs:
603603
# =================== The following code will be executed inside Docker container ===================
604604
set -ex
605605
export SCRIBE_GRAPHQL_ACCESS_TOKEN="${SCRIBE_GRAPHQL_ACCESS_TOKEN}"
606+
export CIRCLE_JOB="$CIRCLE_JOB"
606607
${PARALLEL_FLAGS}
607608
cd workspace
608609
EOL
@@ -696,6 +697,11 @@ jobs:
696697
executor: <<parameters.executor>>
697698
steps:
698699
- checkout
700+
- run:
701+
name: _HACK_ Install CUDA compatible cmath
702+
no_output_timeout: 1m
703+
command: |
704+
powershell .circleci/scripts/vs_install_cmath.ps1
699705
- run:
700706
name: Install Cuda
701707
no_output_timeout: 30m
@@ -1102,6 +1108,11 @@ jobs:
11021108
steps:
11031109
# See Note [Workspace for CircleCI scripts] in job-specs-setup.yml
11041110
- checkout
1111+
- run:
1112+
name: _HACK_ Install CUDA compatible cmath
1113+
no_output_timeout: 1m
1114+
command: |
1115+
powershell .circleci/scripts/vs_install_cmath.ps1
11051116
- run:
11061117
<<: *binary_checkout
11071118
- run:
@@ -6729,12 +6740,6 @@ workflows:
67296740
- docker_build_job:
67306741
name: "docker-pytorch-linux-bionic-py3.8-gcc9"
67316742
image_name: "pytorch-linux-bionic-py3.8-gcc9"
6732-
- docker_build_job:
6733-
name: "docker-pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4"
6734-
image_name: "pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4"
6735-
- docker_build_job:
6736-
name: "docker-pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7"
6737-
image_name: "pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7"
67386743
- docker_build_job:
67396744
name: "docker-pytorch-linux-xenial-cuda10-cudnn7-py3-gcc7"
67406745
image_name: "pytorch-linux-xenial-cuda10-cudnn7-py3-gcc7"
@@ -9117,58 +9122,6 @@ workflows:
91179122
vc_product: Community
91189123
vc_version: ""
91199124
vc_year: "2019"
9120-
- pytorch_windows_test:
9121-
build_environment: pytorch-win-vs2019-cuda11-cudnn8-py3
9122-
cuda_version: "11.2"
9123-
executor: windows-with-nvidia-gpu
9124-
name: pytorch_windows_vs2019_py36_cuda11.2_test1
9125-
python_version: "3.6"
9126-
requires:
9127-
- pytorch_windows_vs2019_py36_cuda11.2_build
9128-
test_name: pytorch-windows-test1
9129-
use_cuda: "1"
9130-
vc_product: Community
9131-
vc_version: ""
9132-
vc_year: "2019"
9133-
- pytorch_windows_test:
9134-
build_environment: pytorch-win-vs2019-cuda11-cudnn8-py3
9135-
cuda_version: "11.2"
9136-
executor: windows-with-nvidia-gpu
9137-
name: pytorch_windows_vs2019_py36_cuda11.2_test2
9138-
python_version: "3.6"
9139-
requires:
9140-
- pytorch_windows_vs2019_py36_cuda11.2_build
9141-
test_name: pytorch-windows-test2
9142-
use_cuda: "1"
9143-
vc_product: Community
9144-
vc_version: ""
9145-
vc_year: "2019"
9146-
- docker_build_job:
9147-
name: "docker-pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4"
9148-
image_name: "pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4"
9149-
- docker_build_job:
9150-
name: "docker-pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7"
9151-
image_name: "pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7"
9152-
- pytorch_linux_build:
9153-
name: pytorch_linux_xenial_cuda9_2_cudnn7_py3_gcc7_build
9154-
requires:
9155-
- "docker-pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7"
9156-
build_environment: "pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7-build"
9157-
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7"
9158-
- pytorch_linux_test:
9159-
name: pytorch_linux_xenial_cuda9_2_cudnn7_py3_gcc7_test
9160-
requires:
9161-
- pytorch_linux_xenial_cuda9_2_cudnn7_py3_gcc7_build
9162-
build_environment: "pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7-test"
9163-
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7"
9164-
use_cuda_docker_runtime: "1"
9165-
resource_class: gpu.medium
9166-
- pytorch_linux_build:
9167-
name: pytorch_linux_xenial_cuda9_2_cudnn7_py3_gcc5_4_build
9168-
requires:
9169-
- "docker-pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4"
9170-
build_environment: "pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4-build"
9171-
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4"
91729125

91739126
# The following allows these jobs to run on ci-all and release branches
91749127
debuggable-scheduled-ci:
@@ -9230,93 +9183,6 @@ workflows:
92309183
only:
92319184
- /ci-all\/.*/
92329185
- /release\/.*/
9233-
- pytorch_windows_test:
9234-
build_environment: pytorch-win-vs2019-cuda11-cudnn8-py3
9235-
cuda_version: "11.2"
9236-
executor: windows-with-nvidia-gpu
9237-
name: pytorch_windows_vs2019_py36_cuda11.2_test1
9238-
python_version: "3.6"
9239-
requires:
9240-
- pytorch_windows_vs2019_py36_cuda11.2_build
9241-
test_name: pytorch-windows-test1
9242-
use_cuda: "1"
9243-
vc_product: Community
9244-
vc_version: ""
9245-
vc_year: "2019"
9246-
filters:
9247-
branches:
9248-
only:
9249-
- /ci-all\/.*/
9250-
- /release\/.*/
9251-
- pytorch_windows_test:
9252-
build_environment: pytorch-win-vs2019-cuda11-cudnn8-py3
9253-
cuda_version: "11.2"
9254-
executor: windows-with-nvidia-gpu
9255-
name: pytorch_windows_vs2019_py36_cuda11.2_test2
9256-
python_version: "3.6"
9257-
requires:
9258-
- pytorch_windows_vs2019_py36_cuda11.2_build
9259-
test_name: pytorch-windows-test2
9260-
use_cuda: "1"
9261-
vc_product: Community
9262-
vc_version: ""
9263-
vc_year: "2019"
9264-
filters:
9265-
branches:
9266-
only:
9267-
- /ci-all\/.*/
9268-
- /release\/.*/
9269-
- docker_build_job:
9270-
name: "docker-pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4"
9271-
image_name: "pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4"
9272-
filters:
9273-
branches:
9274-
only:
9275-
- /ci-all\/.*/
9276-
- /release\/.*/
9277-
- docker_build_job:
9278-
name: "docker-pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7"
9279-
image_name: "pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7"
9280-
filters:
9281-
branches:
9282-
only:
9283-
- /ci-all\/.*/
9284-
- /release\/.*/
9285-
- pytorch_linux_build:
9286-
name: pytorch_linux_xenial_cuda9_2_cudnn7_py3_gcc7_build
9287-
requires:
9288-
- "docker-pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7"
9289-
build_environment: "pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7-build"
9290-
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7"
9291-
filters:
9292-
branches:
9293-
only:
9294-
- /ci-all\/.*/
9295-
- /release\/.*/
9296-
- pytorch_linux_test:
9297-
name: pytorch_linux_xenial_cuda9_2_cudnn7_py3_gcc7_test
9298-
requires:
9299-
- pytorch_linux_xenial_cuda9_2_cudnn7_py3_gcc7_build
9300-
build_environment: "pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7-test"
9301-
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7"
9302-
use_cuda_docker_runtime: "1"
9303-
resource_class: gpu.medium
9304-
filters:
9305-
branches:
9306-
only:
9307-
- /ci-all\/.*/
9308-
- /release\/.*/
9309-
- pytorch_linux_build:
9310-
name: pytorch_linux_xenial_cuda9_2_cudnn7_py3_gcc5_4_build
9311-
requires:
9312-
- "docker-pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4"
9313-
build_environment: "pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4-build"
9314-
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4"
9315-
filters:
9316-
branches:
9317-
only:
9318-
- /ci-all\/.*/
9319-
- /release\/.*/
93209186
ecr_gc:
93219187
triggers:
93229188
- schedule:

.circleci/docker/build.sh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -101,24 +101,6 @@ case "$image" in
101101
DB=yes
102102
VISION=yes
103103
;;
104-
pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc5.4)
105-
CUDA_VERSION=9.2
106-
CUDNN_VERSION=7
107-
ANACONDA_PYTHON_VERSION=3.6
108-
GCC_VERSION=5
109-
PROTOBUF=yes
110-
DB=yes
111-
VISION=yes
112-
;;
113-
pytorch-linux-xenial-cuda9.2-cudnn7-py3-gcc7)
114-
CUDA_VERSION=9.2
115-
CUDNN_VERSION=7
116-
ANACONDA_PYTHON_VERSION=3.6
117-
GCC_VERSION=7
118-
PROTOBUF=yes
119-
DB=yes
120-
VISION=yes
121-
;;
122104
pytorch-linux-xenial-cuda10-cudnn7-py3-gcc7)
123105
CUDA_VERSION=10.0
124106
CUDNN_VERSION=7

.circleci/docker/common/install_base.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ install_centos() {
7777
glog-devel \
7878
hiredis-devel \
7979
libstdc++-devel \
80+
libsndfile-devel \
8081
make \
8182
opencv-devel \
8283
sudo \

.circleci/docker/common/install_conda.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,8 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
8080
else
8181
conda_install numpy=1.18.5 pyyaml mkl mkl-include setuptools cffi future six dataclasses typing_extensions
8282
fi
83-
if [[ "$CUDA_VERSION" == 9.2* ]]; then
84-
conda_install magma-cuda92 -c pytorch
85-
elif [[ "$CUDA_VERSION" == 10.0* ]]; then
83+
84+
if [[ "$CUDA_VERSION" == 10.0* ]]; then
8685
conda_install magma-cuda100 -c pytorch
8786
elif [[ "$CUDA_VERSION" == 10.1* ]]; then
8887
conda_install magma-cuda101 -c pytorch

.circleci/regenerate.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
#!/bin/bash -xe
1+
#!/bin/bash -e
22

33
# Allows this script to be invoked from any directory:
44
cd "$(dirname "$0")"
55

6-
OLD_FILE=$(mktemp)
7-
cp config.yml "$OLD_FILE"
6+
UNCOMMIT_CHANGE=$(git status -s | grep " config.yml" | wc -l | xargs)
7+
if [[ $UNCOMMIT_CHANGE != 0 ]]; then
8+
OLD_FILE=$(mktemp)
9+
cp config.yml "$OLD_FILE"
10+
echo "Uncommitted change detected in .circleci/config.yml"
11+
echo "It has been backed up to $OLD_FILE"
12+
fi
13+
814
NEW_FILE=$(mktemp)
915
./generate_config_yml.py > "$NEW_FILE"
1016
cp "$NEW_FILE" config.yml
17+
echo "New config generated in .circleci/config.yml"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
$CMATH_DOWNLOAD_LINK = "https://raw.githubusercontent.com/microsoft/STL/12c684bba78f9b032050526abdebf14f58ca26a3/stl/inc/cmath"
2+
$VC14_28_INSTALL_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include"
3+
4+
curl.exe --retry 3 -kL $CMATH_DOWNLOAD_LINK --output "$home\cmath"
5+
Move-Item -Path "$home\cmath" -Destination "$VC14_28_INSTALL_PATH" -Force

.circleci/verbatim-sources/job-specs/binary-job-specs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@
293293
steps:
294294
# See Note [Workspace for CircleCI scripts] in job-specs-setup.yml
295295
- checkout
296+
- run:
297+
name: _HACK_ Install CUDA compatible cmath
298+
no_output_timeout: 1m
299+
command: |
300+
powershell .circleci/scripts/vs_install_cmath.ps1
296301
- run:
297302
<<: *binary_checkout
298303
- run:

.circleci/verbatim-sources/job-specs/pytorch-job-specs.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
3535
docker cp /home/circleci/project/. $id:/var/lib/jenkins/workspace
3636
37-
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'
37+
export COMMAND='((echo "sudo chown -R jenkins workspace && export CIRCLE_JOB="$CIRCLE_JOB" && 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'
3838
3939
echo ${COMMAND} > ./command.sh && unbuffer bash ./command.sh | ts
4040
@@ -165,6 +165,7 @@ jobs:
165165
# =================== The following code will be executed inside Docker container ===================
166166
set -ex
167167
export SCRIBE_GRAPHQL_ACCESS_TOKEN="${SCRIBE_GRAPHQL_ACCESS_TOKEN}"
168+
export CIRCLE_JOB="$CIRCLE_JOB"
168169
${PARALLEL_FLAGS}
169170
cd workspace
170171
EOL
@@ -258,6 +259,11 @@ jobs:
258259
executor: <<parameters.executor>>
259260
steps:
260261
- checkout
262+
- run:
263+
name: _HACK_ Install CUDA compatible cmath
264+
no_output_timeout: 1m
265+
command: |
266+
powershell .circleci/scripts/vs_install_cmath.ps1
261267
- run:
262268
name: Install Cuda
263269
no_output_timeout: 30m

0 commit comments

Comments
 (0)