@@ -151,29 +151,42 @@ INFINITYHUB_PYTORCH_HPC_REPO := pytorch-infinityhub-hpc-dev
151151# build hpc together since hpc is dependent on the normal build
152152.PHONY : build-pytorch-ngc
153153build-pytorch-ngc :
154- docker build -f Dockerfile-pytorch-ngc \
154+ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
155+ docker buildx create --name builder --driver docker-container --use
156+ docker buildx build -f Dockerfile-pytorch-ngc \
157+ --platform " $( PLATFORMS) " \
155158 --build-arg BASE_IMAGE=" $( NGC_PYTORCH_PREFIX) :$( NGC_PYTORCH_VERSION) " \
156159 -t $(DOCKERHUB_REGISTRY ) /$(NGC_PYTORCH_REPO ) :$(SHORT_GIT_HASH ) \
160+ --push \
157161 .
158- docker build -f Dockerfile-ngc-hpc \
159- --build-arg BASE_IMAGE=" $( DOCKERHUB_REGISTRY) /$( NGC_PYTORCH_REPO) :$( SHORT_GIT_HASH) " \
160- -t $(DOCKERHUB_REGISTRY ) /$(NGC_PYTORCH_HPC_REPO ) :$(SHORT_GIT_HASH ) \
161- .
162- docker run --rm -v ` pwd` /tests:/workspace/tests -it $(DOCKERHUB_REGISTRY ) /$(NGC_PYTORCH_REPO ) :$(SHORT_GIT_HASH ) /bin/bash -c " pip install pytest && pytest -m \" pytorch or deepspeed\" /workspace/tests"
163- docker run --rm -v ` pwd` /tests:/workspace/tests -it $(DOCKERHUB_REGISTRY ) /$(NGC_PYTORCH_HPC_REPO ) :$(SHORT_GIT_HASH ) /bin/bash -c " pip install pytest && pytest -m \" pytorch or deepspeed\" /workspace/tests"
162+
163+ # docker build -f Dockerfile-ngc-hpc \
164+ # --build-arg BASE_IMAGE="$(DOCKERHUB_REGISTRY)/$(NGC_PYTORCH_REPO):$(SHORT_GIT_HASH)" \
165+ # -t $(DOCKERHUB_REGISTRY)/$(NGC_PYTORCH_HPC_REPO):$(SHORT_GIT_HASH) \
166+ # .
167+ # docker run --rm -v `pwd`/tests:/workspace/tests -it $(DOCKERHUB_REGISTRY)/$(NGC_PYTORCH_REPO):$(SHORT_GIT_HASH) /bin/bash -c "pip install pytest && pytest -m \"pytorch or deepspeed\" /workspace/tests"
168+ # docker run --rm -v `pwd`/tests:/workspace/tests -it $(DOCKERHUB_REGISTRY)/$(NGC_PYTORCH_HPC_REPO):$(SHORT_GIT_HASH) /bin/bash -c "pip install pytest && pytest -m \"pytorch or deepspeed\" /workspace/tests"
164169
165170.PHONY : build-tensorflow-ngc
166171build-tensorflow-ngc :
167- docker build -f Dockerfile-tensorflow-ngc \
172+ # Binding QEMU to docker allows emulating other architectures.
173+ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
174+ # The docker-container driver supports using QEMU (user mode) to build non-native platforms.
175+ # The Docker container driver allows creation of a managed and customizable BuildKit environment in a dedicated Docker container.
176+ docker buildx create --name builder --driver docker-container --use
177+ docker buildx build -f Dockerfile-tensorflow-ngc \
178+ --platform " $( PLATFORMS) " \
168179 --build-arg BASE_IMAGE=" $( NGC_TENSORFLOW_PREFIX) :$( NGC_TENSORFLOW_VERSION) " \
169180 -t $(DOCKERHUB_REGISTRY ) /$(NGC_TF_REPO ) :$(SHORT_GIT_HASH ) \
181+ --push \
170182 .
171- docker build -f Dockerfile-ngc-hpc \
172- --build-arg BASE_IMAGE=" $( DOCKERHUB_REGISTRY) /$( NGC_TF_REPO) :$( SHORT_GIT_HASH) " \
173- -t $(DOCKERHUB_REGISTRY ) /$(NGC_TF_HPC_REPO ) :$(SHORT_GIT_HASH ) \
174- .
175- docker run --rm -v ` pwd` /tests:/workspace/tests -it $(DOCKERHUB_REGISTRY ) /$(NGC_TF_REPO ) :$(SHORT_GIT_HASH ) /bin/bash -c " pip install pytest && pytest -m tensorflow /workspace/tests"
176- docker run --rm -v ` pwd` /tests:/workspace/tests -it $(DOCKERHUB_REGISTRY ) /$(NGC_TF_HPC_REPO ) :$(SHORT_GIT_HASH ) /bin/bash -c " pip install pytest && pytest -m tensorflow /workspace/tests"
183+ # docker build -f Dockerfile-ngc-hpc \
184+ # --build-arg BASE_IMAGE="$(DOCKERHUB_REGISTRY)/$(NGC_TF_REPO):$(SHORT_GIT_HASH)" \
185+ # -t $(DOCKERHUB_REGISTRY)/$(NGC_TF_HPC_REPO):$(SHORT_GIT_HASH) \
186+ # .
187+ # docker run --rm -v `pwd`/tests:/workspace/tests -it $(DOCKERHUB_REGISTRY)/$(NGC_TF_REPO):$(SHORT_GIT_HASH) /bin/bash -c "pip install pytest && pytest -m tensorflow /workspace/tests"
188+ # docker run --rm -v `pwd`/tests:/workspace/tests -it $(DOCKERHUB_REGISTRY)/$(NGC_TF_HPC_REPO):$(SHORT_GIT_HASH) /bin/bash -c "pip install pytest && pytest -m tensorflow /workspace/tests"
189+
177190
178191ifeq ($(WITH_MPICH ) ,1)
179192ROCM56_TORCH13_MPI :=pytorch-1.3-tf-2.10-rocm-mpich
0 commit comments