Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging setup #237

Merged
merged 68 commits into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
857161b
init
vmoens Jun 29, 2022
98f476b
amend
vmoens Jun 29, 2022
b2eca75
init
vmoens Jun 30, 2022
d4797f6
amend
vmoens Jun 30, 2022
eecd969
amend
vmoens Jun 30, 2022
092b7c9
amend
vmoens Jun 30, 2022
79f1c62
amend
vmoens Jun 30, 2022
45a1b55
amend
vmoens Jun 30, 2022
f99ed35
amend
vmoens Jun 30, 2022
3f308c6
amend
vmoens Jun 30, 2022
e7bcbe6
amend
vmoens Jun 30, 2022
08e4fee
amend
vmoens Jun 30, 2022
de458d7
amend
vmoens Jun 30, 2022
37b69e0
amend
vmoens Jun 30, 2022
d3afa54
amend
vmoens Jun 30, 2022
070070e
minor
vmoens Jun 30, 2022
92627f5
amend
vmoens Jun 30, 2022
6eea294
amend
vmoens Jun 30, 2022
49eb1eb
amend
vmoens Jun 30, 2022
47c711e
amend
vmoens Jun 30, 2022
877f3b0
amend
vmoens Jun 30, 2022
bf6c8bb
amend
vmoens Jun 30, 2022
53fb798
amend
vmoens Jun 30, 2022
96181cc
amend
vmoens Jun 30, 2022
5ff4f80
amend
vmoens Jun 30, 2022
e374a46
amend
vmoens Jun 30, 2022
0cb47bd
trying to disable cuda
vmoens Jun 30, 2022
5b29a63
Merge remote-tracking branch 'origin/main' into cu113
vmoens Jun 30, 2022
64c7ea2
remove cmakeslist
vmoens Jun 30, 2022
fcd1735
remove cmakeslist
vmoens Jun 30, 2022
44238e1
clean env
vmoens Jun 30, 2022
42e8c28
Merge branch 'cu113' into packaging
vmoens Jun 30, 2022
ebaaebd
Merge branch 'main' into packaging
vmoens Jul 1, 2022
24b786a
Merge branch 'main' into packaging
vmoens Jul 4, 2022
d06390a
102
vmoens Jul 4, 2022
7d547ec
113
vmoens Jul 4, 2022
b80f6e7
some more binaries
vmoens Jul 4, 2022
701bfad
minor
vmoens Jul 4, 2022
0270035
minor
vmoens Jul 4, 2022
7f4ae3c
minor
vmoens Jul 4, 2022
e09d99d
relocating
vmoens Jul 4, 2022
7c7151e
relocating
vmoens Jul 4, 2022
db74c6b
relocating
vmoens Jul 4, 2022
bf561e4
builder
vmoens Jul 4, 2022
154e73c
builder
vmoens Jul 4, 2022
848dfdc
builder
vmoens Jul 4, 2022
3e7d1a3
builder
vmoens Jul 4, 2022
86a2f43
builder
vmoens Jul 4, 2022
3002a1f
version
vmoens Jul 4, 2022
db217bd
version
vmoens Jul 4, 2022
8be3b0c
auditwheel
vmoens Jul 4, 2022
0e01b69
auditwheel
vmoens Jul 4, 2022
e4c5165
auditwheel
vmoens Jul 4, 2022
16b6fc0
auditwheel
vmoens Jul 4, 2022
f8670a1
auditwheel
vmoens Jul 4, 2022
bef1121
auditwheel
vmoens Jul 4, 2022
7e84d7e
bf
vmoens Jul 4, 2022
8958a7d
bf
vmoens Jul 4, 2022
87a34b1
relocate
vmoens Jul 4, 2022
6043811
manylinux version
vmoens Jul 4, 2022
1477e2e
manylinux version
vmoens Jul 4, 2022
194ab6a
manylinux version
vmoens Jul 4, 2022
c1a24c3
manylinux version
vmoens Jul 4, 2022
7a998ee
manylinux version
vmoens Jul 4, 2022
2536871
cleanup
vmoens Jul 5, 2022
592bd6a
cleanup
vmoens Jul 5, 2022
6350abc
cleanup
vmoens Jul 5, 2022
f79b121
save/designate
vmoens Jul 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 44 additions & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ binary_common: &binary_common
wheel_docker_image:
description: "Wheel only: what docker image to use"
type: string
default: "pytorch/manylinux-cuda102"
default: "pytorch/manylinux-cuda113"
conda_docker_image:
description: "Conda only: what docker image to use"
type: string
Expand Down Expand Up @@ -218,20 +218,21 @@ jobs:
<<: *binary_common

