Skip to content

Commit

Permalink
Merge pull request #39 from deepray-AI/dev_hailin
Browse files Browse the repository at this point in the history
Update dockerfile
  • Loading branch information
fuhailin authored Nov 19, 2023
2 parents 953c397 + c1762cc commit df4b933
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
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

0 comments on commit df4b933

Please sign in to comment.