From 4a843a214e1cc608ffa9453e3582b4b161f64b68 Mon Sep 17 00:00:00 2001 From: Angel Luu Date: Fri, 13 Sep 2024 13:46:58 -0600 Subject: [PATCH 1/6] Need dev deps and eval scripts Signed-off-by: Angel Luu --- build/Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/Dockerfile b/build/Dockerfile index ffae818da..38816a2e8 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -22,6 +22,7 @@ ARG WHEEL_VERSION="" ## Enable Aimstack if requested via ENABLE_AIM set to "true" ARG ENABLE_AIM=false ARG ENABLE_FMS_ACCELERATION=true +ARG ENABLE_DEV=false ## Base Layer ################################################################## FROM registry.access.redhat.com/ubi9/ubi:${BASE_UBI_IMAGE_TAG} AS base @@ -110,6 +111,7 @@ ARG USER ARG USER_UID ARG ENABLE_FMS_ACCELERATION ARG ENABLE_AIM +ARG ENABLE_DEV RUN dnf install -y git && \ # perl-Net-SSLeay.x86_64 and server_key.pem are installed with git as dependencies @@ -146,6 +148,10 @@ RUN if [[ "${ENABLE_AIM}" == "true" ]]; then \ python -m pip install --user "$(head bdist_name)[aim]"; \ fi +RUN if [[ "${ENABLE_DEV}" == "true" ]]; then \ + python -m pip install --user "$(head bdist_name)[dev] $(head bdist_name)[gptq-dev]"; \ +fi + # Clean up the wheel module. It's only needed by flash-attn install RUN python -m pip uninstall wheel build -y && \ # Cleanup the bdist whl file @@ -156,6 +162,7 @@ FROM release-base AS release ARG USER ARG PYTHON_VERSION ARG ENABLE_AIM +ARG ENABLE_DEV RUN mkdir -p /licenses COPY LICENSE /licenses/ @@ -177,6 +184,10 @@ COPY build/accelerate_launch.py fixtures/accelerate_fsdp_defaults.yaml /app/ COPY build/utils.py /app/build/ RUN chmod +x /app/accelerate_launch.py +RUN if [[ "${ENABLE_DEV}" == "true" ]] ; then \ + COPY scripts/run_evaluation.py scripts/run_inference.py /app/eval_scripts/ \ + fi + ENV FSDP_DEFAULTS_FILE_PATH="/app/accelerate_fsdp_defaults.yaml" ENV SET_NUM_PROCESSES_TO_NUM_GPUS="True" From 51e1abd976b81741fff80a74e2bd1d23a72f3b98 Mon Sep 17 00:00:00 2001 From: Angel Luu Date: Fri, 13 Sep 2024 14:05:16 -0600 Subject: [PATCH 2/6] Use cp command Signed-off-by: Angel Luu --- build/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/Dockerfile b/build/Dockerfile index 38816a2e8..e5cdc1f8f 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -185,7 +185,8 @@ COPY build/utils.py /app/build/ RUN chmod +x /app/accelerate_launch.py RUN if [[ "${ENABLE_DEV}" == "true" ]] ; then \ - COPY scripts/run_evaluation.py scripts/run_inference.py /app/eval_scripts/ \ + cp scripts/run_evaluation.py /app/ && \ + cp scripts/run_inference.py /app/ \ fi ENV FSDP_DEFAULTS_FILE_PATH="/app/accelerate_fsdp_defaults.yaml" From bde881d9eae41ec225d4553b74c0908280cd2bd4 Mon Sep 17 00:00:00 2001 From: Angel Luu Date: Fri, 13 Sep 2024 14:09:45 -0600 Subject: [PATCH 3/6] Fix syntax Signed-off-by: Angel Luu --- build/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index e5cdc1f8f..722cd581b 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -185,8 +185,8 @@ COPY build/utils.py /app/build/ RUN chmod +x /app/accelerate_launch.py RUN if [[ "${ENABLE_DEV}" == "true" ]] ; then \ - cp scripts/run_evaluation.py /app/ && \ - cp scripts/run_inference.py /app/ \ + cp scripts/run_evaluation.py /app/; \ + cp scripts/run_inference.py /app/; \ fi ENV FSDP_DEFAULTS_FILE_PATH="/app/accelerate_fsdp_defaults.yaml" From a24a2252b4554f86b500d8a5c64dde916800ea2e Mon Sep 17 00:00:00 2001 From: Angel Luu Date: Fri, 13 Sep 2024 15:00:17 -0600 Subject: [PATCH 4/6] Add hack Signed-off-by: Angel Luu --- build/Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 722cd581b..81b6ad7ef 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -150,6 +150,8 @@ RUN if [[ "${ENABLE_AIM}" == "true" ]]; then \ RUN if [[ "${ENABLE_DEV}" == "true" ]]; then \ python -m pip install --user "$(head bdist_name)[dev] $(head bdist_name)[gptq-dev]"; \ + cp scripts/run_evaluation.py /tmp; \ + cp scripts/run_inference.py /tmp; \ fi # Clean up the wheel module. It's only needed by flash-attn install @@ -162,7 +164,8 @@ FROM release-base AS release ARG USER ARG PYTHON_VERSION ARG ENABLE_AIM -ARG ENABLE_DEV +ARG EVAL_SCRIPT_PATH= +ARG INF_SCRIPT_PATH= RUN mkdir -p /licenses COPY LICENSE /licenses/ @@ -184,10 +187,10 @@ COPY build/accelerate_launch.py fixtures/accelerate_fsdp_defaults.yaml /app/ COPY build/utils.py /app/build/ RUN chmod +x /app/accelerate_launch.py -RUN if [[ "${ENABLE_DEV}" == "true" ]] ; then \ - cp scripts/run_evaluation.py /app/; \ - cp scripts/run_inference.py /app/; \ - fi +# Hack to get the dev scripts copied in only when they are set +# When these vars are not set, copy doesn't happen +COPY ${EVAL_SCRIPT_PATH} /app/ +COPY ${INF_SCRIPT_PATH} /app/ ENV FSDP_DEFAULTS_FILE_PATH="/app/accelerate_fsdp_defaults.yaml" ENV SET_NUM_PROCESSES_TO_NUM_GPUS="True" From 5d6bdb52592b7660e7b06a8f746647c2c45e1a3a Mon Sep 17 00:00:00 2001 From: Angel Luu Date: Fri, 13 Sep 2024 15:11:49 -0600 Subject: [PATCH 5/6] Use temp [dev] only Signed-off-by: Angel Luu --- build/Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 81b6ad7ef..2ee03d65b 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -149,10 +149,9 @@ RUN if [[ "${ENABLE_AIM}" == "true" ]]; then \ fi RUN if [[ "${ENABLE_DEV}" == "true" ]]; then \ - python -m pip install --user "$(head bdist_name)[dev] $(head bdist_name)[gptq-dev]"; \ - cp scripts/run_evaluation.py /tmp; \ - cp scripts/run_inference.py /tmp; \ -fi + python -m pip install --user "$(head bdist_name)[dev]; \ + # python -m pip install --user "$(head bdist_name)[dev] $(head bdist_name)[gptq-dev]"; \ + fi # Clean up the wheel module. It's only needed by flash-attn install RUN python -m pip uninstall wheel build -y && \ From e0aa3ac456a6a03ee46eb1f268ed74f8221fd695 Mon Sep 17 00:00:00 2001 From: Angel Luu Date: Fri, 13 Sep 2024 15:21:36 -0600 Subject: [PATCH 6/6] Use temp [dev] only Signed-off-by: Angel Luu --- build/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Dockerfile b/build/Dockerfile index 2ee03d65b..56647cf99 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -149,7 +149,7 @@ RUN if [[ "${ENABLE_AIM}" == "true" ]]; then \ fi RUN if [[ "${ENABLE_DEV}" == "true" ]]; then \ - python -m pip install --user "$(head bdist_name)[dev]; \ + python -m pip install --user "$(head bdist_name)[dev]"; \ # python -m pip install --user "$(head bdist_name)[dev] $(head bdist_name)[gptq-dev]"; \ fi