Skip to content

Commit bc032b3

Browse files
Merge pull request #3378 from AI-Hypercomputer:cleanup_post_training_source
PiperOrigin-RevId: 882705751
2 parents c0b15ef + c4c4154 commit bc032b3

3 files changed

Lines changed: 3 additions & 50 deletions

File tree

.github/workflows/UploadDockerImages.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,32 +79,18 @@ jobs:
7979
maxtext_sha: ${{ needs.setup.outputs.maxtext_sha }}
8080
image_date: ${{ needs.setup.outputs.image_date }}
8181

82-
tpu-post-training-stable:
83-
name: tpu-post-training-stable
84-
needs: setup
85-
uses: ./.github/workflows/build_and_push_docker_image.yml
86-
with:
87-
image_name: maxtext_post_training_stable
88-
device: tpu
89-
build_mode: stable
90-
workflow: post-training
91-
dockerfile: ./src/dependencies/dockerfiles/maxtext_tpu_dependencies.Dockerfile
92-
maxtext_sha: ${{ needs.setup.outputs.maxtext_sha }}
93-
image_date: ${{ needs.setup.outputs.image_date }}
94-
9582
tpu-post-training-nightly:
9683
name: tpu-post-training-nightly
97-
needs: [setup, tpu-post-training-stable]
84+
needs: [setup]
9885
uses: ./.github/workflows/build_and_push_docker_image.yml
9986
with:
10087
image_name: maxtext_post_training_nightly
10188
device: tpu
10289
build_mode: nightly
10390
workflow: post-training
104-
dockerfile: ./src/dependencies/dockerfiles/maxtext_post_training_local_dependencies.Dockerfile
91+
dockerfile: ./src/dependencies/dockerfiles/maxtext_tpu_dependencies.Dockerfile
10592
maxtext_sha: ${{ needs.setup.outputs.maxtext_sha }}
10693
image_date: ${{ needs.setup.outputs.image_date }}
107-
base_image: gcr.io/tpu-prod-env-multipod/maxtext_post_training_stable:${{ needs.setup.outputs.image_date }}
10894

10995
gpu-pre-training:
11096
name: ${{ matrix.image_name }}

.github/workflows/build_and_push_docker_image.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ on:
3737
image_date:
3838
required: false
3939
type: string
40-
base_image:
41-
required: false
42-
type: string
43-
default: ''
4440
workflow:
4541
required: false
4642
type: string
@@ -129,7 +125,6 @@ jobs:
129125
JAX_VERSION=NONE
130126
LIBTPU_VERSION=NONE
131127
INCLUDE_TEST_ASSETS=true
132-
${{ inputs.base_image != '' && format('BASEIMAGE={0}', inputs.base_image) || '' }}
133128
134129
- name: Add tags to Docker image
135130
if: steps.check.outputs.should_run == 'true'

src/dependencies/scripts/docker_build_dependency_image.sh

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,9 @@
4646
# POST-TRAINING BUILD EXAMPLES
4747
# ==================================
4848

49-
# Build docker image with stable pre-training dependencies and stable post-training dependencies
49+
# Build docker image with post-training dependencies
5050
## bash src/dependencies/scripts/docker_build_dependency_image.sh WORKFLOW=post-training
5151

52-
# Build docker image with stable pre-training dependencies and post-training dependencies from GitHub head
53-
## bash src/dependencies/scripts/docker_build_dependency_image.sh WORKFLOW=post-training POST_TRAINING_SOURCE=local
54-
5552
if [ "${BASH_SOURCE-}" ]; then
5653
this_file="${BASH_SOURCE[0]}"
5754
elif [ "${ZSH_VERSION-}" ]; then
@@ -118,24 +115,6 @@ run_docker_build() {
118115
docker build --network host $(printf -- '--build-arg %q ' "$@") -f "$dockerfile_path" -t "$LOCAL_IMAGE_NAME" .
119116
}
120117

121-
# Function to build post-training dependencies from local Github head
122-
build_post_training_deps_from_local_github() {
123-
# To install vllm, tunix, tpu-inference from a local path, we copy it into the build context, excluding __pycache__.
124-
# This assumes vllm, tunix, tpu-inference is a sibling directory to the current one (maxtext).
125-
rsync -a --exclude='__pycache__' ../tpu-inference .
126-
rsync -a --exclude='__pycache__' ../vllm .
127-
rsync -a --exclude='__pycache__' ../tunix .
128-
129-
# The cleanup is set to run even if the build fails to remove the copied directory.
130-
trap "rm -rf ./tpu-inference ./vllm ./tunix" EXIT INT TERM
131-
132-
DOCKERFILE_NAME='maxtext_post_training_local_dependencies.Dockerfile'
133-
echo "Building local post-training dependencies: $DOCKERFILE_NAME"
134-
135-
run_docker_build "$MAXTEXT_REPO_ROOT/src/dependencies/dockerfiles/$DOCKERFILE_NAME" \
136-
"MODE=${WORKFLOW}" "BASEIMAGE=${LOCAL_IMAGE_NAME}"
137-
}
138-
139118
# Function to build image for GPUs
140119
build_gpu_image() {
141120
if [[ ${MODE} == "pinned" ]]; then
@@ -162,13 +141,6 @@ build_tpu_image() {
162141

163142
echo "Building docker image with arguments: ${docker_build_args[*]}"
164143
run_docker_build "$MAXTEXT_REPO_ROOT/src/dependencies/dockerfiles/maxtext_tpu_dependencies.Dockerfile" "${docker_build_args[@]}"
165-
166-
# Handle post-training workflow if specified
167-
if [[ ${WORKFLOW} == "post-training" || ${WORKFLOW} == "post-training-experimental" ]]; then
168-
if [[ ${POST_TRAINING_SOURCE} == "local" ]]; then
169-
build_post_training_deps_from_local_github
170-
fi
171-
fi
172144
}
173145

174146
if [[ ${DEVICE} == "gpu" ]]; then

0 commit comments

Comments
 (0)