Skip to content

Commit e62ea33

Browse files
pbelevichfacebook-github-bot
authored andcommitted
Fix windows cuda 9.2 builds (#91)
Summary: Pull Request resolved: #91 Test Plan: Imported from OSS Reviewed By: zou3519 Differential Revision: D25386316 Pulled By: pbelevich fbshipit-source-id: e79f6e88ceff6a550c9b2b17fcbefe56d2e080ee
1 parent 99a0c1c commit e62ea33

File tree

9 files changed

+509
-189
lines changed

9 files changed

+509
-189
lines changed

.circleci/config.yml

Lines changed: 0 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -497,15 +497,6 @@ workflows:
497497
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
498498
name: binary_win_wheel_py3.6_cpu
499499
python_version: '3.6'
500-
- binary_win_wheel:
501-
cu_version: cu92
502-
filters:
503-
branches:
504-
only: master
505-
tags:
506-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
507-
name: binary_win_wheel_py3.6_cu92
508-
python_version: '3.6'
509500
- binary_win_wheel:
510501
cu_version: cu101
511502
filters:
@@ -542,15 +533,6 @@ workflows:
542533
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
543534
name: binary_win_wheel_py3.7_cpu
544535
python_version: '3.7'
545-
- binary_win_wheel:
546-
cu_version: cu92
547-
filters:
548-
branches:
549-
only: master
550-
tags:
551-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
552-
name: binary_win_wheel_py3.7_cu92
553-
python_version: '3.7'
554536
- binary_win_wheel:
555537
cu_version: cu101
556538
filters:
@@ -582,15 +564,6 @@ workflows:
582564
cu_version: cpu
583565
name: binary_win_wheel_py3.8_cpu
584566
python_version: '3.8'
585-
- binary_win_wheel:
586-
cu_version: cu92
587-
filters:
588-
branches:
589-
only: master
590-
tags:
591-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
592-
name: binary_win_wheel_py3.8_cu92
593-
python_version: '3.8'
594567
- binary_win_wheel:
595568
cu_version: cu101
596569
filters:
@@ -712,15 +685,6 @@ workflows:
712685
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
713686
name: binary_win_conda_py3.6_cpu
714687
python_version: '3.6'
715-
- binary_win_conda:
716-
cu_version: cu92
717-
filters:
718-
branches:
719-
only: master
720-
tags:
721-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
722-
name: binary_win_conda_py3.6_cu92
723-
python_version: '3.6'
724688
- binary_win_conda:
725689
cu_version: cu101
726690
filters:
@@ -757,15 +721,6 @@ workflows:
757721
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
758722
name: binary_win_conda_py3.7_cpu
759723
python_version: '3.7'
760-
- binary_win_conda:
761-
cu_version: cu92
762-
filters:
763-
branches:
764-
only: master
765-
tags:
766-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
767-
name: binary_win_conda_py3.7_cu92
768-
python_version: '3.7'
769724
- binary_win_conda:
770725
cu_version: cu101
771726
filters:
@@ -797,15 +752,6 @@ workflows:
797752
cu_version: cpu
798753
name: binary_win_conda_py3.8_cpu
799754
python_version: '3.8'
800-
- binary_win_conda:
801-
cu_version: cu92
802-
filters:
803-
branches:
804-
only: master
805-
tags:
806-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
807-
name: binary_win_conda_py3.8_cu92
808-
python_version: '3.8'
809755
- binary_win_conda:
810756
cu_version: cu101
811757
filters:
@@ -1306,26 +1252,6 @@ workflows:
13061252
requires:
13071253
- nightly_binary_win_wheel_py3.6_cpu
13081254
subfolder: cpu/
1309-
- binary_win_wheel:
1310-
cu_version: cu92
1311-
filters:
1312-
branches:
1313-
only: nightly
1314-
tags:
1315-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
1316-
name: nightly_binary_win_wheel_py3.6_cu92
1317-
python_version: '3.6'
1318-
- binary_wheel_upload:
1319-
context: org-member
1320-
filters:
1321-
branches:
1322-
only: nightly
1323-
tags:
1324-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
1325-
name: nightly_binary_win_wheel_py3.6_cu92_upload
1326-
requires:
1327-
- nightly_binary_win_wheel_py3.6_cu92
1328-
subfolder: cu92/
13291255
- binary_win_wheel:
13301256
cu_version: cu101
13311257
filters:
@@ -1406,26 +1332,6 @@ workflows:
14061332
requires:
14071333
- nightly_binary_win_wheel_py3.7_cpu
14081334
subfolder: cpu/
1409-
- binary_win_wheel:
1410-
cu_version: cu92
1411-
filters:
1412-
branches:
1413-
only: nightly
1414-
tags:
1415-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
1416-
name: nightly_binary_win_wheel_py3.7_cu92
1417-
python_version: '3.7'
1418-
- binary_wheel_upload:
1419-
context: org-member
1420-
filters:
1421-
branches:
1422-
only: nightly
1423-
tags:
1424-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
1425-
name: nightly_binary_win_wheel_py3.7_cu92_upload
1426-
requires:
1427-
- nightly_binary_win_wheel_py3.7_cu92
1428-
subfolder: cu92/
14291335
- binary_win_wheel:
14301336
cu_version: cu101
14311337
filters:
@@ -1506,26 +1412,6 @@ workflows:
15061412
requires:
15071413
- nightly_binary_win_wheel_py3.8_cpu
15081414
subfolder: cpu/
1509-
- binary_win_wheel:
1510-
cu_version: cu92
1511-
filters:
1512-
branches:
1513-
only: nightly
1514-
tags:
1515-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
1516-
name: nightly_binary_win_wheel_py3.8_cu92
1517-
python_version: '3.8'
1518-
- binary_wheel_upload:
1519-
context: org-member
1520-
filters:
1521-
branches:
1522-
only: nightly
1523-
tags:
1524-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
1525-
name: nightly_binary_win_wheel_py3.8_cu92_upload
1526-
requires:
1527-
- nightly_binary_win_wheel_py3.8_cu92
1528-
subfolder: cu92/
15291415
- binary_win_wheel:
15301416
cu_version: cu101
15311417
filters:
@@ -1965,25 +1851,6 @@ workflows:
19651851
name: nightly_binary_win_conda_py3.6_cpu_upload
19661852
requires:
19671853
- nightly_binary_win_conda_py3.6_cpu
1968-
- binary_win_conda:
1969-
cu_version: cu92
1970-
filters:
1971-
branches:
1972-
only: nightly
1973-
tags:
1974-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
1975-
name: nightly_binary_win_conda_py3.6_cu92
1976-
python_version: '3.6'
1977-
- binary_conda_upload:
1978-
context: org-member
1979-
filters:
1980-
branches:
1981-
only: nightly
1982-
tags:
1983-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
1984-
name: nightly_binary_win_conda_py3.6_cu92_upload
1985-
requires:
1986-
- nightly_binary_win_conda_py3.6_cu92
19871854
- binary_win_conda:
19881855
cu_version: cu101
19891856
filters:
@@ -2060,25 +1927,6 @@ workflows:
20601927
name: nightly_binary_win_conda_py3.7_cpu_upload
20611928
requires:
20621929
- nightly_binary_win_conda_py3.7_cpu
2063-
- binary_win_conda:
2064-
cu_version: cu92
2065-
filters:
2066-
branches:
2067-
only: nightly
2068-
tags:
2069-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
2070-
name: nightly_binary_win_conda_py3.7_cu92
2071-
python_version: '3.7'
2072-
- binary_conda_upload:
2073-
context: org-member
2074-
filters:
2075-
branches:
2076-
only: nightly
2077-
tags:
2078-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
2079-
name: nightly_binary_win_conda_py3.7_cu92_upload
2080-
requires:
2081-
- nightly_binary_win_conda_py3.7_cu92
20821930
- binary_win_conda:
20831931
cu_version: cu101
20841932
filters:
@@ -2155,25 +2003,6 @@ workflows:
21552003
name: nightly_binary_win_conda_py3.8_cpu_upload
21562004
requires:
21572005
- nightly_binary_win_conda_py3.8_cpu
2158-
- binary_win_conda:
2159-
cu_version: cu92
2160-
filters:
2161-
branches:
2162-
only: nightly
2163-
tags:
2164-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
2165-
name: nightly_binary_win_conda_py3.8_cu92
2166-
python_version: '3.8'
2167-
- binary_conda_upload:
2168-
context: org-member
2169-
filters:
2170-
branches:
2171-
only: nightly
2172-
tags:
2173-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
2174-
name: nightly_binary_win_conda_py3.8_cu92_upload
2175-
requires:
2176-
- nightly_binary_win_conda_py3.8_cu92
21772006
- binary_win_conda:
21782007
cu_version: cu101
21792008
filters:

packaging/build_wheel.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,44 @@ pip_install numpy pyyaml future ninja
1111
setup_pip_pytorch_version
1212
python setup.py clean
1313

14+
# Copy binaries to be included in the wheel distribution
15+
if [[ "$(uname)" == Darwin || "$OSTYPE" == "msys" ]]; then
16+
python_exec="$(which python)"
17+
bin_path=$(dirname $python_exec)
18+
env_path=$(dirname $bin_path)
19+
if [[ "$(uname)" == Darwin ]]; then
20+
# Install delocate to relocate the required binaries
21+
pip_install delocate
22+
fi
23+
else
24+
# Install auditwheel to get some inspection utilities
25+
pip_install auditwheel
26+
27+
# Point to custom libraries
28+
export LD_LIBRARY_PATH=$(pwd)/ext_libraries/lib:$LD_LIBRARY_PATH
29+
export TORCHCSPRNG_INCLUDE=$(pwd)/ext_libraries/include
30+
export TORCHCSPRNG_LIBRARY=$(pwd)/ext_libraries/lib
31+
fi
32+
1433
if [[ "$OSTYPE" == "msys" ]]; then
1534
IS_WHEEL=1 "$script_dir/windows/internal/vc_env_helper.bat" python setup.py bdist_wheel
1635
else
1736
IS_WHEEL=1 python setup.py bdist_wheel
1837
fi
38+
39+
40+
if [[ "$(uname)" == Darwin ]]; then
41+
pushd dist/
42+
python_exec="$(which python)"
43+
bin_path=$(dirname $python_exec)
44+
env_path=$(dirname $bin_path)
45+
for whl in *.whl; do
46+
DYLD_LIBRARY_PATH="$env_path/lib/:$DYLD_LIBRARY_PATH" delocate-wheel -v $whl
47+
done
48+
else
49+
if [[ "$OSTYPE" == "msys" ]]; then
50+
"$script_dir/windows/internal/vc_env_helper.bat" python $script_dir/wheel/relocate.py
51+
else
52+
LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" python $script_dir/wheel/relocate.py
53+
fi
54+
fi

packaging/conda/build_csprng.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ else
127127
fi
128128

129129
if [[ -z "$PYTORCH_VERSION" ]]; then
130-
export CONDA_CHANNEL_FLAGS="-c pytorch-nightly"
130+
export CONDA_CHANNEL_FLAGS="-c pytorch-nightly -c pytorch"
131131
export PYTORCH_VERSION="$(conda search --json 'pytorch[channel=pytorch-nightly]' | \
132132
python -c "import os, sys, json, re; cuver = '$cuver'; \
133133
cuver = cuver.replace('cu', 'cuda') if cuver != 'cpu' else cuver; \
@@ -164,9 +164,9 @@ for py_ver in "${DESIRED_PYTHON[@]}"; do
164164
mkdir "$output_folder"
165165

166166
if [[ "$py_ver" == 3.5 ]]; then
167-
export CONDA_TYPING_CONSTRAINT="- typing"
167+
export CONDA_TYPING_CONSTRAINT="- typing"
168168
else
169-
export CONDA_TYPING_CONSTRAINT=""
169+
export CONDA_TYPING_CONSTRAINT=""
170170
fi
171171

172172
export VSTOOLCHAIN_PACKAGE=vs2017

0 commit comments

Comments
 (0)