This file contains hidden or 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
export IMAGE_FAMILY="pytorch-latest-gpu" | |
export ZONE="us-west1-b" | |
export INSTANCE_NAME="pytorch-and-fastai-test" | |
gcloud compute instances create $INSTANCE_NAME \ | |
--zone=$ZONE \ | |
--image-family=$IMAGE_FAMILY \ | |
--machine-type=n1-standard-8 \ | |
--image-project=deeplearning-platform-release \ | |
--maintenance-policy=TERMINATE \ | |
--accelerator="type=nvidia-tesla-p100,count=1" \ |
This file contains hidden or 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
export IMAGE_FAMILY="pytorch-latest-cpu" | |
export ZONE="us-west1-b" | |
export INSTANCE_NAME="pytorch-and-fastai-test" | |
gcloud compute instances create $INSTANCE_NAME \ | |
--zone=$ZONE \ | |
--image-family=$IMAGE_FAMILY \ | |
--machine-type=n1-standard-8 \ | |
--image-project=deeplearning-platform-release |
This file contains hidden or 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
export IMAGE_FAMILY="tf-latest-gpu" | |
export ZONE="us-west1-b" | |
export INSTANCE_NAME="model-prep" | |
gcloud compute instances create $INSTANCE_NAME \ | |
--zone=$ZONE \ | |
--image-family=$IMAGE_FAMILY \ | |
--machine-type=n1-standard-8 \ | |
--image-project=deeplearning-platform-release \ | |
--maintenance-policy=TERMINATE \ | |
--accelerator="type=nvidia-tesla-v100,count=1" \ |
This file contains hidden or 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
git clone https://github.com/tensorflow/models.git | |
cd models | |
git checkout f0e10716160cd048618ccdd4b6e18336223a172f | |
touch research/__init__.py | |
touch research/tensorrt/__init__.py | |
cp research/tensorrt/labellist.json . | |
cp research/tensorrt/image.jpg .. |
This file contains hidden or 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
# Archiving the model | |
tar -zcvf model.tar.gz ./resnet_v2_int8_NCHW/ | |
# And uloading | |
export GCS_PATH=<gcs_path> | |
gsutil cp model.tar.gz $GCS_PATH |
This file contains hidden or 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
python -m research.tensorrt.tensorrt --frozen_graph=$HOME/resnetv2_imagenet_frozen_graph.pb --image_file=$HOME/image.jpg --native --fp32 --fp16 --int8 --output_dir=$HOME |
This file contains hidden or 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
export INSTANCE_TEMPLATE_NAME="tf-inferance-template" | |
export IMAGE_FAMILY="tf-latest-gpu" | |
gcloud beta compute --project=deeplearning-platform instance-templates create $INSTANCE_TEMPLATE_NAME \ | |
--machine-type=n1-standard-8 \ | |
--maintenance-policy=TERMINATE \ | |
--accelerator=type=nvidia-tesla-v100,count=1 \ | |
--min-cpu-platform=Intel\ Skylake \ | |
--tags=http-server,https-server \ | |
--image-family=$IMAGE_FAMILY \ |
This file contains hidden or 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
#!/bin/bash | |
git clone https://github.com/b0noI/gcp-gpu-utilization-metrics.git | |
cd gcp-gpu-utilization-metrics | |
git checkout 6e62ea324bf097817474b51119786e8222dd9fdf | |
pip install -r ./requirenments.txt | |
cp ./report_gpu_metrics.py /root/report_gpu_metrics.py | |
cat <<-EOH > /lib/systemd/system/gpu_utilization_agent.service | |
[Unit] |
This file contains hidden or 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
export INSTANCE_GROUP_NAME="deeplearning-instance-group" | |
export INSTANCE_TEMPLATE_NAME="tf-inferance-template" | |
gcloud compute instance-groups managed create $INSTANCE_GROUP_NAME \ | |
--template $INSTANCE_TEMPLATE_NAME \ | |
--base-instance-name deeplearning-instances \ | |
--size 2 \ | |
--zones us-west1-a,us-west1-b |
This file contains hidden or 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
export INSTANCE_GROUP_NAME="deeplearning-instance-group" | |
gcloud compute instance-groups managed list-instances $INSTANCE_GROUP_NAME --region us-west1 |