Skip to content

Commit cc3259b

Browse files
bottlerfacebook-github-bot
authored andcommitted
update linux wheel builds
Summary: * Add PyTorch 1.10 + CUDA 11.1 combination. * Change the CUDA 11.3 builds to happen in a separate docker image. * Update connection to AWS to use the official `aws` commands instead of the wrapper which is now gone. Reviewed By: patricklabatut Differential Revision: D33235489 fbshipit-source-id: 56401f27c002a512ae121b3ec5911d020bfab885
1 parent b51be58 commit cc3259b

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

packaging/linux_wheels/go.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
# LICENSE file in the root directory of this source tree.
77

88
sudo docker run --rm -v "$PWD/../../:/inside" pytorch/conda-cuda bash inside/packaging/linux_wheels/inside.sh
9+
sudo docker run --rm -v "$PWD/../../:/inside" -e SELECTED_CUDA=cu113 pytorch/conda-builder:cuda113 bash inside/packaging/linux_wheels/inside.sh

packaging/linux_wheels/inside.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ declare -A CONDA_CUDA_VERSIONS=(
3939
# ["1.8.1"]="cu101 cu102 cu111"
4040
# ["1.9.0"]="cu102 cu111"
4141
# ["1.9.1"]="cu102 cu111"
42-
["1.10.0"]="cu102 cu113"
42+
["1.10.0"]="cu102 cu111 cu113"
4343
)
4444

4545

@@ -58,6 +58,13 @@ do
5858

5959
for cu_version in ${CONDA_CUDA_VERSIONS[$pytorch_version]}
6060
do
61+
if [[ "cu113" == *$cu_version* ]] && [[ $SELECTED_CUDA != "$cu_version" ]]
62+
# ^^^ CUDA versions listed here have to be built
63+
# in their own containers.
64+
then
65+
continue
66+
fi
67+
6168
case "$cu_version" in
6269
cu113)
6370
export CUDA_HOME=/usr/local/cuda-11.3/

packaging/linux_wheels/publish.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7-
import os
87
import subprocess
98
from pathlib import Path
109
from typing import List
@@ -15,13 +14,12 @@
1514
output = Path("output")
1615

1716

18-
def fs3cmd(args, allow_failure: bool = False) -> List[str]:
17+
def aws_s3_cmd(args) -> List[str]:
1918
"""
20-
This function returns the args for subprocess to mimic the bash command
21-
fs3cmd available in the fairusers_aws module on the FAIR cluster.
19+
This function returns the full args for subprocess to do a command
20+
with aws.
2221
"""
23-
os.environ["FAIR_CLUSTER_NAME"] = os.environ["FAIR_ENV_CLUSTER"].lower()
24-
cmd_args = ["/public/apps/fairusers_aws/bin/fs3cmd"] + args
22+
cmd_args = ["aws", "s3", "--profile", "saml"] + args
2523
return cmd_args
2624

2725

@@ -31,7 +29,7 @@ def fs3_exists(path) -> bool:
3129
In fact, will also return True if there is a file which has the given
3230
path as a prefix, but we are careful about this.
3331
"""
34-
out = subprocess.check_output(fs3cmd(["ls", path]))
32+
out = subprocess.check_output(aws_s3_cmd(["ls", path]))
3533
return len(out) != 0
3634

3735

@@ -41,7 +39,7 @@ def get_html_wrappers() -> None:
4139
assert not output_wrapper.exists()
4240
dest_wrapper = dest + directory.name + "/download.html"
4341
if fs3_exists(dest_wrapper):
44-
subprocess.check_call(fs3cmd(["get", dest_wrapper, str(output_wrapper)]))
42+
subprocess.check_call(aws_s3_cmd(["cp", dest_wrapper, str(output_wrapper)]))
4543

4644

4745
def write_html_wrappers() -> None:
@@ -70,7 +68,7 @@ def to_aws() -> None:
7068
for file in directory.iterdir():
7169
print(file)
7270
subprocess.check_call(
73-
fs3cmd(["put", str(file), dest + str(file.relative_to(output))])
71+
aws_s3_cmd(["cp", str(file), dest + str(file.relative_to(output))])
7472
)
7573

7674

@@ -79,3 +77,11 @@ def to_aws() -> None:
7977
# get_html_wrappers()
8078
write_html_wrappers()
8179
to_aws()
80+
81+
82+
# see all files with
83+
# aws s3 --profile saml ls --recursive s3://dl.fbaipublicfiles.com/pytorch3d/
84+
85+
# empty current with
86+
# aws s3 --profile saml rm --recursive
87+
# s3://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/

0 commit comments

Comments
 (0)