|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | | -ARG CUDA_VERSION=11.1 |
| 15 | +ARG CUDA_VERSION=11.3.1 |
16 | 16 |
|
17 | 17 | FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu18.04 |
18 | 18 |
|
19 | | -ARG PYTHON_VERSION=3.8 |
20 | | -ARG PYTORCH_VERSION=1.6 |
21 | | -ARG CONDA_VERSION=4.9.2 |
| 19 | +ARG PYTHON_VERSION=3.9 |
| 20 | +ARG PYTORCH_VERSION=1.8 |
| 21 | +ARG CONDA_VERSION=4.11.0 |
22 | 22 |
|
23 | 23 | SHELL ["/bin/bash", "-c"] |
24 | 24 | # https://techoverflow.net/2019/05/18/how-to-fix-configuring-tzdata-interactive-input-when-building-docker-images/ |
@@ -68,14 +68,16 @@ COPY environment.yml environment.yml |
68 | 68 |
|
69 | 69 | # conda init |
70 | 70 | RUN conda update -n base -c defaults conda && \ |
71 | | - conda create -y --name $CONDA_ENV python=${PYTHON_VERSION} pytorch=${PYTORCH_VERSION} cudatoolkit=${CUDA_VERSION} -c nvidia -c pytorch -c pytorch-test -c pytorch-nightly && \ |
| 71 | + conda install mamba -n base -c conda-forge && \ |
| 72 | + mamba create -y --name $CONDA_ENV python=${PYTHON_VERSION} pytorch=${PYTORCH_VERSION} torchvision torchtext cudatoolkit=${CUDA_VERSION} -c nvidia -c pytorch -c pytorch-test -c pytorch-nightly && \ |
72 | 73 | conda init bash && \ |
73 | | - # NOTE: this requires that the channel is presented in the yaml before packages |
74 | | - python -c "import re ; fname = 'environment.yml' ; req = re.sub(r'- python[>=]+[\d\.]+', '# - python=${PYTHON_VERSION}', open(fname).read()) ; open(fname, 'w').write(req)" && \ |
75 | | - python -c "import re ; fname = 'environment.yml' ; req = re.sub(r'- pytorch[>=]+[\d\.]+', '# - pytorch=${PYTORCH_VERSION}', open(fname).read()) ; open(fname, 'w').write(req)" && \ |
| 74 | + # NOTE: this requires that the channel is presented in the yaml before packages \ |
| 75 | + printf "import re;\nfname = 'environment.yml';\nreq = open(fname).read();\nfor n in ['python', 'pytorch', 'torchtext', 'torchvision']:\n req = re.sub(rf'- {n}[>=]+', f'# - {n}=', req);\nopen(fname, 'w').write(req)" > prune.py && \ |
| 76 | + python prune.py && \ |
| 77 | + rm prune.py && \ |
76 | 78 | cat environment.yml && \ |
77 | | - conda env update --name $CONDA_ENV --file environment.yml && \ |
78 | | - conda clean -ya && \ |
| 79 | + mamba env update --name $CONDA_ENV --file environment.yml && \ |
| 80 | + mamba clean -ya && \ |
79 | 81 | rm environment.yml |
80 | 82 |
|
81 | 83 | ENV \ |
|
96 | 98 | python requirements_prune_packages.py requirements-extra.txt "horovod" && \ |
97 | 99 | python requirements_adjust_versions.py requirements-examples.txt && \ |
98 | 100 | # Install remaining requirements |
99 | | - pip install -r requirements-extra.txt --no-cache-dir && \ |
| 101 | + pip install -r requirements-extra.txt --no-cache-dir --find-links https://download.pytorch.org/whl/test/torch_test.html && \ |
100 | 102 | pip install -r requirements-examples.txt --no-cache-dir --find-links https://download.pytorch.org/whl/test/torch_test.html && \ |
101 | 103 | pip install -r requirements-test.txt --no-cache-dir |
102 | 104 |
|
|
0 commit comments