Skip to content

Commit 8cf8040

Browse files
authored
Dev/finishing (#174)
* Reformat according to the new rules. * `git` now uses 8 or fewer jobs for cloning PyTorch and TorchVision. This was necessary as newer versions of `git` no longer have the `--jobs 0` option. * Add `deepspeed` as a dependency. * Remove the `threads` flag as it cannot automatically detect the number of architectures.
1 parent 97b8768 commit 8cf8040

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,10 @@ FROM ${GIT_IMAGE} AS clone-torch
178178
ARG PYTORCH_VERSION_TAG
179179
ARG TORCH_URL=https://github.com/pytorch/pytorch.git
180180
# Minimize downloads by only cloning shallow branches and not the full `git` history.
181-
RUN git clone --jobs 0 --depth 1 --single-branch --shallow-submodules \
182-
--recurse-submodules --branch ${PYTORCH_VERSION_TAG} \
183-
${TORCH_URL} /opt/pytorch
181+
# Use at most 8 jobs for cloning the repository and its submodules.
182+
RUN git clone --jobs $(( 8 < $(nproc) ? 8: $(nproc) )) --depth 1 \
183+
--single-branch --shallow-submodules --recurse-submodules \
184+
--branch ${PYTORCH_VERSION_TAG} ${TORCH_URL} /opt/pytorch
184185

185186
########################################################################
186187
FROM build-base AS build-torch
@@ -211,9 +212,8 @@ ARG BUILD_CAFFE2
211212
ARG BUILD_CAFFE2_OPS
212213
ARG USE_PRECOMPILED_HEADERS
213214
ARG TORCH_CUDA_ARCH_LIST
214-
# ARG CMAKE_PREFIX_PATH=/opt/conda -> Less portable binary.
215-
# The `--threads` option is only available for CUDA 11.2+.
216-
ARG TORCH_NVCC_FLAGS="-Xfatbin -compress-all --threads"
215+
#ARG CMAKE_PREFIX_PATH=/opt/conda -> Less portable binary.
216+
ARG TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
217217
# Build wheel for installation in later stages.
218218
# Install PyTorch for subsidiary libraries (e.g., TorchVision).
219219
RUN --mount=type=cache,target=/opt/ccache \
@@ -282,9 +282,9 @@ FROM ${GIT_IMAGE} AS clone-vision
282282

283283
ARG TORCHVISION_VERSION_TAG
284284
ARG VISION_URL=https://github.com/pytorch/vision.git
285-
RUN git clone --jobs 0 --depth 1 --single-branch --shallow-submodules \
286-
--recurse-submodules --branch ${TORCHVISION_VERSION_TAG} \
287-
${VISION_URL} /opt/vision
285+
RUN git clone --jobs $(( 8 < $(nproc) ? 8: $(nproc) )) --depth 1 \
286+
--single-branch --shallow-submodules --recurse-submodules \
287+
--branch ${TORCHVISION_VERSION_TAG} ${VISION_URL} /opt/vision
288288

289289
########################################################################
290290
FROM build-torch AS build-vision

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ If this is your first time using this project, follow these steps:
4444
Cresset has been tested on Windows 11 WSL2 with the Windows CUDA driver
4545
using Docker Desktop for Windows. There is no need to install a separate
4646
WSL CUDA driver or Docker for Linux inside WSL.
47-
Note that only Docker Desktop is under a commercial EULA and Docker Engine
47+
Note that only Docker Desktop is under a commercial EULA and Docker Engine
4848
(for Linux) and Lima Docker (for Mac) are still both open-source.
4949
_N.B._ Windows Security real-time protection causes significant slowdown if enabled.
5050
Disable any active antivirus programs on Windows for best performance.
@@ -442,8 +442,8 @@ See tutorials for [Docker](https://www.jetbrains.com/help/pycharm/docker.html) a
442442
for details. JetBrains [Gateway](https://www.jetbrains.com/remote-development/gateway)
443443
can also be used to connect to running containers.
444444

445-
When using the `ngc` service, add `/usr/local/lib/python3/dist-packages` and
446-
`/opt/conda/lib/python3/site-packages` to the interpreter search paths via
445+
When using the `ngc` service, add `/usr/local/lib/python3/dist-packages` and
446+
`/opt/conda/lib/python3/site-packages` to the interpreter search paths via
447447
the GUI to enable code assistance on the packages installed with `conda`.
448448

449449
_N.B._ PyCharm Professional and other JetBrains IDEs are available

reqs/simple-environment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ dependencies: # Use conda packages if possible.
1919
- pytest
2020
- tmux==3.2a
2121
- tqdm
22+
- pip
23+
- pip:
24+
- deepspeed
25+
- pyre-check

reqs/train-environment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ dependencies: # Use conda packages if possible.
6060
# Source compiled packages are installed via pip.
6161
- pip
6262
- pip:
63+
- deepspeed
6364
- pyre-check

0 commit comments

Comments
 (0)