docker:
- image: "pytorch/manylinux-cuda102"
- image: "pytorch/manylinux-cuda113"
resource_class: 2xlarge+

environment:
TAR_OPTIONS: --no-same-owner
PYTHON_VERSION: << parameters.python_version >>
CU_VERSION: << parameters.cu_version >>

steps:
- checkout
- designate_upload_channel
- run:
name: Generate cache key
# This will refresh cache on Sundays, nightly build should generate new cache.
command: echo "$(date +"%Y-%U")" > .circleci-weekly
# - run:
# name: Generate cache key
# # This will refresh cache on Sundays, nightly build should generate new cache.
# command: echo "$(date +"%Y-%U")" > .circleci-weekly
# - restore_cache:
# keys:
# - env-v2-linux-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }}
Expand Down Expand Up @@ -262,20 +263,21 @@ jobs:
unittest_linux_gpu:
<<: *binary_common
machine:
image: ubuntu-1604-cuda-10.2:202012-01
image: ubuntu-2004-cuda-11.4:202110-01
resource_class: gpu.nvidia.medium
environment:
image_name: "pytorch/manylinux-cuda102"
image_name: "pytorch/manylinux-cuda113"
TAR_OPTIONS: --no-same-owner
PYTHON_VERSION: << parameters.python_version >>
CU_VERSION: << parameters.cu_version >>

steps:
- checkout
- designate_upload_channel
- run:
name: Generate cache key
# This will refresh cache on Sundays, nightly build should generate new cache.
command: echo "$(date +"%Y-%U")" > .circleci-weekly
# - run:
# name: Generate cache key
# # This will refresh cache on Sundays, nightly build should generate new cache.
# command: echo "$(date +"%Y-%U")" > .circleci-weekly
# - restore_cache:
#
# keys:
Expand All @@ -294,7 +296,7 @@ jobs:
- run:
# Here we create an envlist file that contains some env variables that we want the docker container to be aware of.
# Normally, the CIRCLECI variable is set and available on all CI workflows: https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables.
# They're availble in all the other workflows (OSX and Windows).
# They're available in all the other workflows (OSX and Windows).
# But here, we're running the unittest_linux_gpu workflows in a docker container, where those variables aren't accessible.
# So instead we dump the variables we need in env.list and we pass that file when invoking "docker run".
name: export CIRCLECI env var
Expand All @@ -314,28 +316,29 @@ jobs:
unittest_linux_optdeps_gpu:
<<: *binary_common
machine:
image: ubuntu-1604-cuda-10.2:202012-01
image: ubuntu-2004-cuda-11.4:202110-01
resource_class: gpu.nvidia.medium
environment:
image_name: "pytorch/manylinux-cuda102"
image_name: "pytorch/manylinux-cuda113"
TAR_OPTIONS: --no-same-owner
PYTHON_VERSION: << parameters.python_version >>
CU_VERSION: << parameters.cu_version >>

steps:
- checkout
- designate_upload_channel
- run:
name: Generate cache key
# This will refresh cache on Sundays, nightly build should generate new cache.
command: echo "$(date +"%Y-%U")" > .circleci-weekly
# - run:
# name: Generate cache key
# # This will refresh cache on Sundays, nightly build should generate new cache.
# command: echo "$(date +"%Y-%U")" > .circleci-weekly
# - restore_cache:
#
# keys:
# - env-v3-linux-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux_optdeps/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }}

- run:
name: Setup
command: docker run -e PYTHON_VERSION -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux_optdeps/scripts/setup_env.sh
command: .circleci/unittest/linux_optdeps/scripts/setup_env.sh
# - save_cache:
#
# key: env-v3-linux-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux_optdeps/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }}
Expand All @@ -346,7 +349,7 @@ jobs:
- run:
# Here we create an envlist file that contains some env variables that we want the docker container to be aware of.
# Normally, the CIRCLECI variable is set and available on all CI workflows: https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables.
# They're availble in all the other workflows (OSX and Windows).
# They're available in all the other workflows (OSX and Windows).
# But here, we're running the unittest_linux_gpu workflows in a docker container, where those variables aren't accessible.
# So instead we dump the variables we need in env.list and we pass that file when invoking "docker run".
name: export CIRCLECI env var
Expand All @@ -367,20 +370,21 @@ jobs:
<<: *binary_common

docker:
- image: "pytorch/manylinux-cuda102"
- image: "pytorch/manylinux-cuda113"
resource_class: 2xlarge+

