From cf6e66e2116e4b01dd91c9e56d0822bdd87fe130 Mon Sep 17 00:00:00 2001 From: Alvaro Moran Date: Mon, 13 Jan 2025 11:18:36 +0000 Subject: [PATCH 1/4] feat(tpu): updated to optimum 0.2.3, added llama training example --- .../training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile b/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile index dcfd60f9..15313f94 100644 --- a/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile +++ b/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile @@ -6,7 +6,7 @@ LABEL maintainer="Hugging Face" ARG DEBIAN_FRONTEND=noninteractive # Versions -ARG OPTIMUM_TPU='0.2.2' +ARG OPTIMUM_TPU='0.2.3' ARG TRANSFORMERS='4.46.3' ARG PEFT='0.13.2' ARG TRL='0.12.1' @@ -31,9 +31,11 @@ RUN pip install --upgrade --no-cache-dir \ # Install Optimum TPU RUN pip install git+https://github.com/huggingface/optimum-tpu.git@v${OPTIMUM_TPU} -# Add example +# Add examples ADD https://raw.githubusercontent.com/huggingface/optimum-tpu/v${OPTIMUM_TPU}/examples/language-modeling/gemma_tuning.ipynb \ /notebooks/gemma_tuning.ipynb +ADD https://raw.githubusercontent.com/huggingface/optimum-tpu/v${OPTIMUM_TPU}/examples/language-modeling/gemma_tuning.ipynb \ + /notebooks/llama_tuning.ipynb # Install Google CLI single command RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \ From f62eb0c86e831038d898b0993b3b1408c3bb19de Mon Sep 17 00:00:00 2001 From: Alvaro Moran Date: Mon, 13 Jan 2025 11:49:37 +0000 Subject: [PATCH 2/4] fix: correct notebook filename for llama --- .../training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile b/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile index 15313f94..e33b766f 100644 --- a/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile +++ b/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile @@ -34,7 +34,7 @@ RUN pip install git+https://github.com/huggingface/optimum-tpu.git@v${OPTIMUM_TP # Add examples ADD https://raw.githubusercontent.com/huggingface/optimum-tpu/v${OPTIMUM_TPU}/examples/language-modeling/gemma_tuning.ipynb \ /notebooks/gemma_tuning.ipynb -ADD https://raw.githubusercontent.com/huggingface/optimum-tpu/v${OPTIMUM_TPU}/examples/language-modeling/gemma_tuning.ipynb \ +ADD https://raw.githubusercontent.com/huggingface/optimum-tpu/v${OPTIMUM_TPU}/examples/language-modeling/llama_tuning.ipynb \ /notebooks/llama_tuning.ipynb # Install Google CLI single command From 0a4dcbd04cd23f0eb3f8efdfe3402d3b2d71fa96 Mon Sep 17 00:00:00 2001 From: Alvaro Moran Date: Wed, 15 Jan 2025 09:00:56 +0000 Subject: [PATCH 3/4] chore: remove training examples from tpu container --- .../training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile b/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile index e33b766f..5b6ccbeb 100644 --- a/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile +++ b/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile @@ -31,11 +31,6 @@ RUN pip install --upgrade --no-cache-dir \ # Install Optimum TPU RUN pip install git+https://github.com/huggingface/optimum-tpu.git@v${OPTIMUM_TPU} -# Add examples -ADD https://raw.githubusercontent.com/huggingface/optimum-tpu/v${OPTIMUM_TPU}/examples/language-modeling/gemma_tuning.ipynb \ - /notebooks/gemma_tuning.ipynb -ADD https://raw.githubusercontent.com/huggingface/optimum-tpu/v${OPTIMUM_TPU}/examples/language-modeling/llama_tuning.ipynb \ - /notebooks/llama_tuning.ipynb # Install Google CLI single command RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \ From 505ad5a3e8ee7e0d413b69cdc2d0f12cb2eff53b Mon Sep 17 00:00:00 2001 From: Alvaro Moran Date: Wed, 15 Jan 2025 09:09:45 +0000 Subject: [PATCH 4/4] chore: install optimum-tpu from pypi instead of git --- .../training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile b/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile index 5b6ccbeb..e775e390 100644 --- a/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile +++ b/containers/pytorch/training/tpu/2.5.1/transformers/4.46.3/py310/Dockerfile @@ -30,7 +30,7 @@ RUN pip install --upgrade --no-cache-dir \ jupyter notebook # Install Optimum TPU -RUN pip install git+https://github.com/huggingface/optimum-tpu.git@v${OPTIMUM_TPU} +RUN pip install --upgrade --no-cache-dir optimum-tpu==${OPTIMUM_TPU} # Install Google CLI single command RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \