-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding testing statements * adding scripts to run model with pytorch2.0 * small fixes and adding licence * dino model change to support pytorch 2.0 * dino model change to support pytorch 2.0 * small fix * refactoring * refactoring * refactoring * small fix * small fix * adding comments * fixing comments * fixing comments * fixing comments * removing python version * removing python version * removing python version
- Loading branch information
Showing
16 changed files
with
280 additions
and
69 deletions.
There are no files selected for viewing
14 changes: 0 additions & 14 deletions
14
perfmetrics/scripts/continuous_test/ml_tests/pytorch/dino/build.sh
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
perfmetrics/scripts/continuous_test/ml_tests/pytorch/dino/continuous.cfg
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
perfmetrics/scripts/continuous_test/ml_tests/pytorch/v1_12/dino/build.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
# Copyright 2023 Google Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This will stop execution when any command will have non-zero status. | ||
set -e | ||
|
||
VM_NAME="pytorch-dino-7d" | ||
ZONE_NAME="us-west1-b" | ||
ARTIFACTS_BUCKET_PATH="gs://gcsfuse-ml-tests-logs/ci_artifacts/pytorch/v1_12/dino" | ||
TEST_SCRIPT_PATH="github/gcsfuse/perfmetrics/scripts/ml_tests/pytorch/v1_12/dino/setup_host_and_run_container.sh" | ||
PYTORCH_VERSION="v1_12" | ||
|
||
cd "${KOKORO_ARTIFACTS_DIR}/github/gcsfuse/perfmetrics/scripts/continuous_test/ml_tests/" | ||
|
||
source run_and_manage_test.sh $VM_NAME $ZONE_NAME $ARTIFACTS_BUCKET_PATH $TEST_SCRIPT_PATH $PYTORCH_VERSION |
18 changes: 18 additions & 0 deletions
18
perfmetrics/scripts/continuous_test/ml_tests/pytorch/v1_12/dino/continuous.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2023 Google Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
build_file: "gcsfuse/perfmetrics/scripts/continuous_test/ml_tests/pytorch/v1_12/dino/build.sh" | ||
|
||
# 2 hours timeout. | ||
timeout_mins: 60 |
27 changes: 27 additions & 0 deletions
27
perfmetrics/scripts/continuous_test/ml_tests/pytorch/v2/dino/build.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
# Copyright 2023 Google Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This will stop execution when any command will have non-zero status. | ||
set -e | ||
|
||
VM_NAME="pytorch2-dino-7d" | ||
ZONE_NAME="us-west1-a" | ||
ARTIFACTS_BUCKET_PATH="gs://gcsfuse-ml-tests-logs/ci_artifacts/pytorch/v2/dino" | ||
TEST_SCRIPT_PATH="github/gcsfuse/perfmetrics/scripts/ml_tests/pytorch/v2/dino/setup_host_and_run_container.sh" | ||
PYTORCH_VERSION="v2" | ||
|
||
cd "${KOKORO_ARTIFACTS_DIR}/github/gcsfuse/perfmetrics/scripts/continuous_test/ml_tests/" | ||
|
||
source run_and_manage_test.sh $VM_NAME $ZONE_NAME $ARTIFACTS_BUCKET_PATH $TEST_SCRIPT_PATH $PYTORCH_VERSION |
18 changes: 18 additions & 0 deletions
18
perfmetrics/scripts/continuous_test/ml_tests/pytorch/v2/dino/continuous.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2023 Google Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
build_file: "gcsfuse/perfmetrics/scripts/continuous_test/ml_tests/pytorch/v2/dino/build.sh" | ||
|
||
# 2 hours timeout. | ||
timeout_mins: 60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
perfmetrics/scripts/ml_tests/pytorch/dino/setup_host_and_run_model.sh
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
# Copyright 2023 Google Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
set -e | ||
# pytorch version (e.g. v1_12, v2) | ||
PYTORCH_VESRION=$1 | ||
cd "$HOME/github/gcsfuse" | ||
echo "Building docker image containing all pytorch libraries..." | ||
sudo docker build . -f perfmetrics/scripts/ml_tests/pytorch/${PYTORCH_VESRION}/dino/Dockerfile --tag pytorch-gcsfuse | ||
|
||
mkdir -p container_artifacts | ||
|
||
echo "Running the docker image build in the previous step..." | ||
sudo docker run --gpus all --name=pytorch_automation_container --privileged -d -v $HOME/github/gcsfuse/container_artifacts:/pytorch_dino/run_artifacts:rw,rshared \ | ||
--shm-size=128g pytorch-gcsfuse:latest | ||
|
||
# Setup the log_rotation. | ||
source perfmetrics/scripts/ml_tests/setup_log_rotation.sh $HOME/github/gcsfuse/container_artifacts/gcsfuse.log | ||
|
||
# Wait for the script completion as well as logs output. | ||
sudo docker logs -f pytorch_automation_container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
perfmetrics/scripts/ml_tests/pytorch/v1_12/dino/setup_host_and_run_container.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
# Copyright 2023 Google Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This will stop execution when any command will have non-zero status. | ||
set -e | ||
|
||
cd "$HOME/github/gcsfuse/perfmetrics/scripts" | ||
|
||
echo "Setting up the machine with Docker and Nvidia Driver" | ||
# Driver version for A100 GPUs is 450.172.01 | ||
DRIVER_VERSION="450.172.01" | ||
source ml_tests/setup_host.sh $DRIVER_VERSION | ||
|
||
PYTORCH_VERSION="v1_12" | ||
source ml_tests/pytorch/run_container.sh $PYTORCH_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright 2023 Google Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Image with gcsfuse installed and its package (.deb) | ||
FROM gcr.io/deeplearning-platform-release/pytorch-gpu.2-0.py310 | ||
|
||
# Allow non-root users to specify the allow_other or allow_root mount options | ||
RUN echo "user_allow_other" > /etc/fuse.conf | ||
|
||
RUN pip3 install timm | ||
|
||
WORKDIR "/pytorch_dino/" | ||
|
||
RUN git clone "https://github.com/facebookresearch/dino" | ||
# (TulsiShah) TODO: The current docker image does not support the dino model with compile mode. | ||
# We can unblock the below code whenever the docker image supports the same to run. | ||
|
||
# WORKDIR "/pytorch_dino/dino" | ||
# RUN echo '[remote "origin"]' >> .git/config | ||
# RUN echo ' fetch = +refs/pull/262/head:refs/remotes/origin/pr/262' >> .git/config | ||
# | ||
# RUN git fetch origin | ||
# RUN git diff origin/main origin/pr/262 > diff.patch | ||
# RUN git apply diff.patch | ||
# | ||
# WORKDIR "/pytorch_dino/" | ||
|
||
COPY perfmetrics/scripts/ml_tests/pytorch/run_model.sh ./ | ||
|
||
RUN mkdir -p "run_artifacts" | ||
RUN mkdir -p "gcsfuse_data" | ||
|
||
ENV PYTORCH_VERSION="v2" | ||
|
||
ENTRYPOINT ["/bin/bash", "-c", "./run_model.sh ${PYTORCH_VERSION}"] |
Oops, something went wrong.