environment:
TAR_OPTIONS: --no-same-owner
PYTHON_VERSION: << parameters.python_version >>
CU_VERSION: << parameters.cu_version >>

steps:
- checkout
- designate_upload_channel
- run:
name: Generate cache key
# This will refresh cache on Sundays, nightly build should generate new cache.
command: echo "$(date +"%Y-%U")" > .circleci-weekly
# - run:
# name: Generate cache key
# # This will refresh cache on Sundays, nightly build should generate new cache.
# command: echo "$(date +"%Y-%U")" > .circleci-weekly
# - restore_cache:
#
# keys:
Expand Down Expand Up @@ -412,20 +416,21 @@ jobs:
unittest_linux_stable_gpu:
<<: *binary_common
machine:
image: ubuntu-1604-cuda-10.2:202012-01
image: ubuntu-2004-cuda-11.4:202110-01
resource_class: gpu.nvidia.medium
environment:
image_name: "pytorch/manylinux-cuda102"
image_name: "pytorch/manylinux-cuda113"
TAR_OPTIONS: --no-same-owner
PYTHON_VERSION: << parameters.python_version >>
CU_VERSION: << parameters.cu_version >>

steps:
- checkout
- designate_upload_channel
- run:
name: Generate cache key
# This will refresh cache on Sundays, nightly build should generate new cache.
command: echo "$(date +"%Y-%U")" > .circleci-weekly
# - run:
# name: Generate cache key
# # This will refresh cache on Sundays, nightly build should generate new cache.
# command: echo "$(date +"%Y-%U")" > .circleci-weekly
# - restore_cache:
#
# keys:
Expand Down Expand Up @@ -474,10 +479,10 @@ jobs:
name: Install wget
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install wget
# Disable brew auto update which is very slow
- run:
name: Generate cache key
# This will refresh cache on Sundays, nightly build should generate new cache.
command: echo "$(date +"%Y-%U")" > .circleci-weekly
# - run:
# name: Generate cache key
# # This will refresh cache on Sundays, nightly build should generate new cache.
# command: echo "$(date +"%Y-%U")" > .circleci-weekly
# - restore_cache:
#
# keys:
Expand Down Expand Up @@ -535,12 +540,12 @@ workflows:
python_version: '3.8'

- unittest_linux_gpu:
cu_version: cu102
cu_version: cu113
name: unittest_linux_gpu_py3.8
python_version: '3.8'

- unittest_linux_optdeps_gpu:
cu_version: cu102
cu_version: cu113
name: unittest_linux_optdeps_gpu_py3.8
python_version: '3.8'

Expand All @@ -550,6 +555,6 @@ workflows:
python_version: '3.8'

- unittest_linux_stable_gpu:
cu_version: cu102
cu_version: cu113
name: unittest_linux_stable_gpu_py3.8
python_version: '3.8'
4 changes: 2 additions & 2 deletions .circleci/unittest/linux/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if [ "${CU_VERSION:-}" == cpu ] ; then
pip3 install torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html --pre
fi
else
pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu102
pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu113
fi

printf "Installing functorch\n"
Expand All @@ -53,7 +53,7 @@ pip install "git+https://github.com/pytorch/functorch.git"
python -c "import functorch"

printf "* Installing torchrl\n"
python setup.py develop
pip install -e .

if [[ $OSTYPE == 'darwin'* ]]; then
PRIVATE_MUJOCO_GL=glfw
Expand Down
9 changes: 0 additions & 9 deletions .circleci/unittest/linux/scripts/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ lib_dir="${env_dir}/lib"

# solves ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$lib_dir
#if [[ $OSTYPE == 'darwin'* ]]; then
# PRIVATE_MUJOCO_GL=glfw
#else
# PRIVATE_MUJOCO_GL=egl
#fi
## pygame.error: No available video device
#export SDL_VIDEODRIVER=dummy
## solves AttributeError: 'NoneType' object has no attribute 'eglQueryString'
#export MUJOCO_GL=$PRIVATE_MUJOCO_GL

pytest test/smoke_test.py -v --durations 20
pytest test/smoke_test_deps.py -v --durations 20
Expand Down
5 changes: 0 additions & 5 deletions .circleci/unittest/linux/scripts/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,4 @@ printf "* Installing dependencies (except PyTorch)\n"
echo " - python=${PYTHON_VERSION}" >> "${this_dir}/environment.yml"
cat "${this_dir}/environment.yml"

#conda install -y -c conda-forge glfw
#conda install -y -c conda-forge mesa
#conda install -y -c menpo osmesa
#conda install -y -c conda-forge glew

