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

Update dockerfile #39

Merged
merged 2 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion deepray/core/base_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def __init__(
self.global_batch_size *= get_world_size()
learning_rate *= get_world_size()

# TODO: fuhailin
# TODO: fuhailin
# if isinstance(optimizer, optimizers.Optimizer):
self.optimizer = optimizer
# else:
Expand Down
10 changes: 6 additions & 4 deletions tools/build_base_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ set -x -e

PY_VERSION=${1:-"3.8"}
TF_VERSION=${2:-"2.9.3"}
CUDA_VERSION=${3:-"11.6.2"}

docker build \
-f tools/docker/base_container.Dockerfile \
--build-arg TF_VERSION=2.9.3 \
--build-arg TF_PACKAGE=tensorflow \
--build-arg PY_VERSION=$PY_VERSION \
--build-arg CUDA_VERSION=${CUDA_VERSION} \
--build-arg TF_VERSION=${TF_VERSION} \
--build-arg TF_PACKAGE=tensorflow-gpu \
--build-arg PY_VERSION=${PY_VERSION} \
--target base_container \
-t hailinfufu/deepray-release:latest-py${PY_VERSION}-tf${TF_VERSION}-cu116-ubuntu20.04 ./
-t hailinfufu/deepray-release:latest-py${PY_VERSION}-tf${TF_VERSION}-cu${CUDA_VERSION}-ubuntu20.04 ./
6 changes: 4 additions & 2 deletions tools/build_dev_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ set -x -e

PY_VERSION=${1:-"3.8"}
TF_VERSION=${2:-"2.9.3"}
CUDA_VERSION=${3:-"11.6.2"}

docker build \
-f tools/docker/dev_container.Dockerfile \
--build-arg TF_VERSION=2.9.3 \
--build-arg CUDA_VERSION=${CUDA_VERSION} \
--build-arg TF_VERSION=${TF_VERSION} \
--build-arg TF_PACKAGE=tensorflow \
--build-arg PY_VERSION=$PY_VERSION \
--target dev_container \
-t hailinfufu/deepray-dev:latest-py${PY_VERSION}-tf${TF_VERSION}-cu116-ubuntu20.04 ./
-t hailinfufu/deepray-dev:latest-py${PY_VERSION}-tf${TF_VERSION}-cu${CUDA_VERSION}-ubuntu20.04 ./
10 changes: 5 additions & 5 deletions tools/docker/base_container.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#syntax=docker/dockerfile:1.1.5-experimental
ARG IMAGE_TYPE

ARG CUDA_VERSION=11.6.2
# Currenly all of our dev images are GPU capable but at a cost of being quite large.
# See https://github.com/tensorflow/build/pull/47
ARG CUDA_DOCKER_VERSION=11.6.2-cudnn8-devel-ubuntu20.04
FROM nvidia/cuda:${CUDA_DOCKER_VERSION} as base_container
ARG TF_PACKAGE
FROM nvidia/cuda:${CUDA_VERSION}-cudnn8-devel-ubuntu20.04 as base_container
ARG TF_PACKAGE=tensorflow-gpu
ARG TF_VERSION=2.9.3
ARG PY_VERSION=3.8

Expand Down Expand Up @@ -41,6 +39,8 @@ RUN bash /install_deps/install_cmake.sh
RUN bash /install_deps/install_openmpi.sh

RUN pip install --default-timeout=1000 $TF_PACKAGE==$TF_VERSION
# RUN mkdir -p /usr/local/lib/python${PY_VERSION}/dist-packages/tensorflow/include/third_party/gpus/cuda && \
# ln -s /usr/local/cuda/include /usr/local/lib/python${PY_VERSION}/dist-packages/tensorflow/include/third_party/gpus/cuda

COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /install_deps/yapf.txt \
Expand Down
4 changes: 2 additions & 2 deletions tools/docker/dev_container.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#syntax=docker/dockerfile:1.1.5-experimental
ARG IMAGE_TYPE
ARG CUDA_VERSION=11.6.2
ARG TF_VERSION=2.9.3
ARG PY_VERSION=3.8

# Currenly all of our dev images are GPU capable but at a cost of being quite large.
# See https://github.com/tensorflow/build/pull/47
ARG CUDA_DOCKER_VERSION=latest-py${PY_VERSION}-tf${TF_VERSION}-cu116-ubuntu20.04
ARG CUDA_DOCKER_VERSION=latest-py${PY_VERSION}-tf${TF_VERSION}-cu${CUDA_VERSION}-ubuntu20.04
FROM hailinfufu/deepray-release:${CUDA_DOCKER_VERSION} as dev_container

COPY tools/install_deps /install_deps
Expand Down
Loading