conda env update --file "${this_dir}/environment.yml" --prune
20 changes: 9 additions & 11 deletions .circleci/unittest/linux_optdeps/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,17 @@ esac
# submodules
git submodule sync && git submodule update --init --recursive

#printf "Installing PyTorch with %s\n" "${cudatoolkit}"
#if [ "${os}" == "MacOSX" ]; then
# conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest
#else
# conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" pytest
#fi

#printf "Installing PyTorch with %s\n" "${CU_VERSION}"
printf "Installing PyTorch with %s\n" "${CU_VERSION}"
if [ "${CU_VERSION:-}" == cpu ] ; then
# conda install -y pytorch torchvision cpuonly -c pytorch-nightly
# use pip to install pytorch as conda can frequently pick older release
pip install torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html --pre
if [[ $OSTYPE == 'darwin'* ]]; then
pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu
else
pip3 install torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html --pre
fi
else
conda install -y pytorch cudatoolkit=10.2 -c pytorch-nightly
pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu113
fi

printf "Installing functorch\n"
Expand All @@ -55,7 +53,7 @@ pip install "git+https://github.com/pytorch/functorch.git"
python -c "import functorch"

printf "* Installing torchrl\n"
python setup.py develop
pip install -e .

# smoke test
python -c "import torchrl"
5 changes: 3 additions & 2 deletions .circleci/unittest/linux_stable/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ conda activate ./env
if [ "${CU_VERSION:-}" == cpu ] ; then
cudatoolkit="cpuonly"
version="cpu"
echo "Using cpu build"
else
if [[ ${#CU_VERSION} -eq 4 ]]; then
CUDA_VERSION="${CU_VERSION:2:1}.${CU_VERSION:3:1}"
Expand All @@ -38,7 +39,7 @@ if [ "${CU_VERSION:-}" == cpu ] ; then
# use pip to install pytorch as conda can frequently pick older release
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
else
pip3 install torch torchvision torchaudio
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
fi

printf "Installing functorch\n"
Expand All @@ -51,7 +52,7 @@ printf "* Installing torchrl\n"
printf "g++ version: "
gcc --version

python setup.py install
pip install -e .

if [[ $OSTYPE == 'darwin'* ]]; then
PRIVATE_MUJOCO_GL=glfw
Expand Down
9 changes: 0 additions & 9 deletions .circleci/unittest/linux_stable/scripts/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ lib_dir="${env_dir}/lib"

# solves ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$lib_dir
#if [[ $OSTYPE == 'darwin'* ]]; then
# PRIVATE_MUJOCO_GL=glfw
#else
# PRIVATE_MUJOCO_GL=egl
#fi
## pygame.error: No available video device
#export SDL_VIDEODRIVER=dummy
## solves AttributeError: 'NoneType' object has no attribute 'eglQueryString'
#export MUJOCO_GL=$PRIVATE_MUJOCO_GL

pytest test/smoke_test.py -v --durations 20
pytest test/smoke_test_deps.py -v --durations 20
Expand Down
5 changes: 0 additions & 5 deletions .circleci/unittest/linux_stable/scripts/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,4 @@ printf "* Installing dependencies (except PyTorch)\n"
echo " - python=${PYTHON_VERSION}" >> "${this_dir}/environment.yml"
cat "${this_dir}/environment.yml"

#conda install -y -c conda-forge glfw
#conda install -y -c conda-forge mesa
##conda install -y -c menpo osmesa
#conda install -y -c conda-forge glew

conda env update --file "${this_dir}/environment.yml" --prune
12 changes: 6 additions & 6 deletions build_tools/setup_helpers/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ def _get_build(var, default=False):
False if platform.system() == "Windows" else _get_build("BUILD_KALDI", True)
)
_BUILD_RNNT = _get_build("BUILD_RNNT", True)
_USE_ROCM = _get_build(
"USE_ROCM", torch.cuda.is_available() and torch.version.hip is not None
)
_USE_CUDA = _get_build(
"USE_CUDA", torch.cuda.is_available() and torch.version.hip is None
)
_USE_ROCM = False # _get_build(
# "USE_ROCM", torch.cuda.is_available() and torch.version.hip is not None
# )
_USE_CUDA = False # _get_build(
# "USE_CUDA", torch.cuda.is_available() and torch.version.hip is None
# )
_USE_OPENMP = (
_get_build("USE_OPENMP", True)
and "ATen parallel backend: OpenMP" in torch.__config__.parallel_info()
Expand Down
Loading