Compare commits

...
Author SHA1 Message Date
kittyabsandGitHub 912ec397e7 Update ray_cluster_management.ipynb
From Krishna Movva: "Change 'Google Cloud ML' to 'Vertex AI' in the "Objective" subsection. I thought Cloud ML was an old name for the AI/ML services on Google Cloud."
2024-05-29 08:35:39 -07:00
c306cfaae1 Add common util functions for notebooks. (#3014)
Co-authored-by: minwoopark <minwoopark@google.com>
2024-05-29 15:23:59 +00:00
fe97c65ea4 Update Gemma and PaliGemma notebooks (#3007)
Co-authored-by: minwoopark <minwoopark@google.com>
2024-05-28 19:35:32 +00:00
Katie NguyenandGitHub 9d0ec7cc62 fix: update colab enterprise link (#3012) 2024-05-28 19:33:43 +00:00
de5146905c fix declare -x AUTO_PROXY="https://proxyconfig.corp.google.com/proxy.pac" (#3011)
declare -x CHROME_REMOTE_DESKTOP_DEFAULT_DESKTOP_SIZES="1600x1200,3840x2160,3840x2560,5120x1440,2160x3840"
declare -x COLORTERM="truecolor"
declare -x CVS_RSH="ssh"
declare -x DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/809963/bus"
declare -x GOOGLE_CLOUD_DISABLE_DIRECT_PATH="truen"
declare -x HISTCONTROL="ignoredups"
declare -x HOME="/usr/local/google/home/minwoopark"
declare -x LANG="en_US.UTF-8"
declare -x LESSCLOSE="/usr/bin/lesspipe %s %s"
declare -x LESSOPEN="| /usr/bin/lesspipe %s"
declare -x LOGNAME="minwoopark"
declare -x LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:"
declare -x MOTD_SHOWN="pam"
declare -x OLDPWD="/tmp/vertex-ai-samples"
declare -x P4CONFIG=".p4config"
declare -x P4MERGE="/google/src/files/head/depot/eng/perforce/mergep4.tcl"
declare -x PARINIT="rTbgqR B=.?_A_a Q=_s>|:"
declare -x PATH="/usr/local/google/home/minwoopark/.local/bin:/usr/lib/google-golang/bin:/usr/local/buildtools/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
declare -x PWD="/tmp/vertex-ai-samples/notebooks/community/model_garden"
declare -x PYTHONPATH="/usr/local/buildtools/current/sitecustomize"
declare -x RSYNC_RSH="ssh"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SK_SIGNING_PLUGIN="gnubbyagent"
declare -x SSH_AUTH_KEY=$'ecdsa-sha2-nistp256-cert-v01@openssh.com AAAAKGVjZHNhLXNoYTItbmlzdHAyNTYtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgazEAFZ2eo797Q/VO6uG2HkkShArEPHLKfyjKs/qYq0cAAAAIbmlzdHAyNTYAAABBBJQ0tXAyF9ZYMb4PE8Ev0Qsmg94oZ0skXvnuEHewktkb5R0Iq/01UbI5EC+g4ivkVsT1BEWkfEvK5mkVBYQkKpcZAAAADCmtRAAAAAEAAAAabWlud29vcGFya0Bjb3JwLmdvb2dsZS5jb20AAAAjAAAACm1pbndvb3BhcmsAAAARZ29vZ2xlXG1pbndvb3BhcmsAAAAAZlX9cQAAAABmVxfdAAAAAAAAAMwAAAAYY2VydC1tZXRhZGF0YUBnb29nbGUuY29tAAAAKgAAACYIARIgB1wlRexvZHwhV2JNrjQ1fgtUHfbXqyGq0FjDNs8V9lUgBgAAABVwZXJtaXQtWDExLWZvcndhcmRpbmcAAAAAAAAAF3Blcm1pdC1hZ2VudC1mb3J3YXJkaW5nAAAAAAAAABZwZXJtaXQtcG9ydC1mb3J3YXJkaW5nAAAAAAAAAApwZXJtaXQtcHR5AAAAAAAAAA5wZXJtaXQtdXNlci1yYwAAAAAAAAAAAAABFwAAAAdzc2gtcnNhAAAAAwEAAQAAAQEAvN0ZS5b1OZYtoJ1PSKY4GIwjis1i4zZZ2MBdN/TEYqJIOVsfAtkDrhC9YGSVuyai/kOXwLLnFc5dVDRWHLDSBzoXEgl4QKCmNu9nneV/cMLEq4d03o1DPOSPQGJDq+wep4K9HuRwvzog6wTDA5Kp0loCnWY8MHTbt4S/O2Ro5mvF0x0ec9vccwW1KOtc/CydQiGmevBZOQOyXt8ZCZKEtSOTIPhAE55WK8agtMEsJlHRtcswSg2BJNJMSeUKgL1An/oCE9bKAME/zXVYVK5Fuv4epqccnd3sQW2T8qniOIcEDI4oybDejm6G8VPw/pxieSPbaFGftuLyR/rHS52OhwAAARQAAAAMcnNhLXNoYTItMjU2AAABAB6848edrFMkVv7srR+12gWCcYsAXadttaF9VBNSK7AojCKPQC5axHjdfmGQHkc6FDj5x76wFhW2QoBWF6EEullMA/BBYtUeOYYrRwIQxvG2EshSl6Qyx1JW9RmClgEQa13JDNS+sHaGih0TK/+h1Cll3WcGYL5bSlTjyI4QX9gcoTA12Ctd01xKiMuXTscx+IMw8nyl9hQQ4eucc4FW130gRglHBdqH9VNjPgFXnoffXfC8P7kBKhPfVk9CjNWl3VN7LwEvFXAT40EBqFeK/b+2pKTL9lDEeUkXxDCz39GHWBu8BYd186GVjjjF8hgK01I90/xGldt/cORgorzziko=\n'
declare -x SSH_AUTH_SOCK="/tmp/ssh-XXXXFPQFEs/agent.634059"
declare -x SSH_CLIENT="172.253.30.128 55315 22"
declare -x SSH_CONNECTION="172.253.30.128 55315 192.168.3.61 22"
declare -x SSH_TTY="/dev/pts/1"
declare -x TERM="xterm-256color"
declare -x USER="minwoopark"
declare -x X20_HOME="/google/data/rw/users/mi/minwoopark"
declare -x XDG_DATA_DIRS="/usr/share/gnome:/usr/local/share/:/usr/share/"
declare -x XDG_RUNTIME_DIR="/run/user/809963"
declare -x XDG_SESSION_CLASS="user"
declare -x XDG_SESSION_ID="c45"
declare -x XDG_SESSION_TYPE="tty"
declare -x service_endpoint="aiplatform.googleapis.com" error

Co-authored-by: minwoopark <minwoopark@google.com>
2024-05-28 16:41:55 +00:00
kittyabsandGitHub dd8d7946c4 Tensorboard-intro-4 (#2999)
* Update get_started_with_pytorch_rov.ipynb

This is a test

* update url to /tensorboard-introduction
2024-05-24 14:14:45 +00:00
kittyabsandGitHub 37c0c2c373 Tensorboard-intro-3 (#2997)
* Update get_started_with_pytorch_rov.ipynb

This is a test

* Update URL to point to /tensorboard-introduction
2024-05-24 14:14:13 +00:00
Tianrui YangandGitHub 974c3e866c Update embedding column type to float (#3006) 2024-05-24 14:13:20 +00:00
Kathy YuandGitHub d5b6b42615 Fix GCS bucket handling code in Mixtral deployment notebook. (#3008) 2024-05-24 14:12:49 +00:00
186e886edf feat: add model_monitoring_v2 notebooks (#2988)
Co-authored-by: SereniCode <binbinf@google.com>
2024-05-23 17:28:19 +00:00
Gary WeiandGitHub f597680d44 Improve the stable diffusion dreambooth tuning CUJ in the Gradio notebook: (#3004)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Minor update to the hyperlink.

* Rewrite the SD2.1 dreambooth finetune notebook.

* Add code owners.

* Some minor changes to the stable diffusion 2.1 and sd-xl notebooks.

* some additional minor fixes.

* additional fixes.

* Create a notebook to demonstrate dreambooth LoRA finetune for SD-XL model.

* minor updates

* add to the codeowner list.

* merge conflict.

* minor fix to the Gradio UI workshop notebook.

* Some minor updates to the SD2.1 deployment notebook.

* Minor update the `sd-xl` deployment notebook, based on the QA feedback.

* Add a few community models to the Gradio workshop.

* Switch `mediapipe-train` docker container from `vertex-ai-restricted` to `vertex-ai`, in the `mediapipe-train` notebooks.

* Create a notebook for model `instantx/instantid`.

* Update Gradio notebook to use the latest Gradio version and fix some bugs.

1. Update Gradio version to 4.29.0, as it complains 3.50.0 is too old.
2. Uninstall nest-asyncio and uvloop as a workaround to b/339301920 and https://github.com/gradio-app/gradio/issues/8238#issuecomment-2101066984.

* Resolve merge conflict.

* minor updates.

* minor updates.

* Merge some SD notebook in g3 and github.

* Remove the unused variable in the controlnet notebook.

* minor updates.

* include the SD1.5 dreambooth notebook.

* Include the sd1.5 dreambooth notebook.

* Improve the stable diffusion dreambooth tuning CUJ in the Gradio notebook.

* minor update.
2024-05-23 17:10:40 +00:00
Gary WeiandGitHub 51315ecb2f sync the colab notebooks between g3 and github. (#3003)
* Create a Gradio notebook for the new InstantId model.

* Add dreambooth finetune to the stable diffusion Gradio workshop notebook.

* Update the image generation Gradio notebook to support Dreambooth finetuning.

* linter update

* linter update

* minor fix to the instant-id notebook.

* Minor fix to the stable diffusion gradio notebook.

* Split the 'instant-id' deployment notebook prediction into two sections.

* add `deployment_source` to the notebook.

* Switch to `pytorch-diffusers-serve-opt` container to for diffusion lora serving.

* add the dreambooth_lora notebook.

* minor update.

* Parameterize the "show_debug_logs" to facilitate automatic test of the Gradio notebooks.

* Lint format.

* minor updates

* Delete the two deprecated SD1.5 and 2.1 notebooks, as they were no longer referenced on any model cards.

* Sync Colab notebooks between g3 and github.

* format changes

* format update.
2024-05-23 17:08:23 +00:00
KCFindstrandGitHub 4a16d19cec Reformat llama3 deployment notebook and add quota check (#3001) 2024-05-23 17:07:50 +00:00
kittyabsandGitHub 452c77adb8 Ray-on-vertex-ai-public-access (#3002)
* Update get_started_with_pytorch_rov.ipynb

This is a test

* Addresses a feature request regarding the "warning" when using public access
2024-05-22 22:40:37 +00:00
lee1premiumandGitHub 558e6eed88 feat: Getting Tuned Text-Embeddings tutorial. (#3000)
* feat: Getting Tuned Text-Embeddings tutorial.

* feat: Getting Tuned Text-Embeddings tutorial.

* feat: Getting Tuned Text-Embeddings tutorial.
2024-05-22 21:03:44 +00:00
kittyabsandGitHub 82f32efc30 Tensorboard-intro-2 (#2996)
* Update get_started_with_pytorch_rov.ipynb

This is a test

* updated URL to point to tensorboard-introduction (and not "overview")

* change URL to /tensorboard-introduction
2024-05-21 23:38:53 +00:00
kittyabsandGitHub 4d2ea0d50f Tensorboard-introduction (#2994)
* Update get_started_with_pytorch_rov.ipynb

This is a test

* updated URL to point to tensorboard-introduction (and not "overview")
2024-05-21 20:45:18 +00:00
Manu KumarandGitHub c81c195d46 fix: use renamed create_feature_view() function in embedding notebook (#2993)
Increase sleep for DNS propagation to pass CI.
2024-05-21 20:43:19 +00:00
11d7c6dd7e Add checks to ensure the artifacts are copied to user bucket. (#2992)
Co-authored-by: minwoopark <minwoopark@google.com>
2024-05-21 12:30:21 +00:00
Gary WeiandGitHub 8bb6aa592a Merge a few SD notebooks in g3 and github (#2989)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Minor update to the hyperlink.

* Rewrite the SD2.1 dreambooth finetune notebook.

* Add code owners.

* Some minor changes to the stable diffusion 2.1 and sd-xl notebooks.

* some additional minor fixes.

* additional fixes.

* Create a notebook to demonstrate dreambooth LoRA finetune for SD-XL model.

* minor updates

* add to the codeowner list.

* merge conflict.

* minor fix to the Gradio UI workshop notebook.

* Some minor updates to the SD2.1 deployment notebook.

* Minor update the `sd-xl` deployment notebook, based on the QA feedback.

* Add a few community models to the Gradio workshop.

* Switch `mediapipe-train` docker container from `vertex-ai-restricted` to `vertex-ai`, in the `mediapipe-train` notebooks.

* Create a notebook for model `instantx/instantid`.

* Update Gradio notebook to use the latest Gradio version and fix some bugs.

1. Update Gradio version to 4.29.0, as it complains 3.50.0 is too old.
2. Uninstall nest-asyncio and uvloop as a workaround to b/339301920 and https://github.com/gradio-app/gradio/issues/8238#issuecomment-2101066984.

* Resolve merge conflict.

* minor updates.

* minor updates.

* Merge some SD notebook in g3 and github.

* Remove the unused variable in the controlnet notebook.

* minor updates.

* include the SD1.5 dreambooth notebook.

* Include the sd1.5 dreambooth notebook.
2024-05-21 12:29:32 +00:00
Gary WeiandGitHub f5409efb30 Delete the two deprecated SD1.5 and 2.1 notebooks, as they were no longer referenced on any model cards. (#2986)
* Create a Gradio notebook for the new InstantId model.

* Add dreambooth finetune to the stable diffusion Gradio workshop notebook.

* Update the image generation Gradio notebook to support Dreambooth finetuning.

* linter update

* linter update

* minor fix to the instant-id notebook.

* Minor fix to the stable diffusion gradio notebook.

* Split the 'instant-id' deployment notebook prediction into two sections.

* add `deployment_source` to the notebook.

* Switch to `pytorch-diffusers-serve-opt` container to for diffusion lora serving.

* add the dreambooth_lora notebook.

* minor update.

* Parameterize the "show_debug_logs" to facilitate automatic test of the Gradio notebooks.

* Lint format.

* minor updates

* Delete the two deprecated SD1.5 and 2.1 notebooks, as they were no longer referenced on any model cards.
2024-05-21 12:27:59 +00:00
Manu KumarandGitHub 9fed51d88a fix: use renamed create_feature_view() function in optimized notebook (#2944)
Fx colab parameter usage - the linting/auto-format placed some variables
across multiple lines which doesn't work in colab. Make the FOS ID names
shorter to avoid this issue.

Also fix some usage for getting FOS - this can be done directly using
SDK constructor.

Set PSC allow list project to current project.

Increase sleep for DNS propagation to pass CI.
2024-05-16 19:41:07 +00:00
Huguens JeanandGitHub 5005b580d6 [Model Garden Team] Fix Gemma linter issue. (#2983)
* [Model Garden Team] Fix Gemma linter issue.

* [Model Garden Team] Fix Gemma linter issue.

* Update model_garden_gemma_evaluation.ipynb

* Update model_garden_gemma_evaluation.ipynb
2024-05-15 22:25:54 +00:00
dstnluong-googleandGitHub 80707d319d Fix Gemma finetuning notebook typo again. (#2984)
PiperOrigin-RevId: 634030805
2024-05-15 19:34:01 +00:00
Gary WeiandGitHub b630f8d5f0 Parameterize the "show_debug_logs" to facilitate automatic test of the Gradio notebooks. (#2975)
* Create a Gradio notebook for the new InstantId model.

* Add dreambooth finetune to the stable diffusion Gradio workshop notebook.

* Update the image generation Gradio notebook to support Dreambooth finetuning.

* linter update

* linter update

* minor fix to the instant-id notebook.

* Minor fix to the stable diffusion gradio notebook.

* Split the 'instant-id' deployment notebook prediction into two sections.

* add `deployment_source` to the notebook.

* Switch to `pytorch-diffusers-serve-opt` container to for diffusion lora serving.

* add the dreambooth_lora notebook.

* minor update.

* Parameterize the "show_debug_logs" to facilitate automatic test of the Gradio notebooks.

* Lint format.

* minor updates
2024-05-15 16:34:58 +00:00
Michael HuandGitHub 4fc807c570 Import AutoSxS pipeline from v1 directory (#2973) 2024-05-15 16:33:19 +00:00
chrisheechoandGitHub e1aef2f241 Update model_garden_gemma_fine_tuning_batch_deployment_on_rov.ipynb (#2982)
Need to update this headnode size per product requirement to not cause errors
2024-05-15 16:30:31 +00:00
dstnluong-googleandGitHub d5312bec5d Fix typo in Gemma finetuning notebook. (#2980)
PiperOrigin-RevId: 633712168
2024-05-15 00:32:24 +00:00
Louis LinandGitHub 5f86e65e6d fix: Broken 'processor' param due to linter (#2972)
* feat: Add notebook for E5 text embedding models

* feat: Add notebook for E5 text embedding models

* fix: Broken 'processor' param due to linter

* fix: Update the dev TEI docker images to the public ones
2024-05-14 22:08:53 +00:00
chrisheechoandGitHub f51d6c8e06 Update ray_cluster_management.ipynb (#2974)
Need to change the head node default to 16 to avoid error - i'm the PM for this product
2024-05-14 19:07:15 +00:00
84012f0e22 Add PaliGemma notebooks (#2971)
Co-authored-by: minwoopark <minwoopark@google.com>
2024-05-13 23:34:41 +00:00
dstnluong-googleandGitHub bec5a1f61a Sync GitHub repo (#2966)
PiperOrigin-RevId: 629577775
2024-05-13 21:33:53 +00:00
Louis LinandGitHub 67d14b1e91 feat: Add notebook for E5 text embedding models (#2961)
* feat: Add notebook for E5 text embedding models

* feat: Add notebook for E5 text embedding models
2024-05-11 13:01:26 +00:00
Gary WeiandGitHub 1d720eba33 Switch from pytorch-peft-serve to pytorch-diffusers-serve-opt container for diffusion model serving with lora. (#2950)
* Create a Gradio notebook for the new InstantId model.

* Add dreambooth finetune to the stable diffusion Gradio workshop notebook.

* Update the image generation Gradio notebook to support Dreambooth finetuning.

* linter update

* linter update

* minor fix to the instant-id notebook.

* Minor fix to the stable diffusion gradio notebook.

* Split the 'instant-id' deployment notebook prediction into two sections.

* add `deployment_source` to the notebook.

* Switch to `pytorch-diffusers-serve-opt` container to for diffusion lora serving.

* add the dreambooth_lora notebook.

* minor update.
2024-05-09 23:56:08 +00:00
Gary WeiandGitHub 246dc04784 Update the instant-id Gradio notebook to use the latest Gradio version and fix some bugs. (#2959)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Minor update to the hyperlink.

* Rewrite the SD2.1 dreambooth finetune notebook.

* Add code owners.

* Some minor changes to the stable diffusion 2.1 and sd-xl notebooks.

* some additional minor fixes.

* additional fixes.

* Create a notebook to demonstrate dreambooth LoRA finetune for SD-XL model.

* minor updates

* add to the codeowner list.

* merge conflict.

* minor fix to the Gradio UI workshop notebook.

* Some minor updates to the SD2.1 deployment notebook.

* Minor update the `sd-xl` deployment notebook, based on the QA feedback.

* Add a few community models to the Gradio workshop.

* Switch `mediapipe-train` docker container from `vertex-ai-restricted` to `vertex-ai`, in the `mediapipe-train` notebooks.

* Create a notebook for model `instantx/instantid`.

* Create a Gradio notebook for the new InstantId model.

* Add dreambooth finetune to the stable diffusion Gradio workshop notebook.

* Update the image generation Gradio notebook to support Dreambooth finetuning.

* linter update

* linter update

* minor fix to the instant-id notebook.

* Minor fix to the stable diffusion gradio notebook.

* Update Gradio notebook to use the latest Gradio version and fix some bugs.

1. Update Gradio version to 4.29.0, as it complains 3.50.0 is too old.
2. Uninstall nest-asyncio and uvloop as a workaround to b/339301920 and https://github.com/gradio-app/gradio/issues/8238#issuecomment-2101066984.

* Resolve merge conflict.

* minor updates.

* minor updates.

* Update the instant-id Gradio notebook to use the latest Gradio version and fix some bugs.
2024-05-09 23:54:56 +00:00
Gary WeiandGitHub e08d445e17 Update Gradio notebook to use the latest Gradio version and fix some bugs. (#2958)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Minor update to the hyperlink.

* Rewrite the SD2.1 dreambooth finetune notebook.

* Add code owners.

* Some minor changes to the stable diffusion 2.1 and sd-xl notebooks.

* some additional minor fixes.

* additional fixes.

* Create a notebook to demonstrate dreambooth LoRA finetune for SD-XL model.

* minor updates

* add to the codeowner list.

* merge conflict.

* minor fix to the Gradio UI workshop notebook.

* Some minor updates to the SD2.1 deployment notebook.

* Minor update the `sd-xl` deployment notebook, based on the QA feedback.

* Add a few community models to the Gradio workshop.

* Switch `mediapipe-train` docker container from `vertex-ai-restricted` to `vertex-ai`, in the `mediapipe-train` notebooks.

* Create a notebook for model `instantx/instantid`.

* Update Gradio notebook to use the latest Gradio version and fix some bugs.

1. Update Gradio version to 4.29.0, as it complains 3.50.0 is too old.
2. Uninstall nest-asyncio and uvloop as a workaround to b/339301920 and https://github.com/gradio-app/gradio/issues/8238#issuecomment-2101066984.

* Resolve merge conflict.

* minor updates.

* minor updates.
2024-05-09 23:54:11 +00:00
kewentandGitHub 859ed6a55d remove preview models in description (#2948) 2024-05-08 19:16:13 +00:00
dstnluong-googleandGitHub 44d11bee00 Set DEPLOY_SOURCE to MG notebooks. (#2947) 2024-05-08 18:53:13 +00:00
Gary WeiandGitHub 7c0213dfff Split the 'instant-id' deployment notebook prediction into two sections: (#2946)
* Create a Gradio notebook for the new InstantId model.

* Add dreambooth finetune to the stable diffusion Gradio workshop notebook.

* Update the image generation Gradio notebook to support Dreambooth finetuning.

* linter update

* linter update

* minor fix to the instant-id notebook.

* Minor fix to the stable diffusion gradio notebook.

* Split the 'instant-id' deployment notebook prediction into two sections.

* add `deployment_source` to the notebook.
2024-05-08 13:29:29 +00:00
JennieandGitHub 2cdc45b7b0 Information is outdated. Feature Store API is now available in more regions. (#2923) 2024-05-04 01:22:33 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
413bd6e7c1 Bump tqdm in /community-content/vertex_model_garden/model_oss/cloudnerf (#2927)
Bumps [tqdm](https://github.com/tqdm/tqdm) from 4.66.1 to 4.66.3.
- [Release notes](https://github.com/tqdm/tqdm/releases)
- [Commits](https://github.com/tqdm/tqdm/compare/v4.66.1...v4.66.3)

---
updated-dependencies:
- dependency-name: tqdm
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-04 01:03:53 +00:00
Gary WeiandGitHub 34a68990b2 Some minor updates to the stable-diffusion-gradio notebook. (#2926)
* Create a Gradio notebook for the new InstantId model.

* Add dreambooth finetune to the stable diffusion Gradio workshop notebook.

* Update the image generation Gradio notebook to support Dreambooth finetuning.

* linter update

* linter update

* minor fix to the instant-id notebook.

* Minor fix to the stable diffusion gradio notebook.
2024-05-03 19:04:15 +00:00
Gary WeiandGitHub 08561d91c0 Update the image generation Gradio notebook to support Dreambooth finetuning. (#2921)
* Create a Gradio notebook for the new InstantId model.

* Add dreambooth finetune to the stable diffusion Gradio workshop notebook.

* Update the image generation Gradio notebook to support Dreambooth finetuning.

* linter update

* linter update

* minor fix to the instant-id notebook.
2024-05-03 18:02:52 +00:00
Huguens JeanandGitHub 2d280216ec Revert "[MG Model Team] Add environment var of DEPLOY_SOURCE with value 'note…" (#2925)
This reverts commit 056d909e3e.
2024-05-03 16:46:04 +00:00
Ivan NardiniandGitHub 662f7b1440 feat: tuning and serving Gemma on Ray on Vertex AI in Model Garden (#2920)
* adding gemma on rov in model garden

* linter passed
2024-05-02 19:11:01 +00:00
Huguens JeanandGitHub 056d909e3e [MG Model Team] Add environment var of DEPLOY_SOURCE with value 'notebook' for all mg notebooks. (#2917) 2024-05-02 16:47:39 +00:00
Gary WeiandGitHub f164335054 [InstantID] Update the link of the two reference images. (#2914)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Minor update to the hyperlink.

* Rewrite the SD2.1 dreambooth finetune notebook.

* Add code owners.

* Some minor changes to the stable diffusion 2.1 and sd-xl notebooks.

* some additional minor fixes.

* additional fixes.

* Create a notebook to demonstrate dreambooth LoRA finetune for SD-XL model.

* minor updates

* add to the codeowner list.

* merge conflict.

* minor fix to the Gradio UI workshop notebook.

* Some minor updates to the SD2.1 deployment notebook.

* Update the link of the reference images.
2024-05-02 12:54:08 +00:00
xcchen1andGitHub a05724d0d6 Create ByteDance/SDXL-Lightning notebook (#2912)
* Add ByteDance/SDXL-Lightning notebook

* Add ByteDance/SDXL-Lightning to gradio notebook
2024-05-02 12:53:24 +00:00
Gary WeiandGitHub 7f4e3f2afa Create a Gradio notebook for the new InstantId model. (#2911) 2024-05-02 12:52:43 +00:00
Tianrui YangandGitHub cc981bcd2c refactor: update feature store vector search notebook use latest features. (#2909)
* Update feature store vector search notebook to use latest vertex SDK.

* Run lint to fix format issue

* Sleep for a few minutes to wait for DNS to be ready
2024-04-30 21:02:17 +00:00
0fd7db5602 Fix link URL typo (#2910)
Co-authored-by: minwoopark <minwoopark@google.com>
2024-04-30 18:58:56 +00:00
Huguens JeanandGitHub 6f4bb601d9 Update falcon instruct notebook to lowcode/nocode (#2905)
* Update falcon instruct notebook to lowcode/nocode

* Fix imported unused in falcon instruct deployment noteboook.
2024-04-30 18:52:50 +00:00
Kathy YuandGitHub 4b25631e53 Fix GCS path in Llama 3 finetuning notebook. (#2908)
* Fix GCS path in Llama 3 finetuning notebook.

* Fix bucket name for permission granting.
2024-04-30 18:49:50 +00:00
dstnluong-googleandGitHub d212b2fdc9 Fix Mixtral model id naming (#2904) 2024-04-30 18:49:03 +00:00
Gary WeiandGitHub e5cfffd44f Create a notebook for model instantx/instantid. (#2898)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Minor update to the hyperlink.

* Rewrite the SD2.1 dreambooth finetune notebook.

* Add code owners.

* Some minor changes to the stable diffusion 2.1 and sd-xl notebooks.

* some additional minor fixes.

* additional fixes.

* Create a notebook to demonstrate dreambooth LoRA finetune for SD-XL model.

* minor updates

* add to the codeowner list.

* merge conflict.

* minor fix to the Gradio UI workshop notebook.

* Some minor updates to the SD2.1 deployment notebook.

* Minor update the `sd-xl` deployment notebook, based on the QA feedback.

* Add a few community models to the Gradio workshop.

* Switch `mediapipe-train` docker container from `vertex-ai-restricted` to `vertex-ai`, in the `mediapipe-train` notebooks.

* Create a notebook for model `instantx/instantid`.
2024-04-29 15:40:01 +00:00
Mend RenovateandGitHub 85a46165bc chore(deps): update dependency black to v24.4.2 (#2900) 2024-04-26 14:47:23 +00:00
Kathy YuandGitHub dcd26245c7 Add Llama 3 finetuning notebook. (#2897) 2024-04-24 23:07:29 +00:00
Mend RenovateandGitHub 3c10aba391 chore(deps): update dependency black to v24.4.1 (#2895) 2024-04-24 15:46:23 +00:00
dstnluong-googleandGitHub 6c3bd0e042 Add uuid to reduce bucket name crashing (#2894)
* Add uuid to notebooks.

* Lint
2024-04-23 21:22:17 +00:00
dstnluong-googleandGitHub cff2942b20 Load mistral and mixtral models from GCS (#2893)
* Load Mistral and Mixtral models from GCS.

* Lint

* Fix lint

* add -r to mixtral

* Try to automatically set region
2024-04-23 14:31:19 +00:00
xcchen1andGitHub bf3f96caf6 No-code/low-code notebook: fix sd 1.5 dreambooth model deployment section (#2892) 2024-04-23 14:29:23 +00:00
Aaron DietzandGitHub 3dac000915 Update automl_image_classification_batch_prediction.ipynb (#2891)
This notebook was throwing "invalid JSON" errors when users were opening it in Colab, etc.

The problem was introduced in https://github.com/GoogleCloudPlatform/vertex-ai-samples/pull/2866 when I didn't close a text cell line properly.
2024-04-22 17:37:50 +00:00
Kathy YuandGitHub 00d8f83630 Update embedded model card link for Llama 3 deployment notebook. (#2890) 2024-04-20 23:42:24 +00:00
eliasecchigandGitHub 03efaadb87 Update README.md (#2888) 2024-04-19 15:45:07 +00:00
qijing93andGitHub b70be17865 chore: Splitting legacy Feature Store colabs to a separate folder. (#2887) 2024-04-19 12:41:34 +00:00
Huguens JeanandGitHub badf6f4a61 Update codellamma nclc deployment and evaluation notebooks. (#2886) 2024-04-19 12:40:10 +00:00
weigaryandGitHub f5e3bfa727 Switch mediapipe-train docker container from vertex-ai-restricted to vertex-ai, in the mediapipe-train notebooks. (#2885)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Minor update to the hyperlink.

* Rewrite the SD2.1 dreambooth finetune notebook.

* Add code owners.

* Some minor changes to the stable diffusion 2.1 and sd-xl notebooks.

* some additional minor fixes.

* additional fixes.

* Create a notebook to demonstrate dreambooth LoRA finetune for SD-XL model.

* minor updates

* add to the codeowner list.

* merge conflict.

* minor fix to the Gradio UI workshop notebook.

* Some minor updates to the SD2.1 deployment notebook.

* Minor update the `sd-xl` deployment notebook, based on the QA feedback.

* Add a few community models to the Gradio workshop.

* Switch `mediapipe-train` docker container from `vertex-ai-restricted` to `vertex-ai`, in the `mediapipe-train` notebooks.
2024-04-18 17:24:01 +00:00
Kathy YuandGitHub 998ca068a7 Add Llama3 deployment notebook. (#2884)
* Add Llama3 deployment notebook.

* Add to codeowners.
2024-04-18 16:35:28 +00:00
weigaryandGitHub 89c040bc24 Add a few community models to the Gradio workshop. (#2883)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Minor update to the hyperlink.

* Rewrite the SD2.1 dreambooth finetune notebook.

* Add code owners.

* Some minor changes to the stable diffusion 2.1 and sd-xl notebooks.

* some additional minor fixes.

* additional fixes.

* Create a notebook to demonstrate dreambooth LoRA finetune for SD-XL model.

* minor updates

* add to the codeowner list.

* merge conflict.

* minor fix to the Gradio UI workshop notebook.

* Some minor updates to the SD2.1 deployment notebook.

* Minor update the `sd-xl` deployment notebook, based on the QA feedback.

* Add a few community models to the Gradio workshop.
2024-04-18 12:48:16 +00:00
e072753032 Rov-open-colab-enterprise (#2879)
* Update get_started_with_pytorch_rov.ipynb

This is a test

* Added "Open in Colab Enterprise" link and made other edits

* Update ray_cluster_management.ipynb

---------

Co-authored-by: Katie Nguyen <21978337+katiemn@users.noreply.github.com>
2024-04-17 14:53:36 +00:00
dstnluong-googleandGitHub b9147f6dfe Collapse last cell (#2882)
* Collapse last cell

* Lint
2024-04-16 20:42:14 +00:00
Mend RenovateandGitHub 0d8482f17f Update dependency black to v24.4.0 (#2881) 2024-04-15 17:45:11 +00:00
e4abe986b1 Fix region for sdk streaming (#2878)
* add Claude 3 Opus model

* fix lint

* fix vertexai bug

* update region for streaming sdk call

---------

Co-authored-by: Huy Ngo <huyngo@google.com>
2024-04-11 20:28:18 +00:00
92804a7fac Fix vertexai bug on Claude 3 Opus (#2877)
* add Claude 3 Opus model

* fix lint

* fix vertexai bug

---------

Co-authored-by: Huy Ngo <huyngo@google.com>
2024-04-11 19:14:54 +00:00
513fef82dc Add Claude 3 Opus model (#2871)
* add Claude 3 Opus model

* fix lint

---------

Co-authored-by: Huy Ngo <huyngo@google.com>
2024-04-11 18:17:51 +00:00
Tianrui YangandGitHub 3f94a50a7d Update FeatureStore embedding notebook to use vertex SDK preview. (#2854)
* Update FeatureStore embedding notebook to use vertex SDK preview.

* Fix format issue.

* Comment deleting transfer config code

* Add                   Credentialed Accounts
ACTIVE  ACCOUNT
*       141951627079-compute@developer.gserviceaccount.com to debug permission issue

* Fix bigquery transfer run issue.
2024-04-11 03:55:14 +00:00
dstnluong-googleandGitHub db83e3f2d2 Fix typos in quantization notebook (#2875) 2024-04-10 21:28:16 +00:00
xcchen1andGitHub 9f896a2138 Update notebooks to no-code/low-code (#2874) 2024-04-10 03:46:16 +00:00
Aaron DietzandGitHub 15546cc1c0 Remove inaccurate description about length of training time automl_image_classification_batch_prediction.ipynb (#2866) 2024-04-10 03:45:46 +00:00
ee88765444 Tpuv5e llama2 briankang robv (#2853)
* Initial commit of a Llama2 TPUv5e LoRA example

* Addressing issue of job failing at the end by adding sys.exit(0) after all steps complete

* Adding Llama2 LoRA tuning on TPUv5e notebook

* Create /tmp/modelfiles folder for downloading model files during training

* Updated to use gcloud storage instead of gsutil

* Removed step to clear folder in bucket, since that causes failure

* Added serving/deployment section.

* Fixed linting errors

* Default to 8 chip tuning for quota issue on automated tests

* Defaulting back to 16 chip fine-tuning and epochs to 200

* Set Accelerate library to 0.28.0, as newer version break TPU support

* Updated upload of tuned model files to happen for all workers - to avoid timeout errors

* Temp remove active endpoint, then retest

* Updating docker container to python 3.10

* Added wait to prevent job delete step happening too early

* Lint issue and remove temporary endpoint delete

* Lint issue

* Add 15 minute wait while model is setup on the endpoint, and readd temp delete of endpoint

* Make 15 minute wait optional and remove temporary endpoint delete

* Remove GCS path to model garden model for final commit

---------

Co-authored-by: Rob Vogelbacher <robv@google.com>
2024-04-10 03:45:10 +00:00
fbb27557e8 Fix CodeGemma model ID (#2873)
Co-authored-by: minwoopark <minwoopark@google.com>
2024-04-09 15:23:17 +00:00
6980995572 Fix CodeGemma notebook (#2872)
Co-authored-by: minwoopark <minwoopark@google.com>
2024-04-09 12:31:10 +00:00
Aaron DietzandGitHub 217a774182 Fixed formatting of the "open in" table (#2870) 2024-04-09 03:49:05 +00:00
Huy NgoandGitHub de9350d695 Revert "add Claude 3 Opus model (#2855)" (#2869)
This reverts commit 106e34781c.
2024-04-09 02:32:21 +00:00
106e34781c add Claude 3 Opus model (#2855)
* add Claude 3 Opus model

* fix lint

---------

Co-authored-by: Huy Ngo <huyngo@google.com>
2024-04-09 00:36:17 +00:00
xcchen1andGitHub 692d4adc5d No-code/low-code notebooks: update notebook links (#2867) 2024-04-09 00:20:01 +00:00
2f243ddc54 Add CodeGemma (#2868)
Co-authored-by: minwoopark <minwoopark@google.com>
2024-04-09 00:18:33 +00:00
yexing111andGitHub 9bdeed5c4a Update FS optimized serving GA colab (#2859)
* Update FS optimized serving GA colab

* Fix import order

* Fix import format

* Fix format

* Fix test issue

* Fix format

* Add way to getFOS&FV for FR/FG
2024-04-08 21:04:08 +00:00
Huguens JeanandGitHub ea2f4bbe3a Gemma eval fix (#2865)
* Fix minor typo in accelerator selection.

* Fix minor typo in accelerator selection.

* Update eval dataset to hellaswag.

* Update eval dataset to hellaswag.
2024-04-08 18:50:11 +00:00
geetaarora-googleandGitHub 76b7ef1c5e Added RLHF recommended best practices. (#2863) 2024-04-08 18:49:29 +00:00
dstnluong-googleandGitHub 69f2b0a900 Minor fix for llama2 quantization. (#2864)
* Minor fix for llama2 quantization.

* Lint
2024-04-08 17:09:41 +00:00
kittyabsandGitHub a1035554c7 Fix-table-3 (#2862)
* Update get_started_with_pytorch_rov.ipynb

This is a test

* Still trying to fix table - so sorry about this.
2024-04-08 17:08:54 +00:00
xcchen1andGitHub fc45d4b114 Update notebooks to no-code/low-code (#2860) 2024-04-06 14:05:37 +00:00
kittyabsandGitHub 97bff66011 Fix-table (#2856)
* Update get_started_with_pytorch_rov.ipynb

This is a test

* fix table containing links to notebook samples.
2024-04-05 19:30:29 +00:00
dstnluong-googleandGitHub 4f98b604c3 Rewrite Gemma deployment notebook to be LC/NC (#2850)
* Rewrite Gemma deployment to be LC/NC

* Lint

* Lint
2024-04-05 19:29:24 +00:00
Huy NgoandGitHub 848cecb1b0 Revert "Add Claude 3 Opus model (#2847)" (#2849)
This reverts commit 19e95b90c7.
2024-04-04 20:22:49 +00:00
4b20f9a25b feat: Update supported models table in RLHF notebooks. (#2841)
* feat: Update supported models table in RLHF notebooks.

* feat: Update image that shows how to locate output_model_path.

* feat: Update name of deploy model component.

---------

Co-authored-by: Ryan Latture <latture@google.com>
2024-04-04 19:58:51 +00:00
19e95b90c7 Add Claude 3 Opus model (#2847)
* Add Colab on how to use Claude 3 models on Vertex AI

* Add Colab on how to use Claude 3 models on Vertex AI

* add codeowner

* lint

* update model version

* update stream sdk to have more readable response

* add colab for claude 3

* lint

* update CODEOWNERS and file name

* remove claude 3 colab from model_garden folder

* update CODEOWNERS

* format

* fix intergration test failed

* fix markdown not showing up

* fix markdown not showing up

* update pip command

* update install command

* update restart kernel command

* fix restart kernel command

* clear cell output

* update select region command

* raise error if user doesn't update project_id

* update ordering and add preview image section

* update ordering and add preview image section

* fix httpx package not install

* fix httpx package not install

* fix httpx package not install

* fix lint

* add claude 3 opus model

* fix lint

---------

Co-authored-by: Huy Ngo <huyngo@google.com>
2024-04-04 19:56:03 +00:00
c565eb9f4b Update colab order and add preview image section (#2789)
* Add Colab on how to use Claude 3 models on Vertex AI

* Add Colab on how to use Claude 3 models on Vertex AI

* add codeowner

* lint

* update model version

* update stream sdk to have more readable response

* add colab for claude 3

* lint

* update CODEOWNERS and file name

* remove claude 3 colab from model_garden folder

* update CODEOWNERS

* format

* fix intergration test failed

* fix markdown not showing up

* fix markdown not showing up

* update pip command

* update install command

* update restart kernel command

* fix restart kernel command

* clear cell output

* update select region command

* raise error if user doesn't update project_id

* update ordering and add preview image section

* update ordering and add preview image section

* fix httpx package not install

* fix httpx package not install

* fix httpx package not install

* fix lint

---------

Co-authored-by: Huy Ngo <huyngo@google.com>
2024-04-04 12:50:18 +00:00
dstnluong-googleandGitHub 2f5eef2c17 Add region check for llama2 deployment notebook. (#2843)
* Add region check for LLaMA2 deployment notebook.

* Lint
2024-04-04 12:48:48 +00:00
dstnluong-googleandGitHub d5b1b83d9a Remove text moderation from llama2 quantization notebook (#2844)
* Remove text moderation for LLaMA2 quantization notebook.

* Lint
2024-04-04 12:48:07 +00:00
weigaryandGitHub 4bcdc034bb Update all the diffusion-serve containder URI to 20240403_0836_RC00 which includes the latest optimizations to the diffusion models. (#2845)
* Some minor updates to the SD-XL model deployment notebook, based on the QA feedback.

* Updates to the `sd-xl-dreambooth-lora-finetune` notebook based on feedback.

* [Stable diffusion gradio] Add a few pre defined styles to the workshop, also some minor UX improvement.

* Update all the diffusion-serve containder URI to 20240403_0836_RC00 which includes the latest optimizations to the diffusion models.
2024-04-04 12:47:24 +00:00
xcchen1andGitHub 03ec89d3d4 Update notebooks to no-code/low-code (#2842) 2024-04-03 20:54:48 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
f3d8051df4 Bump pillow (#2839)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.2.0 to 10.3.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.2.0...10.3.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 20:53:42 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
4292d97dc6 Bump pillow (#2840)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.2.0 to 10.3.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.2.0...10.3.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 20:52:57 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
e557dcd3df Bump pillow (#2838)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.2.0 to 10.3.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.2.0...10.3.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 20:52:12 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
27e5b007be Bump pillow (#2837)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.2.0 to 10.3.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.2.0...10.3.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 20:51:21 +00:00
siping-huandGitHub 72ebccd341 Update autosxs_llm_evaluation_for_summarization_task.ipynb (#2836)
* Update autosxs_llm_evaluation_for_summarization_task.ipynb

Quick fix for the xsum dataset description and citation.

* fix lint error
2024-04-03 13:46:56 +00:00
kittyabsandGitHub 09e44f8661 Ray on vertex ai (#2827)
* Made numerous edits. Code not impacted

* removed empty cell

* delete empty cell
2024-04-03 02:28:07 +00:00
weigaryandGitHub 1c12789805 [Stable diffusion gradio] Add a few pre defined styles to the workshop, also some minor UX improvement. (#2835)
* Some minor updates to the SD-XL model deployment notebook, based on the QA feedback.

* Updates to the `sd-xl-dreambooth-lora-finetune` notebook based on feedback.

* [Stable diffusion gradio] Add a few pre defined styles to the workshop, also some minor UX improvement.
2024-04-03 02:27:00 +00:00
Michael HuandGitHub 55323b74da Update AutoSxS notebooks to use latest package release (#2832)
* Update AutoSxS notebooks to use latest package release

* apply elijah's review comments

* remove force reinstall to avoid errors
2024-04-03 02:24:17 +00:00
14c927400a feat: Tune llama-2-7b with RLHF. (#2834)
Co-authored-by: Ryan Latture <latture@google.com>
2024-04-03 02:23:26 +00:00
lee1premiumandGitHub fff3ac1838 feat: Elastic Text-Embedding Model demo. (#2829)
* feat: Elastic Text-Embedding Model demo.

* feat: Elastic Text-Embedding Model demo.
2024-04-03 02:22:24 +00:00
xcchen1andGitHub f5eab96c13 Update notebooks to no-code/low-code (#2831) 2024-04-02 20:01:32 +00:00
KCFindstrandGitHub fde0abd9f6 Fix malformed Colab URLs in model garden notebooks (#2830)
* Fix malformed Colab URL in llama2 peft finetuning and HPT notebooks

* Fix Gemma PEFT finetuning notebook URL
2024-04-02 19:59:03 +00:00
32a75b15fe feat: Update RLHF parameter documentation. Document how to access real-time TB metrics. (#2819)
Co-authored-by: Ryan Latture <latture@google.com>
2024-04-01 20:14:44 +00:00
lee1premiumandGitHub eb8ae3d01b feat: Elastic Text-Embedding Model demo. (#2824)
* feat: Elastic Text-Embedding Model demo.

* feat: Elastic Text-Embedding Model demo.
2024-04-01 13:12:34 +00:00
KCFindstrandGitHub 6110aa2b13 Update Llama2 PEFT finetuning notebook to low-code version and minor fixes to HPT notebook (#2825) 2024-03-29 23:28:32 +00:00
Eric DongandGitHub 22435976d9 chore: Update template (#2821) 2024-03-29 21:41:07 +00:00
xcchen1andGitHub f279973cb7 Update notebooks to no-code/low-code (#2823) 2024-03-29 19:50:01 +00:00
weigaryandGitHub eace0e9884 Some minor updates to the SD-XL model deployment notebook, based on the QA feedback. (#2820)
* Some minor updates to the SD-XL model deployment notebook, based on the QA feedback.

* Updates to the `sd-xl-dreambooth-lora-finetune` notebook based on feedback.
2024-03-29 19:48:44 +00:00
Lav RaiandGitHub ed16b60537 Add low-code notebooks. (#2818) 2024-03-28 17:00:25 +00:00
KCFindstrandGitHub 5d5bbd072e Update Model Garden Llama2 HPT notebook to low-code version (#2817)
* Update Model Garden Llama2 HPT notebook to low-code version.

* Update resource clean up section
2024-03-28 12:43:44 +00:00
weigaryandGitHub 5587d41f08 Some minor updates to the SD2.1 deployment notebook. (#2816)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Minor update to the hyperlink.

* Rewrite the SD2.1 dreambooth finetune notebook.

* Add code owners.

* Some minor changes to the stable diffusion 2.1 and sd-xl notebooks.

* some additional minor fixes.

* additional fixes.

* Create a notebook to demonstrate dreambooth LoRA finetune for SD-XL model.

* minor updates

* add to the codeowner list.

* merge conflict.

* minor fix to the Gradio UI workshop notebook.

* Some minor updates to the SD2.1 deployment notebook.
2024-03-28 12:42:06 +00:00
weigaryandGitHub 54114468fd some minor updates to the sd-gradio notebook. (#2815)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Minor update to the hyperlink.

* Rewrite the SD2.1 dreambooth finetune notebook.

* Add code owners.

* Some minor changes to the stable diffusion 2.1 and sd-xl notebooks.

* some additional minor fixes.

* additional fixes.

* Create a notebook to demonstrate dreambooth LoRA finetune for SD-XL model.

* minor updates

* add to the codeowner list.

* merge conflict.

* minor fix to the Gradio UI workshop notebook.
2024-03-27 20:49:14 +00:00
Eric DongandGitHub 8a38619827 feat: update notebook template (#2801)
* feat: update notebook template

* address linter errors

* Change a few TODOs

* Add Colab link

* Update the open links

* Address review comments

* Address review comments
2024-03-27 14:02:54 +00:00
kittyabsandGitHub 9b3f4f07db added link to Colab Enteriprise. (#2812) 2024-03-27 00:50:11 +00:00
lee1premiumandGitHub beb53f6ce8 feat: Elastic Text-Embedding demo. (#2811)
* feat: Elastic Text-Embedding demo.

* feat: Elastic Text-Embedding demo.
2024-03-27 00:49:42 +00:00
Huguens JeanandGitHub 0ef5bee2ce Add Falcon Instruct evaluation notebook. (#2808) 2024-03-26 18:46:35 +00:00
Huguens JeanandGitHub 3d21fc16e1 Add Falcon Instruct finetuning notebook. (#2807) 2024-03-26 18:46:11 +00:00
Huguens JeanandGitHub 84ee7fd53c Add Gemma evaluation notebook. (#2806) 2024-03-26 18:45:24 +00:00
Huguens JeanandGitHub 15ddb011d2 Add Falcon Instruct quantization notebook. (#2805) 2024-03-26 18:44:32 +00:00
Huguens JeanandGitHub 4a8e69f8c8 Add Falcon Instruct deployment notebook. (#2804) 2024-03-26 18:43:36 +00:00
Mend RenovateandGitHub 5590037281 chore(deps): update dependency nbqa to v1.8.5 (#2810) 2024-03-26 14:54:10 +00:00
Huguens JeanandGitHub e911c8e098 Add CodeLLama evaluation notebook. (#2803) 2024-03-26 14:53:49 +00:00
Huguens JeanandGitHub ab5d97607d Update CodeLLama notebook to low-code/no-code without evaluation section. (#2802) 2024-03-26 14:52:49 +00:00
Mend RenovateandGitHub 5124590d5f chore(deps): update dependency pyupgrade to v3.15.2 (#2798) 2024-03-25 20:25:09 +00:00
Kathy YuandGitHub b37ed6e53c Update docker link for pic2word serving. (#2797) 2024-03-22 20:42:55 +00:00
AmyandGitHub 2bb39a0e10 moving some data from personal bucket to 'cloud-samples-data' bucket (#2794) 2024-03-22 20:42:25 +00:00
weigaryandGitHub 17369c223f Some minor changes to the sd2.1 and sdxl notebooks. (#2795)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Minor update to the hyperlink.

* Rewrite the SD2.1 dreambooth finetune notebook.

* Add code owners.

* Some minor changes to the stable diffusion 2.1 and sd-xl notebooks.

* some additional minor fixes.

* additional fixes.

* Fix the minor bug associated with "bucket_name".

* Minor fixes for "BUCKET_NAME" for sd2_1 and sdxl deployment notebooks.
2024-03-22 20:41:50 +00:00
zhangxiaotianandGitHub d76246d39b feat: add curl colab for video warehouse (#2793) 2024-03-21 20:58:46 +00:00
weigaryandGitHub 0a48635251 Rewrite the SD2.1 dreambooth finetune notebook. (#2792)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Minor update to the hyperlink.

* Rewrite the SD2.1 dreambooth finetune notebook.

* Add code owners.
2024-03-21 17:07:00 +00:00
weigaryandGitHub 5976895d8d Update the serving docker image to include the latest changes. (#2791)
* Update the serving docker image to include the latest changes.

* Update the image version to 20240320_0836_RC00
2024-03-21 17:05:12 +00:00
Huguens JeanandGitHub cb75558e68 Update CamP ZipNeRF notebook with low-code/no-code version. (#2790)
* Update CamP ZipNeRF notebook with low-code/no-code version.

* Update CamP ZipNeRF notebook with low-code/no-code version.

* Update CamP ZipNeRF notebook with low-code/no-code version.
2024-03-21 15:17:09 +00:00
weigaryandGitHub 7b06a04e19 Rewrite the stable diffusion 2.1 notebook: step #1 deployment. (#2788)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Rewrite the stable diffusion 2.1 notebook: step #1 deployment.
2024-03-21 15:15:38 +00:00
weigaryandGitHub e2e78c9613 Add additional document regarding the list of supported models, and some UI enhancement. (#2787)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes

* Add additional document regarding the list of supported models, and some UI enhancement.

* Minor update to the hyperlink.
2024-03-21 15:13:49 +00:00
Kathy YuandGitHub 3574f8877a Update config and add Mistral v0.2 in Mistral/Mixtral notebook. (#2786) 2024-03-19 18:39:02 +00:00
Durian YogurtandGitHub 63b77e57aa Fix filename bug by appending suffix directly when a video doesn't have an extension (#2785)
* Append suffix directly when video doesn't have an extension

* retrigger checks
2024-03-19 18:38:13 +00:00
cc8aac7220 Add Claude 3 models colab (#2777)
* Add Colab on how to use Claude 3 models on Vertex AI

* Add Colab on how to use Claude 3 models on Vertex AI

* add codeowner

* lint

* update model version

* update stream sdk to have more readable response

* add colab for claude 3

* lint

* update CODEOWNERS and file name

* remove claude 3 colab from model_garden folder

* update CODEOWNERS

* format

* fix intergration test failed

* fix markdown not showing up

* fix markdown not showing up

* update pip command

* update install command

* update restart kernel command

* fix restart kernel command

* clear cell output

* update select region command

---------

Co-authored-by: Huy Ngo <huyngo@google.com>
2024-03-19 16:25:35 +00:00
Brian KangandGitHub c7e2818829 Briankang tpuv5e gemma2b training (#2775)
* Publishing fine-tuning Gemma on TPUv5e notebook

* Update codeowners to add new TPUv5e notebook

* Fixed log link formatting, and added note to require Colab pro for converting to HF format

* Reran local pylint

* Updated python version to 3.10.13

* Pylint reran

* Remove python version note and run linter

* Add gcloud components update for automated tests

* Revert 'Add gcloud components update for automated tests'

This reverts commit a3e79d299b

* Added gcloud components update for automated testing

* Rerun linter

* Updates per nb review

* Changed default region to one where TPUv5e exists

* Update match case to if else for python 3.9
2024-03-18 19:42:51 +00:00
Mend RenovateandGitHub 58bfebfabc chore(deps): update dependency black to v24.3.0 (#2784) 2024-03-15 23:22:33 +00:00
weigaryandGitHub 9130766757 Add controlnet-canny to the Gradio playground, and some additional UX enhancements. (#2783)
* Add controlnet-canny to the Gradio playground, and some additional UX enhancement.

* Minor fixes.

* Minor fixes
2024-03-15 23:21:30 +00:00
Eric DongandGitHub c5d48c80d8 fix: properly handle python versions (#2779) 2024-03-15 17:19:25 +00:00
weigaryandGitHub 39466fe5cb Update the logic of cleaning up the GCS bucket_uri in the sdxl notebook. (#2778)
* Some minor fixed to the `stable-diffusion-gradio` notebook.

* Fix the deployment error of the `SDXL-REFINER` model in the notebook.

* Removed two unnecessary comments.

* Update the logic of cleaning up the `bucket-uri` in the SDXL deployment notebook.
2024-03-15 12:55:07 +00:00
weigaryandGitHub a40675a7ec Fix the deployment error of the SDXL-REFINER model in the notebook. (#2774)
* Some minor fixed to the `stable-diffusion-gradio` notebook.

* Fix the deployment error of the `SDXL-REFINER` model in the notebook.
2024-03-14 18:05:25 +00:00
KCFindstrandGitHub ffb31f9397 Update the CODEOWNER of Gemma GKE deployment notebook (#2770) 2024-03-14 14:10:31 +00:00
xcchen1andGitHub 42d2878c2f Update notebooks to no-code/low-code (#2772)
* Update notebooks to no-code/low-code

* Update notebooks to no-code/low-code
2024-03-14 14:09:43 +00:00
dstnluong-googleandGitHub da46f8aab0 Convert LLaMA2 quantization notebook to low/no code (#2760)
* low/no code llama2 quantization notebook

* Lint

* lint

* Fix link

* Reduce to 1 section

* Lint

* fix

* Fix
2024-03-11 13:40:02 +00:00
weigaryandGitHub dcc2e916af Update the serving docker image to include the latest fixes for image-inpainting. (#2766)
* Add a stable diffusion playground based on Gradio UI.

* Add codeowner.

* Update the serving docker image to include the latest fixes for image-inpainting.
2024-03-11 13:38:57 +00:00
weigaryandGitHub b5f4ddf577 Some minor fixed to the stable-diffusion-gradio notebook. (#2767) 2024-03-11 13:38:19 +00:00
Mend RenovateandGitHub f29b1d785b chore(deps): update dependency nbqa to v1.8.4 (#2764) 2024-03-11 13:36:59 +00:00
ethan-gordonandGitHub ae01b4c85f Vertex AI Feature Store Notebook, Feature View Service Agent (#2752)
* Add files via upload

* Update vertex_ai_feature_store_feature_view_service_agents.ipynb
Update CODEOWNERS
2024-03-09 14:25:41 +00:00
Katie NguyenandGitHub eefda026b1 Fix: edit branding errors in variable names (#2765)
* fix: edit branding errors in variable names

* fix: add model registry variable names
2024-03-08 01:33:54 +00:00
weigaryandGitHub f9608b8ac0 Add a stable diffusion playground based on Gradio UI. (#2763)
* Add a stable diffusion playground based on Gradio UI.

* Add codeowner.
2024-03-07 16:14:42 +00:00
KCFindstrandGitHub 4dd5bfa621 Fix corrupted vllm.patch file due to merge conflicts not be resolved correctly (#2761)
* Fix corrupted vllm.patch file due to merge conflicts not be resolved correctly

* Update CODEOWNERS of vllm
2024-03-07 16:13:46 +00:00
KCFindstrandGitHub 5b72579e51 Update Gemma low-code finetuning notebooks (#2762)
* Update Gemma low-code finetuning notebooks

* Fix invalid params due to the formatter
2024-03-07 16:13:04 +00:00
KCFindstrandGitHub 73122731a9 Update Model Garden vllm serving docker script and dockerfile (#2758)
* Update vllm serving docker script and dockerfile

* Add vllm to community content CODEOWNERS

* Update vllm serving docker script and dockerfile

* Update vllm serving docker script and dockerfile
2024-03-06 20:47:56 +00:00
dstnluong-googleandGitHub 986aaa408f Set max model len (#2757)
* switch llama2 deploymente notebook to lowcode version

* add moderate text link and lint

* lint

* Set gpu utilization

* Add --max-num-batched-tokens=4096

* Set max model len

* move prints in function

* lint

* Remove comment

* Fix link
2024-03-06 19:52:01 +00:00
Kathy YuandGitHub 60810269ad Update vLLM dockerfile. (#2759) 2024-03-06 19:50:50 +00:00
dstnluong-googleandGitHub fedde5da76 Create separate deployment only notebook for SD1.5 (#2750)
* SD notebook

* lintlint

* codeowners

* number to integer
2024-03-06 19:27:45 +00:00
Mend RenovateandGitHub 613258940e chore(deps): update dependency nbqa to v1.8.3 (#2756) 2024-03-04 15:34:44 +00:00
weigaryandGitHub 59a337e3cb Rewrite the SDXL - vertex serving notebook for the low-code user experience. (#2753) 2024-03-01 02:09:42 +00:00
Huguens JeanandGitHub ea2068bc00 Add camp zipnerf jax implementation to model garden. (#2754) 2024-03-01 02:08:28 +00:00
dstnluong-googleandGitHub 4e13f317e8 Modify llama2 deployment notebook to be lowcode (#2755)
* switch llama2 deploymente notebook to lowcode version

* add moderate text link and lint

* lint
2024-03-01 02:07:22 +00:00
jismailyan-googleandGitHub 9db64f74a2 refactor: Simplify Pic2Word notebook steps (#2751)
* refactor: Simplify Pic2Word notebook steps

* fix: linter

* fix: Fix inference issue
2024-02-28 22:05:33 +00:00
Michael HuandGitHub b4b20c3995 Make optional section ending more obvious in AutoSxS notebooks (#2748)
* Make it clear when optional section ends in AutoSxS

* run formatter and linter

* fix component names

* update xsum sample
2024-02-28 22:04:11 +00:00
kittyabsandGitHub d7a9ea8eed Edited "Vertex AI: Track artifacts and metrics across Vertex AI Pipelines runs using Vertex ML Metadata. No impact to code (#2749) 2024-02-27 21:23:48 +00:00
3fb37b5f35 Fix fvlm dockerfiles. (#2747)
Co-authored-by: minwoopark <minwoopark@google.com>
2024-02-26 21:46:48 +00:00
kittyabsandGitHub 92c1e27c50 Edited "Tabular Workflow for Forecasting". No impact on code. (#2726) 2024-02-26 21:46:15 +00:00
weigaryandGitHub a1695d47d9 Update the docker image version to 20240223_1230_RC00 to fix the image quality issue associated with DPMSolverMultistepScheduler. (#2744)
* Pin the `pytorch-diffusers-serve-opt` docker image to `20231213_0836_RC00`.

* Update 4 stable diffusion notebooks to use the optimized serving container, including controlnet, instruct-pix2pix, text-to-video, text-to-video-zero-shot.

* Fix linter error.

* Update the docker image version to 20240223_1230_RC00 to fix the image quality issue associated with DPMSolverMultistepScheduler.
2024-02-26 20:29:26 +00:00
Alok PattaniandGitHub df3e2d4889 Adding EDA with R and BigQuery notebook for update to Cloud Architecture Center guide (#2745)
* Create test

* Adding updated notebook for EDA with R & BigQuery

* Delete notebooks/community/exploratory_data_analysis/test

* Update CODEOWNERS
2024-02-24 14:07:00 +00:00
kittyabsandGitHub c1d1e23cd0 Added missing link and made other edits to "Custom training with pre-built Google Cloud Pipeline Components". No impact on code (#2710)
* Added missing link and made other edits to "Custom training with pre-built Google Cloud Pipeline Components". No impact on code

* Update custom_model_training_and_batch_prediction.ipynb

fixed typo
2024-02-23 20:16:58 +00:00
kittyabsandGitHub c837c4367d Vertex-ai-training-typo-3 (#2742)
* Changed "Vertex AI training" to "Vertex AI Training

* changed "Vertex AI training" to "Vertex AI Training"
2024-02-23 20:13:13 +00:00
kittyabsandGitHub d4a422da2d Edit "Using Vertex AI Multimodal Embeddings and Vector Search". Updated links to point to new directory /vector-search/. No impact on code (#2728) 2024-02-23 20:11:24 +00:00
weigaryandGitHub 78dacd7652 Update 4 stable diffusion notebooks to start using the optimized serving dock image. (#2727)
* Pin the `pytorch-diffusers-serve-opt` docker image to `20231213_0836_RC00`.

* Update 4 stable diffusion notebooks to use the optimized serving container, including controlnet, instruct-pix2pix, text-to-video, text-to-video-zero-shot.

* Fix linter error.
2024-02-23 18:50:43 +00:00
KCFindstrandGitHub d558e7d101 Allow selecting accelerator in the #Gemma Vertex finetuning notebook and update the predict section (#2743) 2024-02-23 02:03:36 +00:00
Huguens JeanandGitHub 8394c2317d Update Bytetrack video object tracking notebook with AutoML IOD deployment. (#2721) 2024-02-22 22:28:03 +00:00
kittyabsandGitHub 485648c0b1 Edited "Get started with Vertex AI Experiments". Changed "Vertex AP training" to "Vertex AI "Training," and remove back ticks from "Vertex AI Training" in one case where it shouldn't have been. (#2741) 2024-02-22 22:25:01 +00:00
kittyabsandGitHub 3d0a0e23e2 Changed "Vertex AI training" to "Vertex AI Training" (#2740) 2024-02-22 22:24:37 +00:00
Bo zhengandGitHub 00028dee95 feat: Replace evaluation pipeline with Vertex SDK evaluate function on automl_text_classification_model_evaluation.ipynb (#2719)
* feat: Replace evaluation pipeline with Vertex SDK evaluate function on automl_text_classification_model_evaluation.ipynb

* Add automl-text-classification-evaluation-image

* Manually change notebook to test lint locally

* Format lint
2024-02-22 21:27:50 +00:00
kittyabsandGitHub afb501a116 Changed "Vertex AI training" to "Vertex AI Training (#2739) 2024-02-22 21:25:39 +00:00
KCFindstrandGitHub 56924aa804 Update ModelGarden Gemma finetuning and delpoyment notebooks on Vertex (#2738) 2024-02-22 18:34:53 +00:00
dstnluong-googleandGitHub 839cc67a5a Add 3 SD 1.5 finetuning notebooks. (#2724)
* Add 3 SD 1.5 finetuning notebooks.

* Lint
2024-02-22 18:24:40 +00:00
kittyabsandGitHub 3eb9c4af53 Edited "Vertex AI: Create, train, and deploy an AutoML text classification model" Updated URLS. (#2725) 2024-02-22 17:53:51 +00:00
kittyabsandGitHub 34d941c52c Made edits to "Vertex AI SDK for Python: AutoML Tabular training and prediction". No impact on code (#2722) 2024-02-22 17:53:20 +00:00
kittyabsandGitHub 1da787a325 Edited "Using Vertex AI Vector Search for StackOverflow Questions." Updated links to avoid redirects. Fixed one link that was due to a failed redirect and yielded a 404. No impact on code (#2729) 2024-02-22 17:52:55 +00:00
kittyabsandGitHub 55dcba8883 Edited "Using Vertex AI Vector Search and Vertex AI embeddings for text for StackOverflow Questions" Fixed one URL to remove redirect. (#2734) 2024-02-22 17:52:37 +00:00
kittyabsandGitHub 5b3492f3ab Edited "Create Vertex AI Vector Search index". Updated a URL to avoid a redirect. No impact on code (#2735) 2024-02-22 17:52:08 +00:00
kittyabsandGitHub 452a270a4e Changed "Vertex AI training" to "Vertex AI Training" (#2737) 2024-02-22 17:51:18 +00:00
Kathy YuandGitHub 97a677c08d Update Gemma deployment and finetuning notebook descriptions. (#2733) 2024-02-21 14:11:52 +00:00
Laurent PicardandGitHub 8e7e5138a7 Add Gemma KerasNLP finetuning Vertex AI deployment notebook (#2732) 2024-02-21 13:49:04 +00:00
kittyabsandGitHub 6cd96394f7 Made edits to "Get started with Vertex AI Experiments. Updated URL to point to new location of doc. Code not impacted. (#2697) 2024-02-21 13:19:22 +00:00
KCFindstrandGitHub dd75908741 Add #ModelGarden Gemma finetuning and deployment notebooks (#2730) 2024-02-21 04:11:51 +00:00
KCFindstrandGitHub 9b72294cf1 Add mistral and mixtral model fine-tuning notebooks (#2716) 2024-02-20 15:18:57 +00:00
Huguens JeanandGitHub 1439a364e0 Unify the model name as MODEL_ID in related containers and notebooks. (#2720) 2024-02-20 15:17:32 +00:00
Mend RenovateandGitHub 4b2724ccbe chore(deps): update dependency pyupgrade to v3.15.1 (#2718) 2024-02-20 15:15:49 +00:00
Kelsi LakeyandGitHub ddf3d1c73b Fix errors in get_started_with_vertex_experiments.ipynb (#2717)
* Update get_started_with_vertex_experiments.ipynb

Fix several errors preventing notebook from being run out of the box, namely the custom job container image.

* Update get_started_with_vertex_experiments.ipynb

* Update get_started_with_vertex_experiments.ipynb

* Update get_started_with_vertex_experiments.ipynb

* Update get_started_with_vertex_experiments.ipynb

* Update CODEOWNERS

* Update get_started_with_vertex_experiments.ipynb
2024-02-20 15:15:12 +00:00
weigaryandGitHub 8d9e2cecf9 Update the stable-diffusion-upscaler notebook to use the optimized serving containder. (#2714)
* Update the link of how to request TPU v5e quota in the notebook.

* Create a notebook to demonstrate how to load a thrid-party stable diffusion model, on Vertex AI for online prediction.

* Add codeowner.

* add code owner.

* Make stable_diffusion_xl_turbo a separate notebook.

* Update the `stable-diffusion-upscaler` notebook to use the optimized serving containder.
2024-02-20 15:14:00 +00:00
Kavitha RajendranandGitHub 1ad4c0331f Detect anomalies in Cloud Audit Logs using BQML models (#2709)
* Adding a notebook to detect anomalies in Cloud Audit Logs with BQML models

* cleaned up version

* incorporated review comments
2024-02-17 15:14:43 +00:00
Ivan NardiniandGitHub cb2b1a19c3 feat: ray on vertex - torch sample (#2711)
* add rov torch sample

* update codeowners

* add gericdong review

* linter passed
2024-02-17 15:07:22 +00:00
weigaryandGitHub 6fb5c2ea04 Make stable_diffusion_xl_turbo a separate notebook. (#2713)
* Update the link of how to request TPU v5e quota in the notebook.

* Create a notebook to demonstrate how to load a thrid-party stable diffusion model, on Vertex AI for online prediction.

* Add codeowner.

* add code owner.

* Make stable_diffusion_xl_turbo a separate notebook.
2024-02-16 21:04:49 +00:00
weigaryandGitHub ddcd08fb0b Create a notebook to demonstrate how to load a thrid-party stable diffusion model, on Vertex AI for online prediction. (#2708)
* Update the link of how to request TPU v5e quota in the notebook.

* Create a notebook to demonstrate how to load a thrid-party stable diffusion model, on Vertex AI for online prediction.

* Add codeowner.

* add code owner.
2024-02-16 14:53:41 +00:00
dstnluong-googleandGitHub f272ca4796 Update quantization docker for LLaMA2 (#2707) 2024-02-16 01:21:17 +00:00
Aiden010200andGitHub df9192d0c2 Upload batch prediction job sample (#2705)
* Upload examples of kfp v2

* Upload run experiment example.

* Upload batch prediction job sample.
2024-02-16 01:20:36 +00:00
kittyabsandGitHub 23b90796ea Made edits to "Vertex AI Pipelines: pipeline control structures using the KFP SDK," which includes updated the KFP URL and adding a missing URL to "Enable the Vertex AI API". No impact to code. (#2706) 2024-02-14 16:55:02 +00:00
Mend RenovateandGitHub c03b43b79b chore(deps): update dependency black to v24.2.0 (#2702) 2024-02-14 16:54:07 +00:00
kittyabsandGitHub 731b456c2f Edited "Vertex AI TensorBoard custom training with prebuilt container" No impact on code. (#2704) 2024-02-14 16:53:33 +00:00
weigaryandGitHub 130c621df7 Update the link of how to request TPU v5e quota in the notebook. (#2703)
* Update the link of how to request TPU v5e quota in the notebook.

* Create a notebook to demonstrate how to load a thrid-party stable diffusion model, on Vertex AI for online prediction.

* Delete notebooks/community/model_garden/model_garden_pytorch_stable_diffusion_custom.ipynb

move it to a separate commit
2024-02-14 16:52:51 +00:00
kittyabsandGitHub 87c43c0231 Made edits to "Vertex AI TensorBoard custom training with custom container". Fixed typos and cleaned up content. No impact on code (#2701)
* Made edits to "Vertex AI TensorBoard custom training with custom container". Fixed typos and cleaned up content. No impact on code

* Update tensorboard_custom_training_with_custom_container.ipynb

Deleted empty cell.
2024-02-14 16:52:13 +00:00
2e8dc70079 Remove eval_dataset from RLHF tuning parameters. (#2700)
We temporarily disabled this parameter for first-party models, so this will avoid validation errors when running the RLHF tuning notebook in the meantime.

Co-authored-by: Ryan Latture <latture@google.com>
2024-02-14 16:50:48 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
e712fe3503 chore(deps): bump pillow (#2699)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.0.1 to 10.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.0.1...10.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-14 16:50:02 +00:00
Huguens JeanandGitHub 39da99a8bb Open source pytorch zipnerf model garden dockers. (#2696) 2024-02-12 15:14:01 +00:00
weigaryandGitHub 13de238a84 Add a notebook for SDXL - lora serving (#2691)
* Add a notebook with example on deploying SDXL model on TPU v5e

* Add a notebook for SDXL - lora serving

* Add code owners
2024-02-12 15:12:48 +00:00
kittyabsandGitHub 080674024b Made edits to "Vertex AI Experiments: Custom training autologging - Local script" and added link to relevant documentation. No impact on code (#2698) 2024-02-12 15:06:47 +00:00
kittyabsandGitHub f348edb56e Made edits to "Delete Outdated Experiments in Vertex AI TensorBoard". Updated URL(s). (#2695) 2024-02-12 15:05:21 +00:00
dstnluong-googleandGitHub 5c4bfa0979 Fix upscaler notebook (#2694) 2024-02-12 15:04:05 +00:00
cac8896a80 Increase default max-num-batched-tokens to 16385 for larger models. (#2689)
Co-authored-by: minwoopark <minwoopark@google.com>
2024-02-12 15:03:09 +00:00
kittyabsandGitHub 5ca8adca08 Numerous edits to "Vertex AI SDK: AutoML training video classification model for batch prediction". Does not impact code. (#2688)
* Numerous edits to "Vertex AI SDK: AutoML training video classification model for batch prediction". Does not impact code.

* Update sdk_automl_video_classification_batch.ipynb

deleted "a"
2024-02-09 18:53:29 +00:00
weigaryandGitHub a9e2d4e7c4 Pin the pytorch-diffusers-serve-opt docker image to 20231213_0836_RC00. (#2692) 2024-02-09 14:31:37 +00:00
kittyabsandGitHub aa9ce6a6fb Made edits to "Vertex AI TensorBoard hyperparameter tuning with the HParams Dashboard" and updated URL to go to more relevant document. (#2690) 2024-02-09 14:09:04 +00:00
kittyabsandGitHub c51c52c03f Change url for viewing TensorBoard data. (#2687) 2024-02-09 14:07:58 +00:00
Michael HuandGitHub 163b66d3e7 Update Prophet and ARIMA notebook GCPC versions (#2658)
* Update Prophet and ARIMA notebook GCPC versions

Also, move ARIMA notebook back into official.

* Delete comparison with Vertex Forecasting

* Disable caching

* Rename
2024-02-08 21:41:58 +00:00
Thomas Le moullecandGitHub 2d960509f6 Mistral 7B Finetuning with QLora (#2645)
* Mistral 7B Finetuning with QLora

Need to fix the PEFT Train docker image for the finetuning step. 
Merging works correctly with the docker image, You might face an error when merging if the peft version used for merging is different from the one used for finetuning (new field added in the config_adapter file)

* Update peft docker train image to 20240126_0936_RC00

* Linter OK

* updated the notebook with pull requests comments

* Remove HPT and updated the bucket URI

* Linter update
2024-02-08 18:19:40 +00:00
Lav RaiandGitHub 2bf37e86fb Autogluon source (#2685)
* Add AutoGluon source files.

* Add AutoGluon source files.
2024-02-08 15:25:38 +00:00
bb274e4040 Support DITO training (#2683)
Co-authored-by: minwoopark <minwoopark@google.com>
2024-02-08 15:23:34 +00:00
kittyabsandGitHub 34abfec74c Made edits to "Vertex AI TensorBoard integration with Vertex AI Pipelines". I also updated the section on viewing and comparing pipeline runs to point to new documentation. (#2684)
* Made edits to "Vertex AI TensorBoard integration with Vertex AI Pipelines". I also updated the section on viewing and comparing pipeline runs to point to new documentation.

* Update tensorboard_vertex_ai_pipelines_integration.ipynb

A few more small fixes. Trying to find source of lint error

* Update tensorboard_vertex_ai_pipelines_integration.ipynb

removed empty cells
2024-02-08 14:29:53 +00:00
kittyabsandGitHub 49f2f12ea2 Fixed typos and rewrote some sentences to make them clearer. Be sure to check that I didn't change the meaning or intent. No code impacted (#2680) 2024-02-07 15:17:35 +00:00
Huguens JeanandGitHub 306c4fa8f4 Update model deployment function with serving_container_environment_variables. (#2675) 2024-02-06 22:03:02 +00:00
kittyabsandGitHub 0964e7f0da Updated link to Vertex AI TensorBoard profiler page, which had been moved. Other edits to align with guidelines (#2676) 2024-02-06 22:01:30 +00:00
dstnluong-googleandGitHub 8e1d91e2c2 Fix URI (#2677) 2024-02-06 22:01:06 +00:00
Bo zhengandGitHub 26001062b7 feat: Replace evaluation pipeline with Vertex SDK evaluate function on model evaluation notebooks (#2610)
* Replace evaluation pipeline with evaluate function

* Replace evaluation pipeline with evaluate function on automl_tabular_regression_model_evaluation.ipynb

* Replace evaluation pipeline with evaluate function on custom_tabular_classification_model_evaluation.ipynb

* Replace evaluation pipeline with evaluate function on custom_tabular_regression_model_evaluation.ipynb

* Replace evaluation pipeline with evaluate function on automl_video_classification_model_evaluation.ipynb

* Format automl_tabular_classification_model_evaluation.ipynb

* Format automl_tabular_regression_model_evaluation.ipynb

* Format automl_video_classification_model_evaluation.ipynb

* Format custom_tabular_classification_model_evaluation.ipynb

* Format custom_tabular_regression_model_evaluation.ipynb

* Add files via upload

* Update screenshot for notebooks with evaluate function usage

* Revert custom_tabular_classification_model_evaluation.ipynb

* Format lint

* manual fix lint
2024-02-06 00:25:15 +00:00
siping-huandGitHub 56656f2225 Add notebooks for autosxs (model based llm evaluation) (#2659)
* Create model_based_llm_evaluation folder

* Add autosxs sample notebooks.

* Update autosxs sample notebooks.

* Update CODEOWNERS for autosxs

* Fix lint and format.

* Resolve Michael's comments.

* Fix test failures.

* Fix test errors and resolve Eric's comments.

* Update autosxs_llm_evaluation_for_summarization_task.ipynb

* Update autosxs_llm_evaluation_for_summarization_task.ipynb

* Update autosxs_llm_evaluation_for_summarization_task.ipynb

* Update autosxs_llm_evaluation_for_summarization_task.ipynb

* Update autosxs_llm_evaluation_for_summarization_task.ipynb

* Fix isort.

* Fix nbfmt
2024-02-06 00:22:16 +00:00
kittyabsandGitHub 684285d4f1 Update URL to go directly to /training/... (#2674) 2024-02-06 00:19:20 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
a898bf8aad chore(deps): bump fastapi (#2673)
Bumps [fastapi](https://github.com/tiangolo/fastapi) from 0.75.2 to 0.109.1.
- [Release notes](https://github.com/tiangolo/fastapi/releases)
- [Commits](https://github.com/tiangolo/fastapi/compare/0.75.2...0.109.1)

---
updated-dependencies:
- dependency-name: fastapi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-05 18:11:03 +00:00
weigaryandGitHub 60b49d8419 Add a notebook with example on deploying SDXL model on TPU v5e (#2672) 2024-02-05 17:42:31 +00:00
8b55dada76 Dealing with numerous text edits. Does not impact code (#2670)
* Update get_started_with_vertex_experiments_autologging.ipynb

Added link in "Learn more about..." to the Vertex AI Experiments intro page. Currently, this notebook is not showing up properly in the Jupyter SDK Tutorial page.

* Update get_started_with_vertex_experiments_autologging.ipynb

* Update notebook_template_review.py

Missing left curly bracket/brace 2xs 
(Note, commented out, but still fixing)
 #'AutoML Vision': '{automl_vision_name}}',
 #'AutoML Image': '{automl_vision_name}}',

* Update get_started_with_vertex_experiments_autologging.ipynb

Needed to add a period.

* fix: update spacing

---------

Co-authored-by: Katie Nguyen <katiemn@gmail.com>
2024-02-02 17:05:24 +00:00
dstnluong-googleandGitHub f18c851428 Fix Lama URI (#2671)
* LaMa notebook

* lint

* codeowners

* update

* lint

* Fix indentation issue

* fix URI
2024-02-02 14:23:57 +00:00
Huguens JeanandGitHub a78b5ce878 Search for the MODEL_ID env and set it in the deployment function for… (#2669)
* Search for the MODEL_ID env and set it in the deployment function for all model garden notebooks for pre-trained and tuned models.

* Fix model_garden_pytorch_stable_video_diffusion_img2vid_xt notebook linter issue with load_image and HTML.

* Fix model_garden_pytorch_stable_video_diffusion_img2vid_xt notebook linter issue with load_image and HTML.

* Fix missing MODEL_ID in model_garden_mediapipe_image_generation.ipynb.
2024-02-02 14:21:29 +00:00
kittyabsandGitHub a9aea28b37 Update get_started_with_bqml_training.ipynb (#2666)
Remove "back ticks" around product/service names. Fix typos.
2024-02-02 14:12:31 +00:00
kittyabsandGitHub 0cb84572ba Update tensorboard_profiler_custom_training.ipynb (#2665)
Text edits: Removed `...` from product names and made other edits. Code not impacted
2024-02-02 14:11:18 +00:00
kittyabsandGitHub 764b7a5cc8 Update comparing_pipeline_runs.ipynb (#2664)
* Update comparing_pipeline_runs.ipynb

Needed edits for the page. Does not impact code.

* Update comparing_pipeline_runs.ipynb

responded to katie's feedback.
2024-02-02 14:10:18 +00:00
zbl94andGitHub 94294de17c feat: Vertex AI Feature Store Based LLM Grounding Tutorial (#2652)
* feat: Vertex AI Feature Store Based LLM Grounding Tutorial

* fix: fix the feature store based llm grounding tutorial based on a few comments

* fix: fix the feature store based llm grounding tutorial based on a few comments

* fix: move the fs grounding notebook to official

* fix: comment colab only code

* fix: fix pipeline prefix

* fix: resolve several comments

* fix: resolve several comments

* fix: a quick fix for type

* fix: a quick fix for import

* fix: a quick fix for colab
2024-02-01 22:06:34 +00:00
d9d3be36f9 Support CodeLlama 70B models. (#2667)
Co-authored-by: minwoopark <minwoopark@google.com>
2024-02-01 18:10:12 +00:00
kittyabsandGitHub 48f1a43efc Update sdk-custom-image-classification-batch.ipynb (#2662)
Removed tick marks from product names so they don't render as code.
2024-01-31 21:55:26 +00:00
kittyabsandGitHub 64417df16a Update tensorboard_vertex_ai_pipelines_integration.ipynb (#2663)
Fixing typo: "monitorning" -> "monitoring"
2024-01-31 21:53:59 +00:00
dstnluong-googleandGitHub 165d58f328 Fix indentation in LaMa notebook (#2661)
* LaMa notebook

* lint

* codeowners

* update

* lint

* Fix indentation issue
2024-01-31 19:42:43 +00:00
Shikanime DevaandGitHub bb2085a95d Add Peft additional parameters (#2657) 2024-01-31 16:12:34 +00:00
kittyabsandGitHub 5cd844f2dd Small edit - first time making a change to a github sample. (#2660) 2024-01-30 21:00:18 +00:00
Lehui LiuandGitHub 4b455390f6 feat: add sample notebook for vertex distillation (#2656) 2024-01-30 01:29:29 +00:00
Mend RenovateandGitHub d5f90ce6de chore(deps): update dependency black to v24.1.1 (#2654) 2024-01-30 01:17:16 +00:00
Aiden010200andGitHub 4ede21cccd Upload run experiment example (#2653)
* Upload examples of kfp v2

* Upload run experiment example.
2024-01-29 15:36:10 +00:00
weigaryandGitHub 16bf0a8813 Update/optimize the serving efficiency of the image-inpainting model. (#2650) 2024-01-26 19:04:55 +00:00
Mend RenovateandGitHub c7fb10d374 chore(deps): update dependency black to v24 (#2651) 2024-01-26 19:03:13 +00:00
dstnluong-googleandGitHub e700dbbad3 Add LaMa Notebook to Vertex MG (#2648)
* LaMa notebook

* lint

* codeowners

* update

* lint
2024-01-25 17:40:59 +00:00
Katie NguyenandGitHub 0a082b4c07 fix: update links to official notebook (#2647) 2024-01-25 17:39:03 +00:00
Lav RaiandGitHub ad947ea952 Add AutoGluon notebook. (#2649) 2024-01-25 17:38:17 +00:00
dstnluong-googleandGitHub 7d7db7d2d7 Separate hp tuning from llama notebook. (#2641)
* Separate notebook

* lint

* add codeowners

* Remove unused import

* Merge with pipeline addition.

* Remove prediction from hptuning nb.
2024-01-24 22:27:05 +00:00
Erick De Santiago AnayaandGitHub 884d649434 Update model_garden_video_object_tracking_serve.ipynb (#2646)
The model it's expecting a number instead of a boolean value
2024-01-24 20:52:40 +00:00
61789574c0 feat: Document how to get predictions from tuned 1P and 3P models. (#2642)
1P models should use Online or Batch Prediction. 3P models should use the Bulk Inference pipeline.

Co-authored-by: Ryan Latture <latture@google.com>
2024-01-24 20:51:02 +00:00
Matthew TangandGitHub 0ea0c04195 [Vertex AI SDK] Add custom serializer args for bigframes tensorflow (#2633)
* Add custom serializer args for bigframes tensorflow

* Add custom serializer args for remote prediction
2024-01-24 20:47:02 +00:00
Katie NguyenandGitHub 556cbe7049 fix: update API call in triton client (#2644) 2024-01-24 20:45:48 +00:00
jismailyan-googleandGitHub b695dc7631 Move and update pipeline finetuning section. (#2640)
* Add a section documenting the one-click finetuning
button in the Model Card UI.

The section explains how to use the button,
what the pipeline does and some troubleshooting
tips.

* Edit one-click finetuning instructions for clarity
and syntax.

* Correct 'Tensorboard' to 'TensorBoard'

* Updated finetuning pipeline instructions to
include steps on launching the pipeline via the
Vertex SDK.

* Added more parameters to the pipeline command
example. Moved the section down.

* Remove unintentional character interpolation

* Removed changes

* Undo formatting

* Remove old version of finetuning pipeline section

* Only allow huggingface datasets with the
finetuning pipeline.

* Fix linter issues
2024-01-23 18:43:35 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
f8f2f35920 chore(deps): bump pillow (#2639)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.0.1 to 10.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.0.1...10.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 18:42:07 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3c6198f8bc chore(deps): bump pillow (#2638)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.0.1 to 10.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.0.1...10.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 18:41:39 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3ed1f26dab chore(deps): bump pillow (#2637)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.0.1 to 10.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.0.1...10.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 18:41:09 +00:00
3507602da1 feat: add llava 1.5 docker and notebook. (#2636)
Co-authored-by: Pooya Moradi <pooyam@google.com>
2024-01-23 18:40:22 +00:00
Amy WuandGitHub 0cae18cfba feat: Add Ray on Vertex AI cluster management sample (#2634)
* feat: Add Ray on Vertex cluster management sample

* fix: lint

* fix: vpc

* fix: python version

* fix: scale up

* fix: lint

* fix: clean up

* fix: update notebook

* fix: docs

* fix: docs

* fix: links
2024-01-23 18:25:25 +00:00
Aiden010200andGitHub e735195230 Upload examples of kfp v2 (#2627) 2024-01-18 19:08:49 +00:00
Kathy YuandGitHub c8f95d2121 Update Mixtral vLLM container and support OpenAI vLLM server. (#2630) 2024-01-18 19:06:48 +00:00
Huguens JeanandGitHub b679b3d72d Added individual download links for mipnerf360 dataset. (#2631) 2024-01-18 19:06:04 +00:00
joiceyeandGitHub c52ce038f6 notebook for stable video diffusion img2vid xt (#2626) 2024-01-15 15:15:18 +00:00
35f42fd9fc fix: Update RLHF large_model_reference to match text. (#2625)
Co-authored-by: Ryan Latture <latture@google.com>
2024-01-15 15:13:09 +00:00
jismailyan-googleandGitHub 252093ddf3 Add Fine-tuning Pipeline button instructions to Llama2 PEFT notebook (#2621)
* Add a section documenting the one-click finetuning
button in the Model Card UI.

The section explains how to use the button,
what the pipeline does and some troubleshooting
tips.

* Edit one-click finetuning instructions for clarity
and syntax.

* Correct 'Tensorboard' to 'TensorBoard'
2024-01-12 18:23:03 +00:00
Alicia WilliamsandGitHub 722a8cfe4c Update bq_ml_with_vision_translation_nlp.ipynb (#2624)
Update dataset links
2024-01-11 21:07:21 +00:00
weigaryandGitHub c9d4a27cff Update the SD notebooks using the new pytorch-diffusers-serve-opt container. (#2597)
* Update staable-diffusion 1.5 and XL notebooks to deploy with default GPU as L4, instead of A100.

* Update the SD notebooks using the new  container.

* Delete notebooks/community/model_garden/model_garden_pytorch_stable_diffusion_xl_1_0.ipynb

Resolve the merge conflict.

* Resolve the merge conflict.
2024-01-10 19:57:25 +00:00
Mend RenovateandGitHub 97de848e13 chore(deps): update dependency flake8 to v7 (#2612) 2024-01-10 15:33:50 +00:00
Mend RenovateandGitHub dea762c54a chore(deps): update dependency black to v23.12.1 (#2608) 2024-01-10 15:33:04 +00:00
Mend RenovateandGitHub e8ed4c3fd9 chore(deps): update actions/setup-python action to v5 (#2569) 2024-01-10 15:21:37 +00:00
Katie NguyenandGitHub 00b4598734 fix: lowercase hyperparameter tuning (#2616) 2024-01-10 15:06:00 +00:00
Katie NguyenandGitHub f5ccb578f4 fix: lowercase custom training (#2617) 2024-01-10 15:05:20 +00:00
Katie NguyenandGitHub cacbdbcf93 fix: lowercase maintenance (#2618) 2024-01-10 15:04:33 +00:00
Katie NguyenandGitHub 7737a98ec9 fix: lowercase hyperparameter tuning within text cells (#2619) 2024-01-10 15:03:51 +00:00
Ivan NardiniandGitHub 745bd03644 feat: adding Vertex AI Deployer notebook (#2613)
* adding vertexai deployer notebook

* linter test passed

* adding codeowners

* eric review

* linter test passed
2024-01-10 15:02:36 +00:00
Huguens JeanandGitHub c502dee709 Adding Pytorch-ZipNeRF notebook to Vertex AI samples model garden. (#2615)
* Adding Pytorch-ZipNeRF notebook to Vertex AI samples model garden.

* Format and lint Pytorch-ZipNeRF notebook.
2024-01-08 18:56:16 +00:00
KCFindstrandGitHub a1e0012df0 Add #ModelGarden Wizard LM notebook (#2614) 2024-01-08 18:54:46 +00:00
Douglass ChenandGitHub 9f6f46d56e Fix ready_to_go text classification pipeline notebook (#2609)
* Code fix, specify that old version of components library must be used

* reformat

* fix workbench url
2024-01-08 18:52:54 +00:00
Katie NguyenandGitHub f90d4f59c0 fix: lowercase distributed training (#2606) 2023-12-22 02:25:43 +00:00
Katie NguyenandGitHub 3e31d830c6 fix: lowercase batch prediction (#2605) 2023-12-21 23:36:18 +00:00
Katie NguyenandGitHub c0607f46ba fix: update name to cloud profiler (#2604) 2023-12-21 21:39:09 +00:00
Katie NguyenandGitHub b67cccb91a fix: update video workbook title (#2602) 2023-12-21 13:15:14 +00:00
Katie NguyenandGitHub 70db60129a fix: update workbook title (#2601) 2023-12-20 22:23:48 +00:00
Kathy YuandGitHub a185e106e0 Switch API for launching evaluation jobs and make bug fixes. (#2598)
* Switch API for launching evaluation jobs and make bug fixes.

* Fix linter issues.
2023-12-19 14:15:54 +00:00
dstnluong-googleandGitHub 38a1367fb8 Fix typos in Vicuna and Openllam Notebook. (#2594) 2023-12-15 19:50:53 +00:00
KCFindstrandGitHub f991f868d2 Add #ModelGarden wizard coder notebook. (#2595) 2023-12-15 19:49:56 +00:00
Eric DongandGitHub 813547b8fd fix: bad link to PaLM (#2596) 2023-12-15 16:06:41 +00:00
Kathy YuandGitHub 6cac1b2456 Add Mixtral 8x7B to Mistral notebook. (#2584) 2023-12-14 19:49:24 +00:00
Mend RenovateandGitHub f23cade8a6 chore(deps): update dependency isort to v5.13.2 (#2576) 2023-12-14 15:33:40 +00:00
Mend RenovateandGitHub 45520e9c06 chore(deps): update dependency nbqa to v1.7.1 (#2549) 2023-12-14 15:32:58 +00:00
Mend RenovateandGitHub 903c964487 chore(deps): update dependency black to v23.12.0 (#2470) 2023-12-14 15:32:16 +00:00
Mend RenovateandGitHub a3bb4afe06 chore(deps): update python docker tag to v3.12 (#2315) 2023-12-14 15:14:09 +00:00
f242e348c4 Document RLHF and inference pipelines support chat-bison@001. (#2577)
This adds `chat-bison@001` to the table of supported models and documents chat dataset formats for relevant input parameters.

Co-authored-by: Ryan Latture <latture@google.com>
2023-12-13 21:54:45 +00:00
weigaryandGitHub 8d47ab03c7 Add a new notebook for sdxl LCM (#2582)
* Add SDXL-turbo as a separate section in the SDXL notebook.

* Add SDXL-turbo as a separate section in the SDXL notebook.

* Add a new notebook for sdxl LCM
2023-12-13 21:50:35 +00:00
e8b86f503f Use open source detectron2 docker. (#2583)
Co-authored-by: minwoopark <minwoopark@google.com>
2023-12-13 21:48:35 +00:00
dstnluong-googleandGitHub 9449785b20 Switch TFvisio docker URIs to use vertex-ai (#2280) 2023-12-13 21:47:41 +00:00
genquan9andGitHub ac4f63b4e0 remove old vertex_vision_model_garden folder (#2570) 2023-12-13 19:56:38 +00:00
weigaryandGitHub 65ee5cdf52 Sd turbo (#2572)
* Add SDXL-turbo as a separate section in the SDXL notebook.

* Add SDXL-turbo as a separate section in the SDXL notebook.
2023-12-13 19:52:24 +00:00
dstnluong-googleandGitHub 90219e0a76 Add GPTQ to Falcon Instruct (#2574)
* Add local inference for Falcon Instruct

* Lint

* Add memory necessary for falcon 7b

* nit: Typo

* add gptq quantization to falcon

* lint

* typo

* Comment out one setting.
2023-12-13 19:49:39 +00:00
dstnluong-googleandGitHub d2ad1dd763 Add cache_examples_on_gpu flag to GPTQ. (#2579)
* Add cache_examples_on_gpu flag to GPTQ.

* Lower GPU suggestions for 70b model.

* Lower GPU suggestions for 70b.

* Typo
2023-12-13 19:47:07 +00:00
Kathy YuandGitHub b2ec0e956e Update timm notebook to use vertex-ai docker link. (#2580) 2023-12-13 19:45:01 +00:00
dstnluong-googleandGitHub 7fb60acf89 Create 5 separate notebooks from LLaMA2 notebook sections (#2568)
* add deployment notebook

* lint

* add finetune notebook

* lint

* lint

* add evaluation notebook

* lint

* add rlhf notebook

* lint

* lint rlhf notebook?

* add notebooks to codeowners
2023-12-05 20:50:46 +00:00
genquan9andGitHub 4f2408ce9e use the vertex_model_garden links instead of vertex_vision_model_garden (#2567) 2023-12-05 20:50:13 +00:00
Kathy YuandGitHub ef9a176c75 Add evaluation for CodeLLaMA and fix typos in CodeLLaMA and Mistral notebooks. (#2566) 2023-12-04 15:11:41 +00:00
genquan9andGitHub e72fffd682 copy vertex_vision_model_garden as vertex_model_garden (#2565) 2023-12-04 15:11:07 +00:00
KCFindstrandGitHub a9301eeb64 Add hyperparameter tuning examples to #PEFT Llama2 and OpenLlama notebooks (#2564) 2023-12-04 15:10:04 +00:00
weigaryandGitHub 9e2dcd494a Add charts to the benchmark report. (#2563)
* Add charts to the benchmark report.

* Add charts to the benchmark report.
2023-12-02 00:09:06 +00:00
KCFindstrandGitHub 2ae33b5b12 Add OpenLLaMA hyperparameter tuning benchmark report (#2562) 2023-12-01 22:47:03 +00:00
weigaryandGitHub d85a1e9c0c Update the SD XL notebook for refiner to use the default GPU as L4 (instead of A100). (#2561) 2023-12-01 22:46:30 +00:00
dstnluong-googleandGitHub fff9673703 Add SD benchmarking report (#2560)
* Add SD benchmarking report

* Fix images

* remove old table

* grammar

* lint

* typo
2023-12-01 22:45:50 +00:00
dstnluong-googleandGitHub 55fbb89a95 Update Docker URIs. (#2554)
* Update Docker URIs.

* lint

* update docker URI

* typo

* add comma

* lint

* fix parameters

* Add quantization method to gptq
2023-12-01 22:45:12 +00:00
dstnluong-googleandGitHub 007610f4f2 Add quantization section for Openllama (#2551)
* Add quantization section for Openllama

* use peft serving for 3b quantized

* missing comma

* lint

* add quantization_method to gptq

* add quantization_method to gptq
2023-12-01 22:44:36 +00:00
weigaryandGitHub 1354c74058 Move the openllama 7b benchmark report to the centralized place. (#2559) 2023-12-01 22:43:34 +00:00
Andrew FerlitschandGitHub f36ab8ef40 fix: online FS (#2558) 2023-11-30 17:08:43 +00:00
Andrew FerlitschandGitHub 33793dbb78 fix: backticks (#2557) 2023-11-30 15:05:18 +00:00
Lav RaiandGitHub d3bdf63115 Vit report (#2556)
* Add ViT benchmarking report.

* Add ViT benchmarking report.

* Add ViT benchmarking report.

* Add ViT benchmarking report.

* Add ViT benchmarking report.

* Add ViT benchmarking report.
2023-11-30 14:20:04 +00:00
weigaryandGitHub f3395041e4 Add openllama-7b fine tuning benchmark report. (#2555) 2023-11-30 14:19:29 +00:00
Andrew FerlitschandGitHub 5dfc87cbab fix: FS legacy delete (#2553) 2023-11-29 18:17:40 +00:00
Andrew FerlitschandGitHub a162066c94 in-progress: SDK whl replacement (#2552)
* in-progress: SDK whl replacement

* add: cmd param
2023-11-29 18:17:07 +00:00
dstnluong-googleandGitHub a4940cc2ba Add quantization to llama2 notebook (#2550) 2023-11-29 03:20:21 +00:00
Andrew FerlitschandGitHub d1dfe04ff0 2nd part of deprecate (#2542)
* 2nd part of deprecate

* fix links
2023-11-22 23:55:33 +00:00
fca8a0f9f5 Support DITO custom categories (#2543)
Co-authored-by: minwoopark <minwoopark@google.com>
2023-11-20 21:27:39 +00:00
Andrew FerlitschandGitHub ea3a5d3d79 deprecate flaky notebook (#2541) 2023-11-20 19:25:19 +00:00
Andrew FerlitschandGitHub 013bd9b78b fine tuning: auto error detection (#2539) 2023-11-20 18:42:28 +00:00
Andrew FerlitschandGitHub 1ca46e450d update: notebook status (#2535) 2023-11-20 16:52:16 +00:00
Xiang XuandGitHub 6c4f09fd43 increase max_num_batched_tokens for vllm and remove streaming (#2536) 2023-11-17 20:46:26 +00:00
Andrew FerlitschandGitHub 66427bd244 fix: detecting internal (#2534) 2023-11-17 20:37:13 +00:00
weigaryandGitHub d49bae8d29 Update staable-diffusion 1.5 and XL notebooks to deploy with default GPU as L4, instead of A100. (#2533) 2023-11-17 19:40:17 +00:00
Andrew FerlitschandGitHub 66c05c8217 fix: typo in results vs result (#2532) 2023-11-17 18:46:51 +00:00
Andrew FerlitschandGitHub 79473f0b88 fix: cleanup for FS 2.x (#2526) 2023-11-17 14:35:47 +00:00
Andrew FerlitschandGitHub 2568e012f9 fix: detect other types of quota and internal errors (#2525) 2023-11-16 23:50:25 +00:00
Kathy YuandGitHub 97fa323aca Fix typo in LLaMA 2 instructions. (#2524) 2023-11-16 22:04:52 +00:00
Kelsi LakeyandGitHub 20a9ff65e0 Update IMAGE_URI in tensorboard_custom_training_with_custom_container.ipynb (#2522)
Add variable in IMAGE_URI to set region. Right now it is hard-coded to us-central1.
2023-11-16 22:04:11 +00:00
Andrew FerlitschandGitHub ed6de9fde5 feat: stub and document reaper support for FS 2.x (#2521) 2023-11-15 22:04:01 +00:00
zhangxiaotianandGitHub dbaa3d098c fix clean up (#2520)
* improve to make it more aligned with the template

* fix:fix clean up section
2023-11-15 21:53:44 +00:00
Andrew FerlitschandGitHub 7e77de2800 CI/CD fix (#2514)
* CI/CD fix

* pin 1.34
2023-11-15 17:59:11 +00:00
Andrew FerlitschandGitHub ef8b70db32 Update CI/CD fix (#2513) 2023-11-15 00:09:33 +00:00
578adab3b0 revert how sdk is downloaded (#2518)
Co-authored-by: Kamal Gurala <gkamal@google.com>
2023-11-15 00:08:22 +00:00
KCFindstrandGitHub 3ef187ecc3 Update Llama2 PEFT notebook train docker version (#2519) 2023-11-15 00:05:45 +00:00
23dc370602 Updates optimized to remove known issues (#2512)
Co-authored-by: Kamal Gurala <gkamal@google.com>
2023-11-15 00:05:17 +00:00
Andrew FerlitschandGitHub d1835e98af feat: auto find latest build results (#2517) 2023-11-15 00:00:31 +00:00
823c10315a Update vector notebook to remove disclaimer (#2515)
* Update vector notebook to disclaimer

* Update region used for vector case

---------

Co-authored-by: Kamal Gurala <gkamal@google.com>
2023-11-14 22:51:17 +00:00
Kathy YuandGitHub 497297007c Update serving container version for sequence classification models. (#2509) 2023-11-14 22:17:31 +00:00
87ddc8ec00 Update for GA relase, use v1 sdk, and remove known issues (#2510)
* Updates Bigtable serving noteebok for GA release

* Removes preview disclaimer

* Updates from linter

---------

Co-authored-by: Kamal Gurala <gkamal@google.com>
2023-11-14 22:17:01 +00:00
Andrew FerlitschandGitHub eb104d4d92 fix: capture log on fail (#2508) 2023-11-14 20:59:49 +00:00
zhangxiaotianandGitHub ba335b250b improve to make it more aligned with the template (#2506) 2023-11-14 20:41:57 +00:00
Andrew FerlitschandGitHub 5f014bcf34 CI/CD debug (#2503) 2023-11-14 20:30:29 +00:00
Andrew FerlitschandGitHub 0d453b7e01 documented what to do for FS 2.x cleanup (#2507) 2023-11-14 18:27:23 +00:00
Andrew FerlitschandGitHub 379644e115 Update CI/CD debug (#2504) 2023-11-14 16:43:53 +00:00
Andrew FerlitschandGitHub 72ab1484b7 deprecate to community (#2502) 2023-11-14 16:32:54 +00:00
zhangxiaotianandGitHub 885a62489e fix: fix image rending for running in Jupyter (#2501) 2023-11-14 15:45:47 +00:00
Andrew FerlitschandGitHub 9591e8db4d fix CI/CD (#2498) 2023-11-14 00:27:39 +00:00
Andrew FerlitschandGitHub 9757e14644 feat: filter for notebooks under investigation (#2497) 2023-11-13 23:53:33 +00:00
Kathy YuandGitHub 959c56a4c7 Add documentation for building chat applications using LLaMA 2. (#2494) 2023-11-13 19:17:29 +00:00
Andrew FerlitschandGitHub ea1afda39d fix: internal and log url (#2492) 2023-11-13 19:06:41 +00:00
weigaryandGitHub e8539218e4 Temporarily pin the docker to 20231112_0948_RC00. (#2493) 2023-11-13 18:49:32 +00:00
Andrew FerlitschandGitHub 4fb0761fb8 add log url (#2490)
* add log url

* fix: syntax error

* fix: syntax error
2023-11-13 17:39:16 +00:00
Andrew FerlitschandGitHub 6a61010225 feat: finish round1 of dirty dashboard (#2489)
* feat: finish round1 of dirty dashboard

* debug: CICD issue
2023-11-13 17:38:04 +00:00
838e72087f refactor: explicitly prepare featch_Feature_values request (#2485)
* refactor: explicitly prepare featch_Feature_values request

* Fix unintednded metadata updates

* Fixes from linter

* add unique to resource ids

* add unique to resource ids for public optimized

---------

Co-authored-by: Kamal Gurala <gkamal@google.com>
Co-authored-by: Andrew Ferlitsch <aferlitsch@google.com>
2023-11-11 01:15:29 +00:00
zhangxiaotianandGitHub c633231e07 Warehouse (#2484)
* add warehouse sdk colab

* update owner

* update colab and github link

* resolve comments

* resolve comments

* resolve comments

* fix format

* remove unused code

* resolve lint
2023-11-10 23:03:37 +00:00
zhangxiaotianandGitHub 5f73c9e445 create a notebook for image warehouse (#2488)
* create a notebook for image warehouse

* update

* resolve comments

* resolve comments
2023-11-10 22:41:14 +00:00
Andrew FerlitschandGitHub 4d77391672 fix: bad link (#2486) 2023-11-10 21:18:32 +00:00
Matthew TangandGitHub 289db671b8 [Vertex AI SDK] Remove sdk2 wording from bigframes notebooks (#2487)
* Remove sdk2 wording

* don't override class
2023-11-10 21:15:29 +00:00
weigaryandGitHub c725d85433 Update stable diffusion 2.1 notebook to use the optimized serving docker (#2483)
* Update stable diffusion 2.1 notebook to use the optimized serving docker.

* Update model_garden_pytorch_stable_diffusion_2_1.ipynb

* Update model_garden_pytorch_stable_diffusion_2_1.ipynb
2023-11-10 21:13:22 +00:00
Andrew FerlitschandGitHub 6f48419a31 pin to fix CI/CD failure (#2480) 2023-11-10 18:02:30 +00:00
Andrew FerlitschandGitHub 3c83824d02 fix syntax error (#2481) 2023-11-09 19:54:23 +00:00
Andrew FerlitschandGitHub 7d53d90235 fix: timeout in CI/CD (#2478) 2023-11-09 19:42:43 +00:00
Matthew TangandGitHub fc3f467899 [Vertex AI SDK] Remove bigframes tf-io installation on user side (#2472)
* Remove tf-io installation on user side

* Fix lint
2023-11-09 19:31:40 +00:00
Andrew FerlitschandGitHub 11fe3dbc28 fix: missing link (#2466) 2023-11-09 18:11:12 +00:00
Andrew FerlitschandGitHub 253f755d86 fix: remove output (#2476) 2023-11-09 16:50:03 +00:00
Mend RenovateandGitHub 89b868705b chore(deps): update actions/checkout action to v4 (#2394) 2023-11-09 14:32:16 +00:00
Mend RenovateandGitHub 038fc057ee chore(deps): update dependency pyupgrade to v3.15.0 (#2314) 2023-11-09 14:30:53 +00:00
Andrew FerlitschandGitHub 4377a1b485 fix: bug in selection algo for age and max notebooks (#2475)
* fix: invert time test

* fix: percent unt
2023-11-09 00:17:51 +00:00
Andrew FerlitschandGitHub 9f5cb39eb4 already in official (#2477) 2023-11-09 00:17:28 +00:00
yexing111andGitHub 103c168a82 Rephrase optimized notebook to address previous comment (#2473)
* Rephrase optimized notebook

* Update format issue and change region

* Update format issue and change region2

* Fix import format

* Apply format

* Change region
2023-11-08 22:04:42 +00:00
Andrew FerlitschandGitHub 42914ffba6 fix: read from local file (#2474)
* fix: read from local file

* fix: GCS file
2023-11-08 21:46:03 +00:00
Andrew FerlitschandGitHub b4f3601262 debug: saving results (#2471) 2023-11-08 19:48:43 +00:00
yexing111andGitHub 3978ea80bf Create new colab for FS optimized serving (#2454)
* Create new colab for FS optimized serving

* Address comments

* Fix allowlist syntax error with param

* Change default region to trigger test in clean env

* Comment expect to fail cells

* Change default region to trigger test
2023-11-08 13:15:24 +00:00
Kelsi LakeyandGitHub b3a8e98150 Update delete_outdated_tensorboard_experiments.ipynb (#2469)
Change detailed_log to match DETAILED_LOG variable defined above.
Add note about how user can set tensorboard experiment labels.
2023-11-08 00:56:39 +00:00
weigaryandGitHub 817e9f6f5f Update stable diffusion XL notebook to use the optimized serving docker. (#2467)
* Update stable diffusion XL notebook to use the optimized serving docker.

* Update model_garden_pytorch_stable_diffusion_xl_1_0.ipynb

minor update

* Update model_garden_pytorch_stable_diffusion_xl_1_0.ipynb

minor update
2023-11-08 00:55:49 +00:00
Andrew FerlitschandGitHub f028260fe9 feat: detect error from log (#2465)
* feat: detect error from log

* fix: None
2023-11-07 15:57:13 +00:00
Mend RenovateandGitHub 3b0dc3a9af chore(deps): update dependency black to v23.10.1 (#2086) 2023-11-07 13:51:08 +00:00
Kathy YuandGitHub d27adf8c47 Update swap space setting for CodeLLaMA notebook. (#2462) 2023-11-07 00:13:51 +00:00
KCFindstrandGitHub 4873c54cf0 Add hyperparameter tuning instructions to llama2 PEFT notebook (#2460) 2023-11-07 00:13:27 +00:00
Andrew FerlitschandGitHub 55645a8583 fix: protect harness from system wide execution failure (#2464)
* feat: add option for files not to index

* fix: harden harness against system failure
2023-11-06 16:17:38 +00:00
Andrew FerlitschandGitHub 47da217cca Tpu ga 2 (#2461)
* migrate to official

* fix: AR permission

* fix: TPU available

* convert to KFP2
2023-11-03 20:49:48 +00:00
Andrew FerlitschandGitHub 2cc877438c fix: timeout (#2458) 2023-11-02 16:46:34 +00:00
Jose BracheandGitHub 2ee1c72bf9 Jbrache 20231101 (#2457)
* chore: Renaming notebook, updated text formatting, typos.

* chore: Renaming notebook, updated text formatting, typos.
2023-11-02 16:42:41 +00:00
Kathy YuandGitHub ee5f69b5b8 Add deployment recommendations, clarifications and bug fixes to PEFT and vLLM notebooks. (#2455) 2023-11-01 20:19:26 +00:00
Andrew FerlitschandGitHub da3f4abbc2 updates for webdoc index generation (#2456)
* fix: remove backticks

* fix: vector search branding
2023-11-01 18:52:04 +00:00
Andrew FerlitschandGitHub cc585a3faa fix broken links (#2453) 2023-11-01 13:27:59 +00:00
Andrew FerlitschandGitHub 6afc5ce353 fix: skipping in indexer (#2452) 2023-10-31 22:36:33 +00:00
Andrew FerlitschandGitHub 9cb9d272f0 fix: last date ran (#2451) 2023-10-31 21:00:07 +00:00
weigaryandGitHub 759726e7b4 Update the stable diffusion 1.5 notebook to use the optimized serving docker image (#2450) 2023-10-31 20:55:23 +00:00
kemurayamaandGitHub d282fe7461 Update model_garden_pytorch_stable_diffusion_2_1.ipynb (#2446)
Deleted `torch_dtype=torch.float16` on line 397
2023-10-31 20:54:57 +00:00
Andrew FerlitschandGitHub ed7cd22e27 feat: add arg for run first file (#2449) 2023-10-31 19:04:32 +00:00
Andrew FerlitschandGitHub fdac86f541 fix: run first (#2448) 2023-10-31 17:54:22 +00:00
Andrew FerlitschandGitHub 7f464a92e0 migrate to official (#2443)
* migrate to official

* fix: missing install

* fix: import os

* fix: IS_COLAB
2023-10-30 19:11:44 +00:00
Andrew FerlitschandGitHub a779d317af migrate to official (#2431)
* migrate to official

* fix: artifact registry

* fix: lint

* fix: missing image

* fix: add more cleanup
2023-10-30 19:10:05 +00:00
Andrew FerlitschandGitHub ee538ce371 migrate to official (#2444)
* migrate to official

* fix: missing installs

* fix: IS_COLAB
2023-10-30 17:27:30 +00:00
Andrew FerlitschandGitHub 2ec5b39bdc migrate to official (#2441)
* migrate to official

* fix: remove param

* fix: IS_COLAB

* fix: requirements.txt

* fix: image missing

* fix: IS_TESTING

* fix: IS_TESTINGFG
2023-10-30 14:27:17 +00:00
Andrew FerlitschandGitHub 68f160db50 migrate to official (#2445) 2023-10-30 14:20:12 +00:00
Andrew FerlitschandGitHub b65392f2be fix: learn more about (#2419)
* fix: learn more about

* fix: VPC issue

* fix: VPC issue

* fix: handle exception

* fix: add VPC network

* fix: lint
2023-10-30 14:06:58 +00:00
Jaycee LiandGitHub 6625012a95 Move sdk2 bigframes notebooks (#2440)
* Refactor SDK 2.0 notebooks

* fix linting

* Update CODEOWNERS

* change codeowner username

* install dependencies

* update dependencies

* update folder name

* Update CODEOWNERS

* move sdk2 notebooks

* linting
2023-10-27 17:47:55 +00:00
e542e915b1 Colab (#2439)
* Support Colab Enterprise

* Support Colab Enterprise

---------

Co-authored-by: minwoopark <minwoopark@google.com>
2023-10-27 17:47:00 +00:00
Huguens JeanandGitHub 757419e1b1 Update BioGPT serve docker URI in notebook. (#2438) 2023-10-27 17:46:28 +00:00
Andrew FerlitschandGitHub 3dd41db8a5 fix: timeouts (#2437) 2023-10-27 17:01:30 +00:00
Andrew FerlitschandGitHub c027f88d2a fix: unreliable service (#2436) 2023-10-27 15:30:43 +00:00
Mend RenovateandGitHub 596bb6a6b7 chore(deps): update dependency flake8 to v6.1.0 (#2131) 2023-10-27 14:56:51 +00:00
xqr-gandGitHub d3a6a7bf91 change model version (#2433) 2023-10-26 23:03:11 +00:00
Jaycee LiandGitHub be68829742 Refactor SDK 2.0 notebooks (#2367)
* Refactor SDK 2.0 notebooks

* fix linting

* Update CODEOWNERS

* change codeowner username

* install dependencies

* update dependencies

* update folder name

* Update CODEOWNERS
2023-10-26 18:54:02 +00:00
dstnluong-googleandGitHub 64be3cd9ee Fix VLLM format string. (#2432)
* Minor updates to Vicuna notebook

* Lint

* Fix format string for Vicuna notebook.
2023-10-26 17:41:33 +00:00
Eric DongandGitHub 2414433f94 chore: remove unnecessary comments from the template (#2428) 2023-10-26 15:40:49 +00:00
Andrew FerlitschandGitHub 7206ea4d99 Harden 9 (#2429)
* fix: force run based on age of last run

* fix: force run based on age of last run
2023-10-26 15:40:34 +00:00
Andrew FerlitschandGitHub 8dad9cd13f fix: clean and rebrand - permission (#2335)
* fix: clean and rebrand

* fix: VPC setup

* rebrand

* rebrand

* fix: PROJECTT

* fix: VPC network

* fix: redis

* fix: import os
2023-10-25 21:20:59 +00:00
Andrew FerlitschandGitHub d0037863ff feat: record last date of fail (#2425) 2023-10-25 17:20:12 +00:00
Andrew FerlitschandGitHub ce4b2b1781 fix CI/CD error (#2423) 2023-10-25 17:03:37 +00:00
Andrew FerlitschandGitHub 8b2e7766c3 add more notebooks to list (#2424) 2023-10-25 16:51:11 +00:00
Andrew FerlitschandGitHub 7844755cac feat: select notebook if failed on last run (#2420) 2023-10-25 12:56:53 +00:00
Andrew FerlitschandGitHub 6f566cc4f8 feat: add option for files not to index (#2418) 2023-10-24 18:59:35 +00:00
Andrew FerlitschandGitHub 6ac2f82c0b debug CI/CD failure (#2405)
* debug CI/CD failure

* pin GCPC version
2023-10-24 18:24:55 +00:00
Andrew FerlitschandGitHub 1f818fe469 Harden 3 (#2416)
* feat: run-first argument

* feat: run-first code

* feat: add run first file
2023-10-24 17:03:33 +00:00
weigaryandGitHub 51f87eb06a Pin the transformer-serve version in the NLLB notebook (#2417) 2023-10-24 16:58:33 +00:00
KCFindstrandGitHub cdb5c1c54b Switch #BiomedCLIP default GPU to V100 (#2415) 2023-10-24 16:58:03 +00:00
dstnluong-googleandGitHub 7f6c2f28d3 Minor updates to Vicuna notebook. (#2410)
* Minor updates to Vicuna notebook

* Lint
2023-10-24 16:57:28 +00:00
Kathy YuandGitHub ced4f55dac Add V100 recommendations for LLaMA 2. (#2409) 2023-10-24 16:56:52 +00:00
Andrew FerlitschandGitHub a5a003b831 Harden 2 (#2414)
* feat: run-first argument

* feat: run-first code
2023-10-24 13:57:46 +00:00
Andrew FerlitschandGitHub e7b8238615 fix: filename only not path (#2412) 2023-10-23 20:11:19 +00:00
Andrew FerlitschandGitHub e5a50be51e feat: skip notebook option (#2411) 2023-10-23 19:37:37 +00:00
Andrew FerlitschandGitHub e5bfc74c11 clean: not index notebooks w/o webdoc page (#2408) 2023-10-23 17:57:49 +00:00
Andrew FerlitschandGitHub d03779423c cleanup: obsolete build files (#2406) 2023-10-23 17:01:54 +00:00
weigaryandGitHub ba62d20dad Update an incorrect hyperlink in the NLLB notebook. (#2403)
* Add a notebook example for the NLLB model in model garden

* Add a notebook example for the NLLB model in model garden

* Update an incorrect hyperlink in the NLLB notebook.
2023-10-23 16:30:56 +00:00
KCFindstrandGitHub 50273e9883 Tag PEFT trainer docker in #ModelGarden notebooks. (#2404) 2023-10-20 23:42:07 +00:00
Kelsi LakeyandGitHub d6ab1248e2 Remove tensorboard billing alert from get_started_with_vertex_experiments_autologging.ipynb (#2402) 2023-10-20 23:39:59 +00:00
c6f451c8d1 Patch-4 (#2363)
* Miscellaneous editorial fixes and rebranding to "Vertex AI Feature Store (Legacy)"

* chore: rebrand Legacy Feature Store product

* chore: Rebrand to "Vertex AI Feature Store (Legacy)" and change "ingest" to "import".

---------

Co-authored-by: Andrew Ferlitsch <aferlitsch@google.com>
2023-10-20 22:26:02 +00:00
Andrew FerlitschandGitHub 71f3f12607 fix CI/CD failure (#2398) 2023-10-20 20:51:01 +00:00
Sebastian SchmidtandGitHub c7b9274c2e Display generated images in Image Generator notebook (#2395)
* Display generated images in Image Generator notebook

* Style

* Lint
2023-10-20 18:47:40 +00:00
Kathy YuandGitHub ee46a01c83 Open-source ImageBind serving Docker image. (#2401)
* Open-source ImageBind serving Docker image.

* Update CODEOWNERS to cover ImageBind.
2023-10-20 18:19:35 +00:00
Kathy YuandGitHub d8a6659fd2 Update deployment recommendations in ImageBind notebook. (#2400) 2023-10-20 18:18:55 +00:00
Andrew FerlitschandGitHub b24eb863af migrate to official (#2354)
* migrate to official

* workaround VPC

* fix: missing title
2023-10-20 18:15:59 +00:00
Andrew FerlitschandGitHub a0bebae049 migrate to official (#2355)
* migrate to official

* fix: settings

* workaround VPC
2023-10-20 17:35:46 +00:00
Andrew FerlitschGitHubivanmkc@google.com <ivanmkc@google.com>
1cab2c2d1c rebrand and clean (#2350)
* rebrand and clean

* fix: Added better type checking and fixed misspelling of _GCP_VPC_NETWORK_NAME

---------

Co-authored-by: ivanmkc@google.com <ivanmkc@google.com>
2023-10-20 15:50:52 +00:00
Andrew FerlitschandGitHub f0dacd8ccd deprecate to community (#2396) 2023-10-20 12:31:17 +00:00
Andrew FerlitschandGitHub 9b8dd67fc6 clean and rebrand - parallelism (#2338)
* clean and rebrand

* import

* import

* fix: lint

* deprecate: move to community

* fix: lint
2023-10-20 12:30:21 +00:00
Andrew FerlitschandGitHub fe57394773 fix: link (#2393) 2023-10-19 16:58:36 +00:00
Kathy YuandGitHub 6b98f077b7 Add ImageBind notebook. (#2392) 2023-10-19 16:56:50 +00:00
Huguens JeanandGitHub b515719465 Chore: Open source Segment Anything handler and dockerfile to Model Garden. (#2389) 2023-10-19 16:56:06 +00:00
dstnluong-googleandGitHub 0603133c15 Add accelerator suggestions for Vicuna. (#2374)
* Add Vicuna notebook

* Add notebook to CODEOWNERS

* add GPU recs

* replace 33b with 13b-32k

* lint

* Update accelerator count

* Lint

* Add suggested accelerator setup.

* Lint

* Add comment for max_model_len

* remove license line
2023-10-19 16:55:37 +00:00
Andrew FerlitschandGitHub 9901150c5c fix: add missing learn about (#2388) 2023-10-18 19:23:25 +00:00
3d7886eb0b Fix CODEOWNERS change due to merge conflict. (#2390)
Co-authored-by: minwoopark <minwoopark@google.com>
2023-10-18 17:29:54 +00:00
9abb80db28 Add DITO notebook (#2387)
Co-authored-by: minwoopark <minwoopark@google.com>
Co-authored-by: Andrew Ferlitsch <aferlitsch@google.com>
2023-10-18 16:55:29 +00:00
85e93c8db3 Add OWL-ViT v2 notebook (#2386)
* Add OWL-ViT v2 notebook

* Add OWL-ViT v2 notebook.

---------

Co-authored-by: minwoopark <minwoopark@google.com>
2023-10-18 16:53:24 +00:00
Andrew FerlitschandGitHub df11806ebf fix: missing learn more about (#2384) 2023-10-18 14:16:28 +00:00
Andrew FerlitschandGitHub 57210868ad fix: missing learn more about (#2385) 2023-10-18 12:28:23 +00:00
Jose BracheandGitHub 44fa59f6de Jbrache persistent resource (#2379)
* feat: Committing new example for persistent resources

* feat: Committing new example for persistent resources
2023-10-17 21:32:52 +00:00
Xiang XuandGitHub d397549dac fix streaming (#2378) 2023-10-17 19:42:20 +00:00
Andrew FerlitschandGitHub c45aaff2f1 fix: handling H1 heading (#2383) 2023-10-17 17:47:12 +00:00
Andrew FerlitschandGitHub 88cf9b3278 update indices (#2382) 2023-10-17 17:42:09 +00:00
Matthew TangandGitHub b589216811 Clean up SDK2 Bigframes notebooks (#2362)
* Clean up SDK2 Bigframes notebooks

* Debug ci dependency error

* Remove cell output

* Remove local overrides

* Additional debug

* Re-trigger CI test

* Rerun CI tests

* Rerun CI tests

* Rerun CI tests

* Add tensorflow-io-gcs-filesystem pin

* Fix version pin

* Fix other version pin
2023-10-17 17:05:54 +00:00
Andrew FerlitschandGitHub 7ae85ce5d6 fix: CI/CD failure (#2377)
* fix: CI/CD failure

* deprecate from official

* lint
2023-10-17 15:58:15 +00:00
Andrew FerlitschandGitHub 0ad3530420 Debug CI/CD failure (#2375)
* Debug CI/CD failure

* change TF11 to TF12

* Update get_started_with_custom_training_autologging_local_script.ipynb

try 2.10

* valid TF12
2023-10-16 23:36:47 +00:00
Andrew FerlitschandGitHub 58547f4630 CI/CD: debug fail (#2346)
* CI/CD: debug fail

* unhardcode the PROJECT_ID
2023-10-16 23:36:02 +00:00
Sebastian SchmidtandGitHub 4fca43d63d Update MediaPipe Image Generator notebook with latest changes (#2372) 2023-10-16 16:40:25 +00:00
KCFindstrandGitHub 8a0acfa1b0 Remove misleading prompt output from openllama notebook (#2371) 2023-10-13 15:35:24 +00:00
KCFindstrandGitHub 90001d4234 Add custom dataset support to #ModelGarden PEFT notebooks (#2370)
* Add custom dataset support to #ModelGarden PEFT notebooks

* Update OpenLLaMA notebook

* Revert unnecessary change in Llama2 notebook.
2023-10-12 20:10:13 +00:00
sen-samandGitHub 3d4bd5fdfc chore: rebrand "Vertex AI Feature Store (Legacy)", miscellaneous editorial changes, and changing "ingest" to "import" globally. (#2369) 2023-10-12 20:09:17 +00:00
Kathy YuandGitHub 283c0a3727 Add model evaluation to Dolly V2 notebook. (#2368) 2023-10-12 20:08:23 +00:00
Andrew FerlitschandGitHub bbfc2d9114 migrate to official (#2356)
* migrate to official

* fix: os

* fix: review

* fix: review
2023-10-12 00:17:20 +00:00
Kathy YuandGitHub fa1cfbe09b Remove extra print statement in LLaMA 2 notebook. (#2366) 2023-10-11 22:48:51 +00:00
KCFindstrandGitHub c781c9f7ad Update #ModelGarden TFVision notebooks model export docker URI. (#2365) 2023-10-11 22:48:26 +00:00
Huguens JeanandGitHub 4c37f8e43b Update SAM docker URI and accelerator type for vertex endpoint deployment. (#2361) 2023-10-11 22:47:41 +00:00
KCFindstrandGitHub acf5853b98 Add #ModelGarden BiomedCLIP notebook. (#2364) 2023-10-11 19:05:29 +00:00
Julio Anthony LeonardandGitHub 7d086b08e7 Fix typos and sentence (#2359)
Fix a typo and add more clarity to sentences
2023-10-11 12:17:33 +00:00
sen-samandGitHub e4275197ac Miscellaneous editorial fixes and rebranding to "Vertex AI Feature Store (Legacy)" (#2358)
* Miscellaneous editorial fixes and rebranding to "Vertex AI Feature Store (Legacy)"

* chore: rebrand Legacy Feature Store product
2023-10-11 00:35:56 +00:00
Xiang XuandGitHub 8fede82c32 Upgrade deps version for Mistral model (#2351) 2023-10-09 22:53:13 +00:00
Andrew FerlitschandGitHub e598af21ac debug: CI/CD failure (#2347)
* debug: CI/CD failure

* debug: CI/CD failure
2023-10-06 22:24:59 +00:00
Andrew FerlitschandGitHub 682786616c port: kfp2 (#2302)
* port: kfp2

* fix import importer_node

* fix: selector

* fix: format

* lint

* set node

* fix: types

* fix: type

* types

* yaml/json

* yaml/json

* train image

* train image

* key error

* fix: outputs

* fix: outputs

* fix: outputs

* fix: outputs

* fix: outputs
2023-10-06 20:40:51 +00:00
dstnluong-googleandGitHub feee6149a1 Add Vicuna notebook (#2252)
* Add Vicuna notebook

* Add notebook to CODEOWNERS

* add GPU recs

* replace 33b with 13b-32k

* lint

* Update accelerator count

* Lint
2023-10-06 17:57:31 +00:00
Huguens JeanandGitHub bf374c8c5e Fix BioGPT notebook name in Vertex AI Model Garden. (#2344) 2023-10-06 17:29:02 +00:00
Xiang XuandGitHub 7e58fb8471 add streaming to llm notebooks (#2345) 2023-10-06 17:27:22 +00:00
Andrew FerlitschandGitHub 37f75ce3da fix: rebrand (#2342) 2023-10-06 13:45:14 +00:00
Andrew FerlitschandGitHub 2b94e8b51e fix: rebrand (#2343) 2023-10-06 13:43:37 +00:00
Andrew FerlitschandGitHub 0041b7da91 fix: rebrand (#2341) 2023-10-06 13:42:32 +00:00
Andrew FerlitschandGitHub 6de14d11c8 port: kfp2 (#2327)
* port: kfp2

* fix: imports

* fix: v1

* fix: params

* fix: params

* fix: imports

* fix: model upload

* fix: importer node

* fix: artifacts_type

* fix: component paths

* fix: component paths

* fix: component paths
2023-10-06 00:20:50 +00:00
Rajesh ThallamandGitHub 203d2e8a0b Add Mistral models to Vertex AI Model Garden (#2340)
* PyTorch efficient training - refcator code

* Revert "PyTorch efficient training - refcator code"

This reverts commit 90b563a7697b15b4154ac76236b894253dd58f3c.

* Add notebook to deploy Mistral models on Vertex AI

* Add notebook to deploy Mistral models on Vertex AI

* Add notebook to deploy Mistral models on Vertex AI

* Updated notebook to deploy Mistral models on Vertex AI

* Linting fixes

* Adding endpoint cleanup and machine spec

* Updating CODEOWNERS file

* Update linting fixes
2023-10-06 00:02:22 +00:00
Andrew FerlitschandGitHub ca7cb251ec fix: rebrand (#2339) 2023-10-05 23:21:42 +00:00
Andrew FerlitschandGitHub db359011f4 fix: rebrand/clean (#2334) 2023-10-05 22:56:14 +00:00
Andrew FerlitschandGitHub 52313b8fc4 fix: remove redis (#2333) 2023-10-05 22:55:39 +00:00
sen-samandGitHub c6a2c8e673 Update online_feature_serving_and_fetching_bigquery_data_with_feature_store.ipynb (#2331)
Made a minor fix flagged by the PM.
2023-10-05 18:48:08 +00:00
sen-samandGitHub 3e090ce61d Update online_feature_serving_and_vector_retrieval_bigquery_data_with_feature_store.ipynb (#2332)
Minor change (restored the missing "of" in the title).
2023-10-05 18:47:40 +00:00
Huguens JeanandGitHub 8061ce96ed Add BioGPT to Vertex AI Model Garden. (#2323) 2023-10-05 15:51:28 +00:00
5eeb4b1fd9 Add offical notebook for Vertex SDK LLM snippets (#1843)
* Add offical notebook for Vertex SDK LLM snippets

* Updating based on template

* cleanup for linter

* edit notebook

* fix lint

* test checks

* project id

* comply with template

* fix lint

* add pandas import

* fix lint

* fix test error

* Address Andy's comments

---------

Co-authored-by: Yvonne <liyvonne@google.com>
2023-10-05 00:15:02 +00:00
Andrew FerlitschandGitHub bc14aa72b9 fix: CI/CD failure (#2329) 2023-10-04 23:18:20 +00:00
Andrew FerlitschandGitHub c9faf848b2 port: kfp2 (#2328) 2023-10-04 23:17:29 +00:00
Andrew FerlitschandGitHub ea89e8e1f6 port: kfp2 (#2326) 2023-10-04 23:13:08 +00:00
Andrew FerlitschandGitHub aa8e2c6af3 port: kfp2 (#2318)
* port: kfp2

* port: kfp2
2023-10-04 20:28:16 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2529586683 build(deps): bump pillow (#2322)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.0.1 to 10.0.1.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/9.0.1...10.0.1)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-04 16:38:17 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
66601678e0 build(deps): bump pillow (#2321)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.0.1 to 10.0.1.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/9.0.1...10.0.1)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-04 16:37:47 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
75da4cfb99 build(deps): bump pillow (#2320)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.0.1 to 10.0.1.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/9.0.1...10.0.1)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-04 16:37:09 +00:00
Eric DongandGitHub 7d406848ea feat: feature store 2.0 tutorial (goku) (#2281)
* feat: feature store 2.0 tutorial (goku)

* Complying with the template

* Complying with the template 2

* clarify the notebook description

* clarify the notebook description 2

* address review comments and rename file

* add known issue and change install package

* wait for the sync job to complete, and fix resource conflicts

* address review comments

* address review comments 2

* add a delay for the endpoint to start properly
2023-10-04 01:20:44 +00:00
Eric DongandGitHub 2aea69a022 feat: feature store 2.0 tutorial for feature value fetching (#2283)
* feat: feature store 2.0 tutorial for feature value fetching

* remove 2.0 references and rename file name

* add known issue and change install package

* add sdk; add job check logic; fix cleanup

* address review comments
2023-10-03 20:54:03 +00:00
Andrew FerlitschandGitHub 4a56ab4138 port: kfp2 (#2313) 2023-10-03 14:31:40 +00:00
Andrew FerlitschandGitHub b7c7691c52 kfp: notice (#2312) 2023-10-03 01:50:37 +00:00
Andrew FerlitschandGitHub 57da2a745f kfp: notice (#2311) 2023-10-03 01:50:04 +00:00
Andrew FerlitschandGitHub d0ea048385 fix: notice (#2310) 2023-10-03 01:49:28 +00:00
Andrew FerlitschandGitHub 15537b2ed8 port: kfp2 (#2309) 2023-10-03 01:48:47 +00:00
Andrew FerlitschandGitHub a3239d8b71 port: kfp2 (#2308) 2023-10-03 01:48:10 +00:00
Andrew FerlitschandGitHub 6ecebd2973 port: kfp2 (#2304)
* port: kfp2

* fix: import

* fix: params

* fix: json/yaml
2023-10-02 21:37:01 +00:00
Andrew FerlitschandGitHub c4fe6fad23 deprecate (#2306) 2023-10-02 20:29:36 +00:00
Andrew FerlitschandGitHub a162051187 deprecate (#2305) 2023-10-02 20:18:58 +00:00
Ashley XuandGitHub 0d7d96e09c feat: add BigFrames llm code notebooks in generative_ai (#2290)
* feat: add BigFrames llm code notebooks

* fix: fix the linter and address comments
2023-10-02 17:26:07 +00:00
Huguens JeanandGitHub 5a1549d5cc Open source jax vision transformer to model garden. (#2295) 2023-10-02 16:11:16 +00:00
Kathy YuandGitHub aed9434c7f Add instructions for using L4-24G GPUs to serve LLaMA 2 70B models. (#2303) 2023-10-02 16:00:58 +00:00
Andrew FerlitschandGitHub 5ce45d1222 port: kfp2 (#2300)
* port: kfp2

* port: kfp2

* resolve import issue

* fix import

* fix: import

* fix importer_node
2023-10-02 15:50:18 +00:00
Andrew FerlitschandGitHub 58b8cba1e9 port: kfp2 (#2299)
* port: kfp2

* port: kfp2

* port: kfp2
2023-10-02 15:48:42 +00:00
Andrew FerlitschandGitHub da1e2b17f3 port: kfp2 (#2298)
* port: kfp2

* port: kfp2
2023-10-02 15:47:21 +00:00
Andrew FerlitschandGitHub f98a7aa4d6 port: kfp2 (#2297)
* port: kfp2

* port: kfp2
2023-10-02 15:30:29 +00:00
Andrew FerlitschandGitHub 84393171c2 port: KFP2 (#2296) 2023-09-30 14:53:34 +00:00
Ashley XuandGitHub d7f07167aa feat: add BigFrames gen-ai notebook for a use case about drug (#2291)
* feat: add BigFrames gen-ai notebook for a use case about drug

* fix: sort the imports

* fix: fix the linter checks
2023-09-29 19:05:12 +00:00
Andrew FerlitschandGitHub 2511bb1246 fix: CI/CD failure (#2292)
* fix: CI/CD failure

* fix: CI/CD failure
2023-09-29 16:56:11 +00:00
Andrew FerlitschandGitHub 4e3fbed9f7 missing setting IS_COLAB (#2288) 2023-09-29 15:54:51 +00:00
dstnluong-googleandGitHub 6726b90892 Add train/model_export files for TFVision. (#2279)
* Add TFVision

* Add TFVision to CODEOWNERS

* remove serving.Dockerifle

* build from vertex-ai
2023-09-29 15:51:30 +00:00
weigaryandGitHub f257b2f924 Add a notebook example for the NLLB model in model garden (#2289)
* Add a notebook example for the NLLB model in model garden

* Add a notebook example for the NLLB model in model garden
2023-09-28 22:00:06 +00:00
Andrew FerlitschandGitHub 2ace347737 fix: CI/CD failure (#2284)
* fix: CI/CD failure

* continue to debug

* continue to debug

* fix REGION
2023-09-28 18:28:18 +00:00
Huguens JeanandGitHub 572cbaf8b7 Open source detectron2 handler and trainer scripts and dockerfiles. (#2286) 2023-09-28 15:23:24 +00:00
eb93058f8e Add F-VLM Dockerfiles (#2285)
Co-authored-by: minwoopark <minwoopark@google.com>
2023-09-28 15:22:53 +00:00
Andrew FerlitschandGitHub 45e9a2db9e debug CI/CD internal failure (#2278)
* debug CI/CD internal failure

* fix: CI/CD failure
2023-09-27 20:58:27 +00:00
Andrew FerlitschandGitHub 530b4a6978 fix: cache issue (#2282)
* fix: cache issue

* fix: missing import

* fix: review comments
2023-09-27 20:56:46 +00:00
Andrew FerlitschandGitHub 3a9d88d642 fix: CI/CD failure (#2277) 2023-09-27 15:38:29 +00:00
Andrew FerlitschandGitHub fe5dc2bfbe Update pre-built to prebuilt (#2276) 2023-09-25 18:40:56 +00:00
Mend RenovateandGitHub d4c96f334d chore(deps): update dependency pyupgrade to v3.13.0 (#2066) 2023-09-25 18:30:06 +00:00
Mend RenovateandGitHub 487c04a216 Update python Docker tag to v3.11 (#1345) 2023-09-25 18:20:50 +00:00
Matthew TangandGitHub 45536c644c Make SDK 2.0 bigframes notebook wording consistent (#2274)
* Make SDK 2.0 bigframes notebook wording consistent

* Make learn more in a new line
2023-09-25 14:17:48 +00:00
Andrew FerlitschandGitHub 297d7b7e71 debug: verify works (#2275) 2023-09-25 14:16:15 +00:00
Andrew FerlitschandGitHub 4a9e61a007 feat: SDK2 remote predict (#2259)
* feat: SDK2 remote predict

* fix: 3.10

* fix: py check

* fix: py check

* fix: review comments

* fix: pytorch lightning not support register model
2023-09-22 19:50:52 +00:00
Andrew FerlitschandGitHub ef6c7457c3 fix: CI/CD failure (#2269) 2023-09-22 16:10:14 +00:00
weigaryandGitHub 578287d3ef Add a section to merge a base model with a lora (#2272) 2023-09-22 15:59:48 +00:00
Andrew FerlitschandGitHub 0fb27b69b6 feat: SDK2 remote training (#2258)
* feat: SDK2 remote training

* fix: 3.10

* fix: 3.10

* fix: py check

* fix: py check

* fix: review comments
2023-09-22 12:57:22 +00:00
Andrew FerlitschandGitHub f327bd4bec feat: SDK2 remote tuning (#2260)
* feat: SDK2 remote tuning

* fix: missing pandas

* fix: review comments
2023-09-22 12:54:20 +00:00
xqr-gandGitHub efc37b883e Modify a comment. (#2262) 2023-09-21 22:31:39 +00:00
Matthew TangandGitHub 5e8011040d Add SDK 2.0 Bigframes Tensorflow sample notebook (#2256)
* Add SDK 2.0 Bigframes Tensorflow sample notebook

* Add pip install tensorflow

* Pin version of tensorflow

* Fix comments

* Add link to bigframes documentation
2023-09-21 18:45:55 +00:00
weigaryandGitHub 7189513c27 Make vLLM the default serving option for open llama peft (#2261) 2023-09-21 15:34:08 +00:00
Ray IramaneeratandGitHub ed560893d9 fix: Add REGION to the pipeline init (plus BigQuery region validation step) to make "non-US" region to work (#2245)
* Update automl_tabular_classification_beans.ipynb, add REGION to pipeline init and validate BQ REGION

- Add REGION to pipeline init
- Add validation to BQ REGION against pipeline REGION

* Update automl_tabular_classification_beans.ipynb: Add region to the region validation message to print

* Update automl_tabular_classification_beans.ipynb

* Update automl_tabular_classification_beans.ipynb

* Update automl_tabular_classification_beans.ipynb

* Update automl_tabular_classification_beans.ipynb

Fix lint error: white space around =, order of import
2023-09-21 15:32:26 +00:00
Andrew FerlitschandGitHub 0df92f8127 feat: streaming prediction (#2255)
* feat: streaming prediction

* fix: cleanup

* fix: review comments

* fix: learn about
2023-09-21 13:48:38 +00:00
Andrew FerlitschandGitHub b43d97e2c6 feat: SDK2 tabnet (#2253)
* feat: SDK2 tabnet

* fix: hardcoded project id

* fix: hardcoded project id

* fix: import scikit-learn

* fix: install preview

* fix: installs

* fix: missing TF

* fix: review comments

* fix: todo
2023-09-20 19:39:40 +00:00
Matthew TangandGitHub 5b4f20a1ef Add SDK 2.0 Bigframes Pytorch sample notebook (#2247)
* Add SDK 2.0 Bigframes Pytorch sample notebook

* Fix lint

* Add torch pip install

* Add remote job name constant
2023-09-19 19:03:06 +00:00
436 changed files with 106355 additions and 12746 deletions
+6 -1
View File
@@ -16,6 +16,7 @@ from resource_cleanup_manager import (
ResourceCleanupManager,
MatchingEngineIndexEndpointResourceCleanupManager,
MatchingEngineIndexResourceCleanupManager,
FeatureStoreLegacyCleanupManager,
FeatureStoreCleanupManager,
PipelineJobCleanupManager,
TrainingJobCleanupManager,
@@ -35,7 +36,10 @@ def run_cleanup_managers(managers: List[ResourceCleanupManager], is_dry_run: boo
print(f"Fetching {type_name}'s...")
resources = manager.list()
print(f"Found {len(resources)} {type_name}'s")
try:
print(f"Found {len(resources)} {type_name}'s")
except Exception as e:
print(f"{type_name} {e}")
for resource in resources:
try:
if not manager.is_deletable(resource):
@@ -62,6 +66,7 @@ managers: List[ResourceCleanupManager] = [
ModelResourceCleanupManager(), # ModelResourceCleanupManager must follow EndpointResourceCleanupManager due to deployed models blocking model deletion.
MatchingEngineIndexEndpointResourceCleanupManager(),
MatchingEngineIndexResourceCleanupManager(),
FeatureStoreLegacyCleanupManager(),
FeatureStoreCleanupManager(),
PipelineJobCleanupManager(),
TrainingJobCleanupManager(),
@@ -12,9 +12,15 @@ from typing import Any, Type
from google.cloud import aiplatform
from google.cloud.aiplatform import base
from google.cloud.aiplatform_v1beta1 import (FeatureOnlineStoreAdminServiceClient,
FeatureOnlineStore)
from google.cloud import storage
from proto.datetime_helpers import DatetimeWithNanoseconds
PROJECT_ID = "python-docs-samples-tests"
REGION = "us-central1"
API_ENDPOINT = f"{REGION}-aiplatform.googleapis.com"
# If a resource was updated within this number of seconds, do not delete.
RESOURCE_UPDATE_BUFFER_IN_SECONDS = 60 * 60 * 8
@@ -129,12 +135,51 @@ class MatchingEngineIndexEndpointResourceCleanupManager(VertexAIResourceCleanupM
resource.undeploy_all()
resource.delete(force=True)
class FeatureStoreCleanupManager(VertexAIResourceCleanupManager):
class FeatureStoreLegacyCleanupManager(VertexAIResourceCleanupManager):
# TODO: only deleting legacy
# not deleting ingestions jobs
# ingest_from_xxx methods do not return a job ID, there is no list command, aka no python way to delete
# not deleting batch serving jobs
# batch_serve_to_xxx methods do not return a job ID, there is no list command, aka no python way to delete
vertex_ai_resource = aiplatform.Featurestore
def resource_name(self, resource: Any) -> str:
return resource.name
def delete(self, resource):
resource.delete(force=True)
class FeatureStoreCleanupManager(VertexAIResourceCleanupManager):
# for FS 2.0
# TODO: use _v1beta1, and gapic clients
# delete features, feature groups, feature views, feature online stores
vertex_ai_resource = FeatureOnlineStore
admin_client = FeatureOnlineStoreAdminServiceClient(
client_options={"api_endpoint": API_ENDPOINT}
)
def resource_name(self, resource: Any) -> str:
return resource.name
def type_name(self) -> str:
return "FeatureOnlineStore"
def list(self) -> Any:
try:
return self.admin_client.list_feature_online_stores(parent=f"projects/{PROJECT_ID}/locations/{REGION}")
except Exception as e:
print(e)
return []
def delete(self, resource):
try:
self.admin_client.delete_feature_online_store(name=resource.name, force=True)
except Exception as e:
print(e)
class PipelineJobCleanupManager(VertexAIResourceCleanupManager):
vertex_ai_resource = aiplatform.PipelineJob
+40 -1
View File
@@ -18,6 +18,7 @@
import argparse
import pathlib
import os
import csv
import execute_changed_notebooks_helper
@@ -37,7 +38,7 @@ parser = argparse.ArgumentParser(description="Run changed notebooks.")
parser.add_argument(
"--test_paths_file",
type=pathlib.Path,
help="The path to the file that has newline-limited folders of notebooks that should be tested.",
help="The path to the file that has newline-delimited folders of notebooks that should be tested.",
required=True,
)
parser.add_argument(
@@ -128,6 +129,20 @@ parser.add_argument(
default=10,
required=False,
)
parser.add_argument(
"--run_first_file",
type=pathlib.Path,
help="The path to the file that has newline-delimited of notebooks to run in the first batch",
default=None,
required=False,
)
parser.add_argument(
"--aiplatform_whl",
type=str,
help="The GCS path to a whl version google-cloud-aiplatform",
default=None,
required=False,
)
parser.add_argument(
"--dry_run",
type=str2bool,
@@ -157,6 +172,29 @@ else:
accumulative_results = execute_changed_notebooks_helper.load_results(results_bucket, results_file)
notebooks = [changed_notebook for changed_notebook in changed_notebooks if execute_changed_notebooks_helper.select_notebook(changed_notebook, accumulative_results, args.test_percent)]
# cap the number of notebooks to the specified percentage
max_notebooks = int((len(changed_notebooks) * (args.test_percent/100)))
if (len(notebooks) > max_notebooks):
notebooks = notebooks[:max_notebooks]
run_first = []
if args.run_first_file:
if not os.path.isfile(args.run_first_file):
print("Error: file does not exist", args.run_first_file)
else:
with open(args.run_first_file, 'r') as csvfile:
reader = csv.reader(csvfile)
for row in reader:
notebook = row[0]
run_first.append(notebook)
for notebook in run_first:
if notebook in notebooks:
# remove from existing list
notebooks.remove(notebook)
# add back to the front of the list
notebooks.insert(0, notebook)
print(f"Run first: {notebook}")
if args.dry_run:
print("Dry run ...\n")
@@ -177,4 +215,5 @@ else:
variable_vpc_network=args.variable_vpc_network,
private_pool_id=args.private_pool_id,
concurrent_notebooks=args.concurrent_notebooks,
aiplatform_whl=args.aiplatform_whl
)
@@ -41,10 +41,13 @@ from utils import NotebookProcessors, util
# A buffer so that workers finish before the orchestrating job
WORKER_TIMEOUT_BUFFER_IN_SECONDS: int = 60 * 60
PYTHON_VERSION = "3.9" # Set default python version
# rolling time window for accumulating build results for selecting notebooks
MAX_RESULTS_AGE_SECONDS: int = (60 * 60) * 24 * 60 # 60 days
# maximum time since last run to force a run on the current build
MAX_AGE_BEFORE_FORCE_RUN: int = (60 * 60) * 24 * 30
def format_timedelta(delta: datetime.timedelta) -> str:
@@ -118,8 +121,12 @@ def load_results(results_bucket: str,
if notebook in accumulative_results:
accumulative_results[notebook]['passed'] += build_results[notebook]['passed']
accumulative_results[notebook]['failed'] += build_results[notebook]['failed']
if accumulative_results[notebook]['last_time_ran'] < time_created:
accumulative_results[notebook]['last_time_ran'] = time_created
else:
accumulative_results[notebook] = build_results[notebook]
accumulative_results[notebook]['failed_on_latest_run'] = build_results[notebook]['failed']
accumulative_results[notebook]['last_time_ran'] = time_created
print(accumulative_results)
except Exception as e:
@@ -138,19 +145,37 @@ def select_notebook(changed_notebook: str,
if changed_notebook in accumulative_results:
pass_count = accumulative_results[changed_notebook]['passed']
fail_count = accumulative_results[changed_notebook]['failed']
failed_on_latest_run = accumulative_results[changed_notebook]['failed_on_latest_run']
last_time_ran = accumulative_results[changed_notebook]['last_time_ran']
else:
pass_count = 1
fail_count = 0
failed_on_latest_run = 0
last_time_ran = datetime.datetime.now().replace(tzinfo=None)
inferred_failure_rate = fail_count / (pass_count + fail_count)
# If notebook has not been ran in a long time, force running it
if (datetime.datetime.now().replace(tzinfo=None) - last_time_ran).total_seconds() > MAX_AGE_BEFORE_FORCE_RUN:
should_test_do_to_age = True
else:
should_test_do_to_age = False
# if failed on the last time it was ran, select the notebook
if failed_on_latest_run:
inferred_failure_rate = 1
# otherwise, calculate the frequency of failure
else:
inferred_failure_rate = fail_count / (pass_count + fail_count)
# If failure rate is high, the chance of testing should be higher
should_test_due_to_failure = random.uniform(0, 1) <= inferred_failure_rate
#if accumulative_resultsi[changed_notebook]['latest_date_ran']
# Additionally, only test a percentage of these
should_test_due_to_random_subset = random.uniform(0, 1) <= (test_percent / 100)
if should_test_due_to_failure or should_test_due_to_random_subset:
if should_test_due_to_failure or should_test_due_to_random_subset or should_test_do_to_age:
print(f"Selected: {changed_notebook}, {should_test_due_to_failure}, {should_test_due_to_random_subset}")
return True
else:
@@ -213,7 +238,7 @@ def _get_notebook_python_version(notebook_path: str) -> str:
# Look for the python version specification pattern
re_match = re.search(
"python version = (\d\.\d)", markdown, flags=re.IGNORECASE
"python version = (\d+\.\d+)", markdown, flags=re.IGNORECASE
)
if re_match:
# get the version number
@@ -246,7 +271,7 @@ def process_and_execute_notebook(
private_pool_id: Optional[str],
deadline: datetime.datetime,
notebook: str,
should_get_tail_logs: bool = False,
should_get_tail_logs: bool = True,
) -> NotebookExecutionResult:
print(f"Running notebook: {notebook}")
@@ -428,15 +453,39 @@ def _save_results(results: List[NotebookExecutionResult],
else:
pass_count = 0
fail_count = 1
if result.error_message is None:
error_type = ''
elif '500 Internal' in result.error_message or 'INTERNAL' in result.error_message or 'internal error' in result.error_message:
error_type = 'INTERNAL'
elif 'context deadline exceeded' in result.error_message or 'TIMEOUT' in result.error_message:
error_type = 'TIMEOUT'
elif 'Quota' in result.error_message or 'quotas are exceeded' in result.error_message:
error_type = 'QUOTA'
elif 'ServiceUnavailable' in result.error_message:
error_type = 'SERVICEUNAVAILABLE'
elif 'ModuleNotFoundError' in result.error_message:
error_type = 'IMPORT'
elif result.is_pass:
error_type = ''
else:
error_type = 'undetermined'
if error_type != '':
log_url = result.log_url
else:
log_url = ''
build_results[result.path] = {
'duration': result.duration.total_seconds(),
'start_time': str(result.start_time),
'passed': pass_count,
'failed': fail_count
'failed': fail_count,
'error_type': error_type,
'log_url': log_url
}
print(f"adding {result.path}")
print("Saving accumulative results ...")
print(f"Saving accumulative results to {results_file}, nentries {len(build_results)}")
content = json.dumps(build_results)
client = storage.Client()
@@ -459,6 +508,7 @@ def process_and_execute_notebooks(
variable_vpc_network: Optional[str] = None,
private_pool_id: Optional[str] = None,
concurrent_notebooks: Optional[int] = 10,
aiplatform_whl: Optional[str] = None,
):
"""
Run the notebooks that exist under the folders defined in the test_paths_file.
@@ -490,6 +540,7 @@ def process_and_execute_notebooks(
timeout (str):
Required. Timeout string according to https://cloud.google.com/build/docs/build-config-file-schema#timeout.
concurrent_notebooks (int): Max number of notebooks per minute to run in parallel.
aiplatform_whl: alternate whl version of Vertex AI SDK to install
"""
# Calculate deadline
@@ -36,7 +36,7 @@ steps:
- -c
- |
. workspace/env/bin/activate &&
python3 .cloud-build/execute_changed_notebooks_cli.py --test_paths_file "${_TEST_PATHS_FILE}" --base_branch "${_FORCED_BASE_BRANCH}" --container_uri ${_PYTHON_IMAGE} --staging_bucket ${_GCS_STAGING_BUCKET} --artifacts_bucket ${_GCS_STAGING_BUCKET}/executed_notebooks/PR_${_PR_NUMBER}/BUILD_${BUILD_ID} --variable_project_id ${PROJECT_ID} --variable_region ${_GCP_REGION} --variable_service_account ${_GCP_SERVICE_ACCOUNT} --variable_vpc_network "${_GPC_VPC_NETWORK_NAME}" `if [ ! -z "${_PRIVATE_POOL_NAME}" ]; then echo "--private_pool_id ${_PRIVATE_POOL_NAME}"; fi` --build_id ${BUILD_ID} --test_percent=${_TEST_PERCENT} --concurrent_notebooks=${_CONCURRENT_NOTEBOOKS}
python3 .cloud-build/execute_changed_notebooks_cli.py --test_paths_file "${_TEST_PATHS_FILE}" --base_branch "${_FORCED_BASE_BRANCH}" --container_uri ${_PYTHON_IMAGE} --staging_bucket ${_GCS_STAGING_BUCKET} --artifacts_bucket ${_GCS_STAGING_BUCKET}/executed_notebooks/PR_${_PR_NUMBER}/BUILD_${BUILD_ID} --variable_project_id ${PROJECT_ID} --variable_region ${_GCP_REGION} --variable_service_account ${_GCP_SERVICE_ACCOUNT} --variable_vpc_network "${_GCP_VPC_NETWORK_NAME}" `if [ ! -z "${_PRIVATE_POOL_NAME}" ]; then echo "--private_pool_id ${_PRIVATE_POOL_NAME}"; fi` --build_id ${BUILD_ID} --test_percent=${_TEST_PERCENT} --concurrent_notebooks=${_CONCURRENT_NOTEBOOKS} --run_first_file=${_RUN_FIRST_FILE}
env:
- 'IS_TESTING=1'
timeout: 86400s
+8
View File
@@ -0,0 +1,8 @@
notebooks/official/pipelines/google_cloud_pipeline_components_automl_text.ipynb
notebooks/official/generative_ai/rlhf_tune_llm.ipynb
notebooks/official/generative_ai/tune_peft.ipynb
notebooks/official/prediction/llm_streaming_prediction.ipynb
notebooks/official/migration/sdk-automl-text-classification-batch-prediction.ipynb
notebooks/official/vizier/get_started_vertex_vizier.ipynb
notebooks/official/workbench/sentiment_analysis/Sentiment_Analysis.ipynb
notebooks/official/model_monitoring/get_started_with_model_monitoring_automl.ipynb
1 notebooks/official/pipelines/google_cloud_pipeline_components_automl_text.ipynb
2 notebooks/official/generative_ai/rlhf_tune_llm.ipynb
3 notebooks/official/generative_ai/tune_peft.ipynb
4 notebooks/official/prediction/llm_streaming_prediction.ipynb
5 notebooks/official/migration/sdk-automl-text-classification-batch-prediction.ipynb
6 notebooks/official/vizier/get_started_vertex_vizier.ipynb
7 notebooks/official/workbench/sentiment_analysis/Sentiment_Analysis.ipynb
8 notebooks/official/model_monitoring/get_started_with_model_monitoring_automl.ipynb
-40
View File
@@ -1,40 +0,0 @@
notebooks/official/training/pytorch_gcs_data_training.ipynb
notebooks/official/custom/custom_training_tensorboard_profiler.ipynb
notebooks/official/custom/custom-tabular-bq-managed-dataset.ipynb
notebooks/official/ml_metadata/sdk-metric-parameter-tracking-for-locally-trained-models.ipynb
notebooks/official/ml_metadata/sdk-metric-parameter-tracking-for-custom-jobs.ipynb
notebooks/official/tabnet/tabnet_vertex_tutorial.ipynb
notebooks/official/tabnet/get_started_with_tabnet.ipynb
notebooks/official/pipelines/google_cloud_pipeline_components_automl_text.ipynb
notebooks/official/pipelines/multicontender_vs_champion_deployment_method.ipynb
notebooks/official/pipelines/google_cloud_pipeline_components_automl_images.ipynb
notebooks/official/pipelines/rapid_prototyping_bqml_automl.ipynb
notebooks/official/pipelines/challenger_vs_blessed_deployment_method.ipynb
notebooks/official/matching_engine/sdk_matching_engine_create_stack_overflow_embeddings.ipynb
notebooks/official/matching_engine/sdk_matching_engine_for_indexing.ipynb
notebooks/official/matching_engine/sdk_matching_engine_create_text_to_image_embeddings.ipynb
notebooks/official/explainable_ai/sdk_custom_image_classification_online_explain.ipynb
notebooks/official/explainable_ai/xai_image_classification_feature_attributions.ipynb
notebooks/official/explainable_ai/sdk_custom_image_classification_batch_explain.ipynb
notebooks/official/tabular_workflows/tabnet_on_vertex_pipelines.ipynb
notebooks/official/model_registry/get_started_with_model_registry.ipynb
notebooks/official/model_registry/bqml_vertexai_model_registry.ipynb
notebooks/official/sdk/SDK_Custom_Training_Python_Package_Managed_Text_Dataset_Tensorflow_Serving_Container.ipynb
notebooks/official/model_monitoring/batch_prediction_model_monitoring.ipynb
notebooks/official/model_monitoring/get_started_with_model_monitoring_setup.ipynb
notebooks/official/model_monitoring/get_started_with_model_monitoring_custom.ipynb
notebooks/official/model_monitoring/get_started_with_model_monitoring_custom_tf_serving.ipynb
notebooks/official/model_monitoring/model_monitoring.ipynb
notebooks/official/tensorboard/tensorboard_profiler_custom_training_with_prebuilt_container.ipynb
notebooks/official/tensorboard/tensorboard_hyperparameter_tuning_with_hparams.ipynb
notebooks/official/tensorboard/tensorboard_profiler_custom_training.ipynb
notebooks/official/model_evaluation/custom_tabular_regression_model_evaluation.ipynb
notebooks/official/model_evaluation/custom_tabular_classification_model_evaluation.ipynb
notebooks/official/model_evaluation/automl_video_classification_model_evaluation.ipynb
notebooks/official/experiments/comparing_local_trained_models.ipynb
notebooks/official/automl/automl_image_classification_online_online_prediction.ipynb
notebooks/official/automl/automl-text-classification.ipynb
notebooks/official/automl/sdk_automl_video_object_tracking_batch.ipynb
notebooks/official/feature_store/sdk-feature-store-pandas.ipynb
notebooks/official/prediction/custom_batch_prediction_feature_filter.ipynb
notebooks/official/prediction/pytorch_image_classification_with_prebuilt_serving_containers.ipynb
-80
View File
@@ -1,80 +0,0 @@
notebooks/official/training/hyperparameter_tuning_tensorflow.ipynb
notebooks/official/training/get_started_with_vertex_distributed_training.ipynb
notebooks/official/training/hyperparameter_tuning_xgboost.ipynb
notebooks/official/training/multi_node_ddp_gloo_vertex_training_with_custom_container.ipynb
notebooks/official/training/distributed_hyperparameter_tuning.ipynb
notebooks/official/training/pytorch-text-sentiment-classification-custom-train-deploy.ipynb
notebooks/official/training/xgboost_data_parallel_training_on_cpu_using_dask.ipynb
notebooks/official/training/multi_node_ddp_nccl_vertex_training_with_custom_container.ipynb
notebooks/official/bigquery_ml/get_started_with_bqml_training.ipynb
notebooks/official/bigquery_ml/bqml-online-prediction.ipynb
notebooks/official/custom/custom_training_container_and_model_registry.ipynb
notebooks/official/custom/sdk-custom-image-classification-online.ipynb
notebooks/official/custom/sdk-custom-image-classification-batch.ipynb
notebooks/official/custom/SDK_FBProphet_Forecasting_Online.ipynb
notebooks/official/custom/get_started_vertex_training_xgboost.ipynb
notebooks/official/custom/get_started_with_vertex_endpoint_and_shared_vm.ipynb
notebooks/official/custom/SDK_Custom_Container_Prediction.ipynb
notebooks/official/reduction_server/pytorch_distributed_training_reduction_server.ipynb
notebooks/official/tabnet/ai-explanations-tabnet-algorithm.ipynb
notebooks/official/vizier/get_started_vertex_vizier.ipynb
notebooks/official/vizier/gapic-vizier-multi-objective-optimization.ipynb
notebooks/official/pipelines/get_started_with_hpt_pipeline_components.ipynb
notebooks/official/pipelines/google_cloud_pipeline_components_automl_tabular.ipynb
notebooks/official/pipelines/custom_tabular_train_batch_pred_bq_pipeline.ipynb
notebooks/official/pipelines/metrics_viz_run_compare_kfp.ipynb
notebooks/official/pipelines/google_cloud_pipeline_components_model_upload_predict_evaluate.ipynb
notebooks/official/pipelines/google_cloud_pipeline_components_model_train_upload_deploy.ipynb
notebooks/official/pipelines/get_started_with_machine_management.ipynb
notebooks/official/pipelines/custom_model_training_and_batch_prediction.ipynb
notebooks/official/pipelines/control_flow_kfp.ipynb
notebooks/official/pipelines/lightweight_functions_component_io_kfp.ipynb
notebooks/official/pipelines/google_cloud_pipeline_components_bqml_text.ipynb
notebooks/official/pipelines/pipelines_intro_kfp.ipynb
notebooks/official/pipelines/automl_tabular_classification_beans.ipynb
notebooks/official/pipelines/google_cloud_pipeline_components_dataproc_tabular.ipynb
notebooks/official/explainable_ai/sdk_automl_tabular_classification_online_explain.ipynb
notebooks/official/explainable_ai/sdk_custom_tabular_regression_online_explain.ipynb
notebooks/official/explainable_ai/sdk_automl_tabular_binary_classification_batch_explain.ipynb
notebooks/official/explainable_ai/sdk_custom_tabular_regression_online_explain_get_metadata.ipynb
notebooks/official/explainable_ai/sdk_custom_tabular_regression_batch_explain.ipynb
notebooks/official/tabular_workflows/prophet_on_vertex_pipelines.ipynb
notebooks/official/tabular_workflows/wide_and_deep_on_vertex_pipelines.ipynb
notebooks/official/sdk/SDK_AutoML_Video_Classification.ipynb
notebooks/official/model_monitoring/get_started_with_model_monitoring_automl.ipynb
notebooks/official/model_monitoring/get_started_with_model_monitoring_automl_image_batch.ipynb
notebooks/official/model_monitoring/get_started_with_model_monitoring_automl_image_online.ipynb
notebooks/official/model_monitoring/get_started_with_model_monitoring_xgboost.ipynb
notebooks/official/tensorboard/tensorboard_custom_training_with_custom_container.ipynb
notebooks/official/tensorboard/tensorboard_custom_training_with_prebuilt_container.ipynb
notebooks/official/tensorboard/tensorboard_vertex_ai_pipelines_integration.ipynb
notebooks/official/model_evaluation/automl_text_classification_model_evaluation.ipynb
notebooks/official/model_evaluation/get_started_with_custom_model_evaluation_import.ipynb
notebooks/official/model_evaluation/automl_tabular_classification_model_evaluation.ipynb
notebooks/official/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
notebooks/official/experiments/get_started_with_vertex_experiments.ipynb
notebooks/official/experiments/comparing_pipeline_runs.ipynb
notebooks/official/experiments/get_started_with_vertex_experiments_autologging.ipynb
notebooks/official/experiments/build_model_experimentation_lineage_with_prebuild_code.ipynb
notebooks/official/experiments/delete_outdated_tensorboard_experiments.ipynb
notebooks/official/automl/sdk_automl_tabular_regression_batch_bq.ipynb
notebooks/official/automl/sdk_automl_text_sentiment_analysis_online.ipynb
notebooks/official/automl/sdk_automl_text_entity_extraction_online.ipynb
notebooks/official/automl/sdk_automl_forecasting_hierarchical_batch.ipynb
notebooks/official/automl/automl_text_entity_extraction_batch_prediction.ipynb
notebooks/official/automl/automl_image_classification_batch_prediction.ipynb
notebooks/official/automl/automl_text_sentiment_analysis_batch_prediction.ipynb
notebooks/official/automl/sdk_automl_tabular_regression_online_bq.ipynb
notebooks/official/automl/get_started_automl_training.ipynb
notebooks/official/automl/automl-tabular-classification.ipynb
notebooks/official/automl/automl_image_object_detection_export_edge.ipynb
notebooks/official/automl/sdk_automl_image_object_detection_batch.ipynb
notebooks/official/automl/automl_tabular_on_vertex_pipelines.ipynb
notebooks/official/automl/sdk_automl_video_classification_batch.ipynb
notebooks/official/automl/sdk_automl_video_action_recognition_batch.ipynb
notebooks/official/automl/sdk_automl_tabular_forecasting_batch.ipynb
notebooks/official/automl/automl_image_object_detection_online_prediction.ipynb
notebooks/official/automl/automl_forecasting_bqml_arima_plus_comparison.ipynb
notebooks/official/datasets/get_started_bq_datasets.ipynb
notebooks/official/datasets/get_started_with_data_labeling.ipynb
notebooks/official/feature_store/feature_store_streaming_ingestion_sdk.ipynb
+26 -1
View File
@@ -35,7 +35,7 @@ class RemoveNoExecuteCells(Preprocessor):
class UpdateVariablesPreprocessor(Preprocessor):
def __init__(self, replacement_map: Dict):
def __init__(self, replacement_map: Dict[str, str]):
self._replacement_map = replacement_map
@staticmethod
@@ -98,3 +98,28 @@ class UniqueStringsPreprocessor(Preprocessor):
executable_cells.append(cell)
notebook.cells = executable_cells
return notebook, resources
class VertexAIInstallProprocessor(Preprocessor):
def __init__(self, vertex_ai_wheel):
self.vertex_ai_wheel = vertex_ai_wheel
@staticmethod
def update_vertex_ai_install(content: str):
if "google-cloud-aiplatform" not in content:
return content
return (
f"gsutil cp {self.vertex_ai_wheel} google-cloud-aiplatform.whl\n" +
content.replace("google-cloud-aiplatform\n", "google-cloud-aiplatform.whl\n")
.replace("google-cloud-aiplatform ", "google-cloud-aiplatform.whl ")
)
def preprocess(self, notebook, resources=None):
executable_cells = []
for cell in notebook.cells:
if cell.cell_type == "code":
cell.source = self.update_vertex_ai_install(
content=cell.source,
)
executable_cells.append(cell)
notebook.cells = executable_cells
+56 -5
View File
@@ -5,18 +5,69 @@ Cloud Storage location: gs://cloud-build-notebooks-presubmit/build_results/
'''
import argparse
import json
from util import download_file
import csv
import datetime
from google.cloud import storage
BUILD_BUCKET = "cloud-build-notebooks-presubmit"
BUILD_FOLDER = "build_results"
parser = argparse.ArgumentParser()
parser.add_argument('--file', dest='file',
default='build.json', type=str, help='build results file')
import json
default=None, type=str, help='build results filei (local or GCS)')
args = parser.parse_args()
with open('build.json', 'r') as f:
investigate = {}
with open('investigate.csv', 'r') as csvfile:
reader = csv.reader(csvfile)
for row in reader:
investigate[row[0][:-6]] = row[1]
if not args.file:
client = storage.Client()
blobs = client.list_blobs(BUILD_BUCKET, prefix=BUILD_FOLDER)
newest_time = datetime.datetime(2000, 1, 1)
for blob in blobs:
# individual PR
if blob.size < 2000:
continue
time_created = blob.time_created.replace(tzinfo=None)
if time_created > newest_time:
newest_time = time_created
args.file = f"gs://{BUILD_BUCKET}/{blob.name}"
if args.file.startswith("gs://"):
path = args.file[5:]
bucket = path.split('/')[0]
file = path[len(bucket)+1:]
download_file(bucket, file, "build.json")
args.file = "build.json"
with open(args.file, 'r') as f:
results = json.load(f)
for item in results.items():
notebook = item[0][len("/notebooks/official/")-1:-6]
if item[1]['passed']:
print(f"{item[0]},PASSED")
passed = "PASS"
else:
print(f"{item[0]},FAILED")
if notebook in investigate:
passed = "INVG"
else:
passed = "FAIL"
error = item[1]['error_type']
if passed == "FAIL":
if error == '':
error = "undetermined"
if 'log_url' in item[1]:
log_url = item[1]['log_url']
else:
log_url = ''
else:
log_url = ''
print(f"{notebook:75} {passed} {error:10} {log_url}")
+19
View File
@@ -0,0 +1,19 @@
notebook,status
prediction/llm_streaming_prediction.ipynb,wait_for_fix
custom/get_started_with_vertex_endpoint_and_shared_vm.ipynb,issue 2527
feature_store/online_feature_serving_and_fetching_bigquery_data_with_feature_store.ipynb,wait_for_reaper
feature_store/online_feature_serving_and_vector_retrieval_bigquery_data_with_feature_store.ipynb,wait_for_reaper
pipelines/google_cloud_pipeline_components_TPU_model_train_upload_deploy.ipynb,wait_for_fix
explainable_ai/sdk_custom_image_classification_batch_explain.ipynb,issue 2528
explainable_ai/sdk_custom_image_classification_online_explain.ipynb,issue 2528
explainable_ai/sdk_custom_tabular_regression_online_explain.ipynb,issue 2528
explainable_ai/sdk_automl_tabular_binary_classification_batch_explain.ipynb,issue 2528
explainable_ai/xai_image_classification_feature_attributions.ipynb,issue 2528
matching_engine,sdk_matching_engine_create_stack_overflow_embeddings.ipynb,issue 2530
automl/automl_forecasting_bqml_arima_plus_comparison.ipynb,flaky
model_evaluation/custom_tabular_regression_model_evaluation.ipynb,regr
experiments/get_started_with_vertex_experiments.ipynb,regr
experiments/comparing_local_trained_models.ipynb,regr
generative_ai/tune_peft.ipynb,internal
pipelines/custom_model_training_and_batch_prediction.ipynb,regr
feature_store/online_feature_serving_and_fetching_bigquery_data_with_feature_store_optimized.ipynb,wait_for_reaper
1 notebook status
2 prediction/llm_streaming_prediction.ipynb wait_for_fix
3 custom/get_started_with_vertex_endpoint_and_shared_vm.ipynb issue 2527
4 feature_store/online_feature_serving_and_fetching_bigquery_data_with_feature_store.ipynb wait_for_reaper
5 feature_store/online_feature_serving_and_vector_retrieval_bigquery_data_with_feature_store.ipynb wait_for_reaper
6 pipelines/google_cloud_pipeline_components_TPU_model_train_upload_deploy.ipynb wait_for_fix
7 explainable_ai/sdk_custom_image_classification_batch_explain.ipynb issue 2528
8 explainable_ai/sdk_custom_image_classification_online_explain.ipynb issue 2528
9 explainable_ai/sdk_custom_tabular_regression_online_explain.ipynb issue 2528
10 explainable_ai/sdk_automl_tabular_binary_classification_batch_explain.ipynb issue 2528
11 explainable_ai/xai_image_classification_feature_attributions.ipynb issue 2528
12 matching_engine sdk_matching_engine_create_stack_overflow_embeddings.ipynb issue 2530
13 automl/automl_forecasting_bqml_arima_plus_comparison.ipynb flaky
14 model_evaluation/custom_tabular_regression_model_evaluation.ipynb regr
15 experiments/get_started_with_vertex_experiments.ipynb regr
16 experiments/comparing_local_trained_models.ipynb regr
17 generative_ai/tune_peft.ipynb internal
18 pipelines/custom_model_training_and_batch_prediction.ipynb regr
19 feature_store/online_feature_serving_and_fetching_bigquery_data_with_feature_store_optimized.ipynb wait_for_reaper
+11
View File
@@ -0,0 +1,11 @@
sdk2_remote_tabnet_training.ipynb
remote_hyperparameter_tuning.ipynb
remote_prediction.ipynb
remote_training_bigframes_pytorch.ipynb
remote_training_bigframes_sklearn.ipynb
remote_training_bigframes_tensorflow.ipynb
remote_training_lightning.ipynb
remote_training_pytorch.ipynb
remote_training_sklearn.ipynb
remote_training_tensorflow_with_autologging.ipynb
@@ -15,7 +15,7 @@ steps:
- -c
- |
. workspace/env/bin/activate &&
python3 notebooks/notebook_template_review.py --web --title --steps --desc --linkback --notebook-dir=notebooks/official >web.html
python3 notebooks/notebook_template_review.py --web --title --steps --desc --linkback --notebook-dir=notebooks/official --skip-file=${_DO_NOT_INDEX_FILE} >web.html
artifacts:
objects:
location: gs://${_GCS_ARTIFACTS_BUCKET}/webdoc
+2 -2
View File
@@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Fetch pull request branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch base main branch
+1 -1
View File
@@ -4,7 +4,7 @@
# 2. To lint specific notebooks:
# docker run -v ${PWD}:/setup/app gcr.io/python-docs-samples-tests/notebook_linter:latest notebooks/1.ipynb notebooks/2.ipynb
FROM python:3.10
FROM python:3.12
WORKDIR setup
+5 -5
View File
@@ -2,9 +2,9 @@ git+https://github.com/tensorflow/docs
ipython
jupyter
nbconvert
black==23.3.0
pyupgrade==3.7.0
isort==5.12.0
flake8==6.0.0
nbqa==1.7.0
black==24.4.2
pyupgrade==3.15.2
isort==5.13.2
flake8==7.0.0
nbqa==1.8.5
+18 -10
View File
@@ -10,14 +10,22 @@
/pipeline_components @Ark-kun
/pipeline_components/image_ml_model_training @lakeyk
/prediction_featurestore_integration @googleapis/vertex-prediction-team
/vertex_vision_model_garden/model_oss/util @weigary
/vertex_vision_model_garden/model_oss/diffusers @weigary
/vertex_vision_model_garden/model_oss/keras @dstnluong-google
/vertex_vision_model_garden/model_oss/transformers @dstnluong-google
/vertex_vision_model_garden/model_oss/pic2word @jismailyan-google
/vertex_vision_model_garden/model_oss/open_clip @lydhr
/vertex_vision_model_garden/model_oss/movinet @KCFindstr
/vertex_vision_model_garden/model_oss/data_converter @KCFindstr
/vertex_vision_model_garden/model_oss/peft @weigary
/vertex_vision_model_garden/model_oss/lm-evaluation-harness @kathyyu-google
/vertex_model_garden/model_oss/notebook_util @minwoo33park
/vertex_model_garden/model_oss/util @weigary
/vertex_model_garden/model_oss/diffusers @weigary
/vertex_model_garden/model_oss/keras @dstnluong-google
/vertex_model_garden/model_oss/transformers @dstnluong-google
/vertex_model_garden/model_oss/pic2word @jismailyan-google
/vertex_model_garden/model_oss/open_clip @lydhr
/vertex_model_garden/model_oss/movinet @KCFindstr
/vertex_model_garden/model_oss/data_converter @KCFindstr
/vertex_model_garden/model_oss/peft @weigary
/vertex_model_garden/model_oss/lm-evaluation-harness @kathyyu-google
/vertex_model_garden/model_oss/tfvision @dstnluong-google
/vertex_model_garden/model_oss/fvlm @minwoo33park
/vertex_model_garden/model_oss/imagebind @kathyyu-google
/vertex_model_garden/model_oss/llava @py4
/vertex_model_garden/model_oss/vllm @kathyyu-google
/vertex_model_garden/benchmarking_reports @lavraicse
/vertex_model_garden/model_oss/autogluon @lavraicse
@@ -1,5 +1,5 @@
absl-py==1.1.0
fastapi==0.75.2
fastapi==0.109.1
uvicorn==0.18.2
timm==0.5.4
smart_open==6.0.0
@@ -1,4 +1,4 @@
google-cloud-bigquery==2.20.0
tensorflow==2.7.2
pillow==9.0.1
pillow==10.3.0
tf-agents==0.8.0
@@ -1,4 +1,4 @@
google-cloud-pubsub==2.5.0
pillow==9.0.1
pillow==10.3.0
tf-agents==0.8.0
tensorflow==2.7.2
@@ -1,5 +1,5 @@
dataclasses==0.6
google-cloud-aiplatform==1.8.1
tensorflow==2.7.2
pillow==9.0.1
pillow==10.3.0
tf-agents==0.8.0
Binary file not shown.

After

Width:  |  Height:  |  Size: 472 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

@@ -0,0 +1,253 @@
# ViT PyTorch vs JAX training benchmarks on Vertex AI Training Platform
Lav Rai, Software Engineer, Google Cloud
Xiang Xu, Software Engineer, Google Cloud
Andreas Steiner, Software Engineer, Google DeepMind
Tao Wang, Software Engineer, Google DeepMind
Alexander Kolesnikov, Research Engineer, Google DeepMind
## Introduction
Many repositories now offer both PyTorch and JAX versions of a model. For
example, [Hugging Face offers many models such as GPT2, BERT][1]
etc. Other examples are [OpenLLaMa][2] and [ViT][3]
models which were first developed in JAX and then their corresponding PyTorch
versions were made available. **Given both the PyTorch and JAX options for a
model, it may not be obvious as to which option to choose**. To make such a
decision, it is important for one to know about the training cost, effectiveness
and efficiency for each choice.
Apart from the framework choice, the other choice that one faces on Vertex AI
training platform is the type and count of the accelerators. Although the
[Vertex AI pricing table][4] lists the price per hour for each
machine, **one may not know beforehand about the training speed of JAX and
PyTorch frameworks for different types and count of the accelerators**.
If one has access to some training benchmark numbers for the same model
under (a) PyTorch and JAX frameworks and (b) for different types and count of
the accelerators, then it will be easier for them to make a cost effective
decision. Such a benchmark will also aid the developers in identifying strength
and weakness of different choices and then figure out recipes to remove those
weaknesses if possible.
This blog uses the ViT [classification models][5] of varying sizes
to benchmark the training performance of PyTorch and JAX versions on the Vertex
AI Platform under different machine configurations. The goal is to:
- Benchmark OSS ViT training for both PyTorch and JAX frameworks.
- Benchmark OSS ViT L16, H14, g14, and G14 models.
- Benchmark OSS ViT PyTorch training with A100 GPUs.
- Benchmark OSS ViT JAX training with A100 GPUs and TPU V3 accelerators.
## Benchmarking setup
This section lays out the benchmarking set up for the [PyTorch][6] and [JAX][7]
frameworks and provides a reasoning for choosing those settings.
### PyTorch GPU
#### Machine configuration
We run training jobs on [Vertex AI Custom Training][8] using 1
single node with 8 A100-40GB GPUs.
- Machine type: [a2-highgpu-8g][9]
- Machine count: 1
- Accelerator type: [NVIDIA_TESLA_A100 (40GB)][10]
- Accelerator count: 8
#### Modeling
We benchmark 4 variants of ViT model in different sizes:
- [ViT-L16, 300M params][11]
- [ViT-H14, 630M params][12]
- [ViT-g14, 1B params][13]
- [ViT-G14, 1.8B params][14]
We use the Huggingface [transformers library][15] for ViT L16 and
H14 variants, and the [TIMM library][16] for ViT g14 and G14
variants.
#### Dataset
We run training against the [cifar10][17] dataset with 50K training
images and 10K test images. To factor out network communication overhead for
data loading, we copy the whole dataset to the local disk then load data from
the local disk during training.
#### Training parameters
- Trainer
- We use [PyTorch Lightning][18] as the trainer for the
boilerplate data loading and train loop coding.
- Precision
- Float16
- Input resolution
- 224 x 224
- Strategy
- We use [DDP][19] for models which can be entirely loaded to one
GPU, use [Deepspeed-ZeRO][20] otherwise:
- ViT-L16: DDP
- ViT-H14: DDP
- ViT-g14: DDP
- ViT-G14: Deepspeed-ZeRO stage-3
- Batch size
- We use the max batch size as power of 2 without CUDA OOM for each model:
- ViT-L16: 64 per GPU
- ViT-H14: 16 per GPU
- ViT-g14: 16 per GPU
- ViT-G14: 32 per GPU
- Compilation
- We apply [torch.compile][21] to model whenever it's applicable:
- ViT-L16: torch.compile
- ViT-H14: torch.compile
- ViT-g14: torch.compile
- ViT-G14: N/A
### JAX TPU and GPU
#### Machine configuration
All the TPU and GPU training jobs are run on [Vertex AI Custom
Training][8]. The following machine configurations were used for the
TPU and GPU experiments:
**Note**: TPU V3 POD requires multi-host supporting training code. For example,
a 32 core POD runs on 4 hosts with each host using 8 cores.
**Note**: 8 A100 are similar to TPU V3 32 cores in terms of [Vertex AI
pricing][4].
**Note**: [Each TPU v3 chip has 2 cores which can use 32 GB high-bandwidth
memory][22] (16 GB per core) so total memory for 32 cores is 16x32 =
512 GB. Therefore for the same price, TPUs offer more memory than 8 A100-40GB
GPUs.
#### Modeling
We decided to use an OSS code repository for model implementation. Using an OSS
repository helps anyone to independently verify the benchmarking results and
also relate to the results well. For JAX, we selected the
[Big Vision][23] code repository.
Same as the PyTorch modeling, we benchmark 4 variants of ViT model in different
sizes:
- [ViT-L16, 300M params][24]
- [ViT-H14, 630M params][24]
- [ViT-g14, 1B params][24]
- [ViT-G14, 1.8B params][24]
**Note**: The [Big Vision code repo][23] has not made the
checkpoints publicly available for the models larger than the ViT-L16. Therefore
for the rest of the three variants, the experiments only used random
initialization for benchmarking the training speed.
#### Dataset
We use training against the [cifar10 TensorFlow dataset][25] with
50K training images and 10K test images. This dataset is the same as the one
used for PyTorch experiments except that it is loaded as a TensorFlow dataset.
Similar to the PyTorch experiments, we copy the whole dataset to the docker
image to factor out network communication overhead for data loading.
#### Training parameters
- Precision
- "bfloat16" setting was used.
- Input resolution
- 224 x 224 after resize (to 448x448) and random crop (to 224x224) before
training.
- This resolution for training was the same as the PyTorch settings.
- Strategy
- Used DDP for all models except ViT-G14. ViT-G14 used the FSDP strategy.
- Batch size
- We use the max batch size as power of 2 without OOM for each model. The
[Benchmarking results][26] section shows the final
batch size for each experiment.
- Once a maximum batch-size for TPU V3 8 cores was determined, we just scaled
it linearly for 32 cores.
- Once a maximum batch-size for 1 A100 GPU was determined, we just scaled it
linearly for 8 A100 GPUs.
- Compilation
- [jax.jit() compilation][27] is used in JAX codes for efficient
execution in XLA.
- GPU related flags
- The following flags are set in the dockerfile for the GPU runs.
- Note: _xla_gpu_enable_pipelined_collectives_ is set to false for the
ViT-G14 FSDP run.
### Evaluation metric
For both the PyTorch and JAX experiments, the following evaluation metrics are
collected:
- Throughput: Images-per-second observed for training.
- Cost: The training-cost-per-epoch (USD).
**Note**: The above metrics are not biased against any framework or machine
configurations. In addition, these metrics will help one decide the most
efficient training configurations on Vertex AI.
## Benchmarking results
The lowest cost experiment for each model is marked in **bold** in the last
column.
![vit_benchmarking_table](images/vit_benchmarking_table.png)
The following bar charts summarize the performance visually:
![vit_training_time](images/vit_training_time.png)
![vit_training_cost](images/vit_training_cost.png)
The following section provides observations and conclusions for these results.
## Observation and Conclusions
- Training with JAX TPU V3 POD with 32 cores costs 33% less than the PyTorch GPU
8 A100-40GBs runs.
- Training with JAX GPU 8 A100-40GBs costs 23% less than the PyTorch GPU 8
A100-40GBs runs.
- JAX TPU V3 POD with 32 cores was 4x faster and slightly more cost-effective
than the JAX TPU V3 8 core run for the ViT-large model. This indicates that it
might be better to use more cores. The JAX TPU V3 speed scales very well with
the number of cores.
- Cloud TPU VM training speed numbers were the same as the Vertex AI for
TPU V3 8 cores. The dataset was copied to the docker in both the cases.
- The training-cost-per-epoch increases with the model size irrespective of the
framework.
[1]: https://github.com/huggingface/transformers/blob/main/examples/research_projects/jax-projects/README.md#quickstart-flax-and-jax-in-transformers
[2]: https://github.com/openlm-research/open_llama
[3]: https://github.com/google-research/vision_transformer
[4]: https://cloud.google.com/vertex-ai/pricing#custom-trained_models
[5]: https://arxiv.org/abs/2010.11929
[6]: #pytorch-gpu
[7]: #jax-tpu-and-gpu
[8]: https://cloud.google.com/vertex-ai/docs/training/overview
[9]: https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types
[10]: https://cloud.google.com/vertex-ai/docs/training/configure-compute#specifying_gpus
[11]: https://huggingface.co/google/vit-large-patch16-224-in21k
[12]: https://huggingface.co/google/vit-huge-patch14-224-in21k
[13]: https://github.com/huggingface/pytorch-image-models/blob/v0.9.2/timm/models/vision_transformer.py#L1308
[14]: https://github.com/huggingface/pytorch-image-models/blob/v0.9.2/timm/models/vision_transformer.py#L1312
[15]: https://huggingface.co/docs/transformers/main/model_doc/vit#transformers.ViTModel
[16]: https://github.com/huggingface/pytorch-image-models
[17]: https://huggingface.co/datasets/cifar10
[18]: https://lightning.ai/docs/pytorch/stable/
[19]: https://pytorch.org/docs/stable/notes/ddp.html
[20]: https://www.deepspeed.ai/tutorials/zero/
[21]: https://pytorch.org/tutorials/intermediate/torch_compile_tutorial.html
[22]: https://cloud.google.com/tpu/docs/system-architecture-tpu-vm#tpu_v3
[23]: https://github.com/google-research/big_vision
[24]: https://screenshot.googleplex.com/BximJgxsgvBVu38
[25]: https://www.tensorflow.org/datasets/catalog/cifar10
[26]: #benchmarking-results
[27]: https://jax.readthedocs.io/en/latest/jax-101/02-jitting.html
@@ -0,0 +1,227 @@
# Benchmark report on fine tuning the OpenLLaMA 7B model on Google Cloud Vertex Model Garden
Gary Wei, Software Engineer, Google Cloud
Dustin Luong, Software Engineer, Google Cloud
Changyu Zhu, Software Engineer, Google Cloud
Genquan Duan, Software Engineer, Google Cloud
## Introduction
Fine-tuning of LLMs can be non-trivial to find an optimal configuration of
machine types, training parameters, and other hyperparameters that achieves a
good balance between cost efficiency and model performance. To facilitate users
in conducting tuning experiments, this report benchmarks OpenLLaMA 7B
fine-tuning on Google Cloud Vertex Model Garden, demonstrating both efficiency
and effectiveness. The observations are general and can be applied to other LLM
models.
We benchmarked fine tuning algorithms [LoRA](https://arxiv.org/abs/2106.09685)
and [QLoRA](https://arxiv.org/abs/2305.14314) supported by
[huggingface PEFT libraries](https://github.com/huggingface/peft). LoRA, short
for Low-Rank Adaptation of Large Language Models, is an improved fine tuning
method where instead of fine tuning all the weights that constitute the weight
matrix of the pre-trained large language model, two smaller matrices that
approximate this larger matrix are fine-tuned. QLoRA is an even more
memory-efficient version of LoRA, where the pretrained model is loaded to GPU
memory as quantized 4-bit weights, while preserving similar effectiveness to
LoRA. We also provide simple scripts and parameter settings to reproduce the
results reported in this report.
In general, there are many factors that affect the performance of fine-tuning
experiments, such as hardware settings, parameters, cost, and accuracy. It is
impractical to obtain benchmarks for all possible combinations of these factors.
Instead, we focus on tuning a subset of related parameters and evaluating their
impact on a set of chosen metrics. The evaluation metrics are GPU memory usage,
percentage of parameters tuned, tuning speed, cost, and accuracy. The tuning
parameters are batch size, lora rank, maximum sequence length, and maximum
training steps.
## Key takeaways
- **Use QLoRA to minimize the peak GPU requirements**: The QLoRA can
significantly reduce the peak GPU memory usage by ~75% compared to LoRA. For
OpenLLaMA7b, the peak memory is ~28G for LoRA and ~7G for QLoRA.
- **Use LoRA to maximize the tuning speed and minimize the tuning cost**: LoRA
is ~66% faster than QLoRA in fine tuning speed. LoRA/QLoRA tuning cost is
low generally, while LoRA is even ~40% cheaper than QLoRA with the same
parameters. Suggest to use QLoRA for limited GPU memories, and LoRA for
limited training budgets. For OpenLLaMA7b, the tuning speed for LoRA/QLoRA
~5 samples / 3 samples per second, and the tuning cost for LoRA/QLoRA in 500
steps is ~$1/$1.7 on `a2-highgpu-1g` with 1 A100 40G GPU. The tuning cost
for QLoRA in 500 steps is $6.75 on n1-standard-8 with 1 V100 GPU, while LoRA
could not run because of OOM.
- **Use QLoRA to tune models with large sequence lengths**. For OpenLLaMA7b,
the max sequence length for QLoRA can be 2048 when consuming 16.3G GPU,
while the max sequence length for LoRA is 512 when consuming 28.2G GPU, and
encounter OOM when max sequence length is 1024.
- **Both LoRA and QLoRA give similar accuracy improvement after fine tuning.**
For OpenLLaMA7b, both LoRA/QLoRA can improve the average accuracy by ~4%
evaluating on 3 typical tasks (ARC challenge, HellaSwag and TruthfulQA),
after training 1875 steps on dataset
[timdettmers/openassistant-guanaco](https://huggingface.co/datasets/timdettmers/openassistant-guanaco).
- **Use a big batch size if GPU memory is not a constraint**. For OpenLLaMA7b
with other default parameters, we suggest using a batch size as 24 for
QLoRA, but 2 for LoRA when tuning with 1 A100 40G. We also suggest using a
batch size as 8 for QLoRA when tuning with 1 V100. Tuning with LoRA and
batch size as 1 got OOM and we don't recommend tuning LoRA with 1 V100.
## Benchmark Details
### Experiment Setup
The benchmark dataset is
[timdettmers/openassistant-guanaco](https://huggingface.co/datasets/timdettmers/openassistant-guanaco).
The training dataset is directly downloaded from hugging face to the VM, before
every experiment.
The default tuning parameters during benchmark are:
- Host VM: a2-highgpu-1g
- Accelerator type: 1 A100 40G
- batch size: 2
- lora_rank: 16
- max_seq_length: 512
- precision_mode: float16
- max_train_steps: 500
For simplicity, we set the precision mode to `float16` when tuning LoRA models,
and set the precision to `4bit` for QLoRA.
Sample script to start fine tuning dockers in a VM on GCP.
```shell
IMAGE_TAG=us-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-peft-train:latest
docker run --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=0 \
--rm --name "test_gpu" -it --pull=always ${IMAGE_TAG} \
--task=instruct-lora \
--pretrained_model_id=openlm-research/open_llama_7b \
--dataset_name="timdettmers/openassistant-guanaco" \
--instruct_column_in_dataset="text" \
--precision_mode="float16" \
--output_dir=<OUTPUT DIR> \
--lora_rank=2 \
--max_sequence_length=512 \
--learning_rate=2e-4 \
--max_steps=50
```
### GPU Memory
In this benchmark, we investigated the impact of batch size, lora rank, and
maximum sequence length on GPU memory, and then made recommendations on the
maximum batch size for different GPUs.
#### Peak GPU memory by batch size (GB)
<img src="images/openllama_7b_fine_tune_benchmark_report/openllama-7b-peak-gpu-vs-batch-size.png" width="600">
- The QLoRA can significantly reduce the peak GPU memory usage by ~75%
compared to LoRA. The peak GPU memory is ~28G for LoRA and ~7G for QLoRA
when batch size is 2.
- QLoRA can support much larger batch sizes than LoRA
- We can use a batch size as 32 for QLoRA, but only 2 for LoRA on 1 A100
40G.
- We can use a batch size of 8 for QLoRA on 1 V100 GPU. LoRA will fail
with OOM even with a batch size of 1.
#### Peak GPU memory by LoRA rank (GB)
<img src="images/openllama_7b_fine_tune_benchmark_report/openllama-7b-peak-gpu-vs-lora-rank.png" width="600">
- Peak GPU memories are quite similar for different LoRA ranks for both
LoRA/QLoRA.
- The peak GPU memory increasing percentages are very small generally when
LoRA rank increases.
- The peak GPU memory increases from 28G with LoRA rank 4 to 29.09G with
LoRA rank 64, and the increasing percentage is only ~3.9%.
#### Peak GPU memory by max sequence length for LoRA/QLoRA (GB)
<img src="images/openllama_7b_fine_tune_benchmark_report/openllama-7b-peak-gpu-vs-max-seq-length.png" width="600">
- The peak GPU increases quickly when max sequence length increases for both
LoRA/QLoRA, and the increasing rate of LoRA is much faster than QLoRA.
- For LoRA tuning, the GPU memory increased from 20.5G (max sequence
length=256) to 28.2G (max sequence length=512), an increase of ~37%.
- For QLoRA tuning, the GPU memory increased from 6.94G (max sequence
length=256) to 7.57G (max sequence length=512), an increase of ~9%.
- The max sequence length for QLoRA can be 2048 when consuming 16.3G GPU,
while the max sequence length for LoRA is 512 when consuming 28.2G GPU, and
encounter OOM when max sequence length is 1024.
### Fine Tuning Parameters
This section shows the number/percentage of trainable parameters, and the sizes
of the fine tuned models. LoRA and QLoRA differ only in how they represent the
precision of their parameters. The total number of parameters and the number of
trainable parameters are the same for both methods.
| LoRA Rank | Finetuned parameters | Total parameters | Trainable Parameter Percentage | Fine tuned model size (MB) |
| --------- | -------------------- | ---------------- | ------------------------------ | -------------------------- |
| 8 | 2.00E+07 | 6.76E+09 | 0.3% | 76.4 |
| 16 | 4.00E+07 | 6.78E+09 | 0.6% | 152.65 |
| 32 | 8.00E+07 | 6.82E+09 | 1.2% | 305.15 |
| 64 | 1.60E+08 | 6.90E+09 | 2.3% | 610.15 |
LoRA/QLoRA tunes quite a small fraction (only 0.3% with LoRA rank=8) of all
parameters, and the tuned models are very small (only 76.4MB with LoRA rank=8).
### Fine Tuning Speed And Costs
The fine-tuning speed and cost are affected by various factors, such as the
GPUs, LoRA ranks, and max sequence lengths.
- LoRA is ~66% faster than QLoRA in fine tuning speed. The tuning speed for
LoRA/QLoRA ~5 samples / 3 samples per second on 1 A100 40G GPU
- Higher LoRA ranks, slower tuning speed for both LoRA/QLoRA.
- LoRA tuning speed reduces from ~5 samples per second with LoRA rank as 8
to ~4 samples per second with LoRA rank as 64, slowed down by 20%.
- QLoRA tuning speed reduces from ~3 samples per second with LoRA rank as
8 to ~2.5 samples per second with LoRA rank as 64, slowed down by 17%.
<img src="images/openllama_7b_fine_tune_benchmark_report/openllama-7b-tune-speed-vs-lora-rank.png" width="600">
- Longer sequence lengths, slower tuning speed.
- LoRA tuning speed reduces from ~5.56 samples per second with max
sequence length as 256 to ~4.84 samples per second with max sequence
length as 512 slowed down by 13%.
- LoRA tuning speed reduces from ~2.95 samples per second with max
sequence length as 256 to ~2.88 samples per second with max sequence
length as 512 slowed down by ~2.4%.
<img src="images/openllama_7b_fine_tune_benchmark_report/openllama-7b-tune-speed-lora-qlora.png" width="600">
- LoRA/QLoRA tuning cost is low generally, while LoRA is even ~40% cheaper
than QLoRA with the same parameters.
- The LoRA/QLoRA fine tuning cost for 500 steps is ~$1/$1.7 on 1 A100 40G.
- The tuning cost for QLoRA in 500 steps is $6.75 on n1-standard-8 with 1
V100 GPU, while LoRA could not run because of OOM.
<img src="images/openllama_7b_fine_tune_benchmark_report/openllama-7b-tune-cost-lora-qlora.png" width="600">
### Accuracy
We fine tuned Open Llama 7B model with
[timdettmers/openassistant-guanaco](https://huggingface.co/datasets/timdettmers/openassistant-guanaco),
and report accuracy similar to the
[HuggingFace leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
using
[Eleuther AI Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness).
[HuggingFace leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
mainly compares models on ARC, HellaSwag, MMLU, and TruthfulQA. The authors did
not publish OpenLLaMA 7B on MMLU
([link](https://huggingface.co/openlm-research/open_llama_7b)). Therefore, we
only benchmark accuracies on ARC, HellaSwag, and TruthfulQA.
| | Mean | ARC | HellaSwag | TruthfulQA | Tuning Parameters |
| ------------------------------------------------------------ | ---- | ---- | --------- | ---------- | ------------------------------------------------------------ |
| OpenLLaMA7B ([Original Report](https://huggingface.co/openlm-research/open_llama_7b)) | 0.49 | 0.41 | 0.73 | 0.34 | n/a |
| OpenLLaMA7B ([Re-run with lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness)) | 0.51 | 0.47 | 0.72 | 0.35 | n/a |
| OpenLLaMA7B+LoRA | 0.56 | 0.48 | 0.74 | 0.45 | LoRA Rank=16; Max Sequence Length=512;Learning Rate=1e-4; Train steps=1875 |
| OpenLLaMA7B+QLoRA | 0.53 | 0.45 | 0.73 | 0.42 | LoRA Rank=16; Max Sequence Length=512; Learning Rate=1e-4; Train steps=1875 |
- The base OpenLLaMA7B model gets better performance (2%) when using the
[Eleuther AI Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness).
- LoRA/QLoRA can improve the performance by ~2-4% when trained for 1875 steps
with learning rate 1e-4.
@@ -0,0 +1,188 @@
# Benchmark report on hyperparameter tuning the OpenLLaMA models on Google Cloud Vertex Model Garden
Changyu Zhu, Software Engineer, Google Cloud
Dustin Luong, Software Engineer, Google Cloud
Gary Wei, Software Engineer, Google Cloud
Genquan Duan, Software Engineer, Google Cloud
## Introduction
Fine-tuning of LLMs can be non-trivial to find an optimal configuration of
machine types, training parameters, and other hyperparameters that achieves a
good balance between cost efficiency and model performance. To facilitate users
in conducting tuning experiments, this report benchmarks fine-tuning OpenLLaMA
models with [Vertex AI Hyperparameter Tuning Service](https://cloud.google.com/vertex-ai/docs/training/hyperparameter-tuning-overview), demonstrating both efficiency
and effectiveness. Similar hyperparameter tuning techniques can apply to other models as well.
## Key takeaways
- **The hyperparameter tuning service finds good parameters**: The best model found by the hyperparameter tuning service has an average improvement of around 4% in accuracy in *ARC*, *HellaSwag*, and *TruthfulQA* datasets, while only tuning the learning rate.
- **Hyperparameter tuning works with QLoRA on limited resources**: 4bit QLoRA is sufficient for hyperparameter tuning to find a set of good parameters. In this way, all OpenLLaMA models can run on 1 single `NVIDIA_L4` GPU. It is also possible to train for more steps on the good parameters discovered by hyperparameter tuning, avoiding the waste of computing resources on fine-tuning with suboptimal hyperparameters.
- **Hyperparameter tuning is cost-effective**: While `NVIDIA_L4` is slower than `NVIDIA_TESLA_V100`, it costs less and avoids the overhead of multi-GPU training since it has more GPU memory. Finding a good 3B/7B/13B OpenLLaMA model costs $28.5671, $47.8016, and $87.9208, respectively.
## Benchmarking setup
This section describes the experiment setup of the hyperparameter tuning experiments. The default tuning parameters are:
### Machine configuration
- Machine type: g2-standard-8
- Machine count: 1
- Accelerator type: NVIDIA_L4
- Accelerator count: 1
### Modeling
We benchmark all 3 OpenLLaMA models:
- [open_llama_3b](https://huggingface.co/openlm-research/open_llama_3b)
- [open_llama_7b](https://huggingface.co/openlm-research/open_llama_7b)
- [open_llama_13b](https://huggingface.co/openlm-research/open_llama_13b)
We use the Huggingface [PEFT](https://github.com/huggingface/peft) library for fine-tuning.
### Training dataset
We use the dataset [timdettmers/openassistant-guanaco](https://huggingface.co/datasets/timdettmers/openassistant-guanaco) loaded directly via Huggingface.
### Training parameters
The set of training parameters used during benchmarking:
- Batch size: 4
- Precision mode: 4bit QLoRA
- LoRA rank: 32
- LoRA alpha: 64
- Max sequence length: 512
- Max train steps: 1000
### Evaluation dataset
We use the [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness) library injected into the training loop for evaluation. The hyperparameter tuning job will pick the model according to the evaluation metrics.
- Eval task: [ARC Challenge](https://huggingface.co/datasets/ai2_arc)
- Eval metric: acc_norm
- Max eval examples: 10000
### Standalone evaluation dataset
After finding the best model with Vertex hyperparameter tuning service, we run standalone evaluations with the model on the following datasets:
- [ARC Challenge](https://huggingface.co/datasets/ai2_arc)
- [HellaSwag](https://huggingface.co/datasets/Rowan/hellaswag)
- [TruthfulQA](https://huggingface.co/datasets/EleutherAI/truthful_qa_mc)
### Hyperparameter tuning
We only tune the learning rate hyperparameter. It is considered a floating point value in the continuous range [1e-5, 1e-4]. We run 8 trials in total, with a parallelism of 1 or 2.
### Code example
The following code example launches an example hyperparameter tuning job of OpenLLaMA 7B model.
```py
from google.cloud import aiplatform
from google.cloud.aiplatform import hyperparameter_tuning as hpt
TRAIN_DOCKER_URI = 'us-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-peft-train:20231130_0936_RC00'
output_dir = "gs://path/to/output/dir"
base_model_id = "openlm-research/open_llama_7b"
dataset_name = "timdettmers/openassistant-guanaco"
hpt_precision_mode = "4bit"
machine_type = "g2-standard-8"
accelerator_type = "NVIDIA_L4"
accelerator_count = 1
eval_task = "arc_challenge"
eval_metric_name = "acc_norm"
max_steps = 1000
eval_limit = 10000
flags = {
"learning_rate": 1e-5,
"precision_mode": hpt_precision_mode,
"task": "instruct-lora",
"pretrained_model_id": base_model_id,
"output_dir": output_dir,
"warmup_steps": 10,
"max_steps": max_steps,
"lora_rank": 32,
"lora_alpha": 64,
"lora_dropout": 0.05,
"dataset_name": dataset_name,
"eval_steps": max_steps + 1, # Only evaluates at the end.
"eval_tasks": eval_task,
"eval_limit": eval_limit,
"eval_metric_name": eval_metric_name,
}
worker_pool_specs = [
{
"machine_spec": {
"machine_type": machine_type,
"accelerator_type": accelerator_type,
"accelerator_count": accelerator_count,
},
"replica_count": 1,
"container_spec": {
"image_uri": TRAIN_DOCKER_URI,
"args": ["--{}={}".format(k, v) for k, v in flags.items()],
},
}
]
metric_spec = {"model_performance": "maximize"}
parameter_spec = {
"learning_rate": hpt.DoubleParameterSpec(
min=1e-5, max=1e-4, scale="linear"
),
}
train_job = aiplatform.CustomJob(
display_name=job_name,
worker_pool_specs=worker_pool_specs,
staging_bucket=STAGING_BUCKET,
)
train_hpt_job = aiplatform.HyperparameterTuningJob(
display_name=f"{job_name}_hpt",
custom_job=train_job,
metric_spec=metric_spec,
parameter_spec=parameter_spec,
max_trial_count=8,
parallel_trial_count=2,
)
train_hpt_job.run()
```
## Benchmark results
### Fine-tuning cost
The fine-tuning cost is calculated from `us-central1` pricing and may be subject to changes.
| Model | Train time | Trials | Parallel Trials | Hourly cost | Cost | Eval acc_norm (ARC-Challenge) |
|---------------|------------|--------|-----------------|-------------|----------|-------------------------------|
| OpenLLaMA 3B | 16 hrs | 8 | 2 | $1.7072 | $28.5671 | 39.9% |
| OpenLLaMA 7B | 28 hrs | 8 | 2 | $1.7072 | $47.8016 | 45.8% |
| OpenLLaMA 13B | 103 hrs | 8 | 1 | $0.8536 | $87.9208 | 47.6% |
### Fine-tuning performance
Here are the evaluation results of the best model found by hyperparameter tuning, compared with the baseline model. The column `Eval acc_norm` is calculated during training, which is always lower than that during standalone evaluation, because the model is loaded and evaluated at a lower precision (4bit during training / float16 during standalone evaluation).
| Model | Eval acc_norm (ARC-Challenge) | ARC | hellaswag | Truthfulqa_mc | ∆ARC | ∆Hellaswag | ∆Truthfulqa_mc | ∆Average |
|---------------|-------------------------------|--------|-----------|---------------|--------|------------|----------------|----------|
| OpenLLaMA 3B | 39.9% | 41.47% | 69.97% | 38.31% | +1.62% | +7.32% | +3.34% | +4.09% |
| OpenLLaMA 7B | 45.8% | 49.83% | 75.53% | 41.53% | +2.82% | +3.55% | +6.68% | +4.35% |
| OpenLLaMA 13B | 47.6% | 52.20% | 78.90% | 44.27% | +1.01% | +3.67% | +6.19% | +3.62% |
## Related documents
1. [Benchmark report on fine tuning the OpenLLaMA 7B model on Google Cloud Vertex Model Garden
](
https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/community-content/vertex_model_garden/benchmarking_reports/pytorch_openllama_7b_finetune_benchmark_report.md)
@@ -0,0 +1,218 @@
# Benchmark Stable Diffusion v1-5 Fine Tuning and Serving With Google Cloud Vertex Model Garden
Dustin Luong, Software Engineer, Google Cloud
Gary Wei, Software Engineer, Google Cloud
Changyu Zhu, Software Engineer, Google Cloud
Genquan Duan, Software Engineer, Google Cloud
## Introduction
[The public notebook][1] shows the full examples of fine tuning and serving of Stable diffusion v1-5. [The github repo][2] contains examples of building training and serving dockers for Google Cloud Vertex Model Garden. This report benchmarks Stable diffusion v1-5 fine tuning and serving in Google Cloud Vertex AI, showing both efficiencies and effectiveness.
### Benchmark Highlights
- Fine tuning
- Stable diffusion v1-5 with LoRA and Gradient checkpointing only requires ~10G GPU memory. Larger batch sizes, or larger resolutions require more GPU memories, but not does not change much for different LoRA ranks.
- The fine tuning speed is fast in ~11 minutes for 1k steps, and costs less than $1 in 1 A100. The fine tuning speed increases with batch sizes, decreases with resolution, but is not affected much by LoRA ranks.
- LoRA tunes a few percent (only 0.1% with LoRA rank=8) of all parameters, and the tuned models are very small (only 3.1MB with LoRA rank=8).
- Dreambooth+LoRA and Dreambooth can achieve similar performances, but Dreambooth LoRA can require much less GPU.
- Increasing batch size, reducing training steps, and increasing learning rate can result in models with the same performance for less cost.
- Inference
- The optimized serving docker pytorch-peft-serve can speed up inference by 2x than current pytorch-diffuser-serve, and support both base models and fine tuned lora models.
- The optimized serving docker pytorch-peft-serve can generate 4 512*512 images in 4.1 seconds on 1 V100 and 1.7 seconds on 1 A100.
Benchmark details are below.
## Fine Tuning Benchmarks
### Experiment Setup
We mainly compare two tuning algorithms:
- parameter efficient finetuning based on [dreambooth][3] and [LoRA][4] (shorten as Dreambooth+LoRA below)
- full parameter fine tuning based on [dreambooth][3] (shorten as Dreambooth below)
And then report benchmark results on GPU memories, tuning parameters, tuning speeds, costs and accuracy, using the public oxford flowers dataset: [train][5] and [test][6], where the column blip_caption as texts, and column image as images. We also benchmark subject and prompt fidelity using the [dataset][7] from the Dreambooth paper.
The default tuning parameters during benchmark are:
- Hardware: 1 A100 40G
- batch size: 4
- lora_rank: 8
- resolution: 512
- max_train_steps: 10
- use_lora: False
- gradient_checkpointing: False
```
# Examples to start finetuning dockers.
MODEL_NAME="runwayml/stable-diffusion-v1-5"
OUTPUT_DIR=<OUTPUT_DIR>
INSTANCE_DATA_DIR=<INSTANCE_DATA_DIR>
INSTANCE_PROMPT=<INSTANCE_PROMPT>
IMAGE="us-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-peft-train"
docker run \
--runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=0 \
--rm --name "test_gpu" \
-it ${IMAGE} \
--task=text-to-image-dreambooth-lora-peft \
--pretrained_model_name_or_path=$MODEL_NAME \
--resolution=512 \
--instance_data_dir=$INSTANCE_DATA_DIR \
--instance_prompt=$INSTANCE_PROMPT \
--train_batch_size=4 \
--max_train_steps=10 \
--output_dir=${OUTPUT_DIR} \
--use_lora \
--lora_r=8 \
--gradient_checkpointing
```
### GPU Memories
Many various factors will impact GPU memory usages. In this benchmark, we mainly benchmark with different finetuning algorithms, batch sizes, lora rank, resolution, and then recommended max batch size on different GPUs.
![sd_v1-5_peak_gpu_algorithm](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_peak_gpu_algorithm.png)
![sd_v1-5_peak_gpu_batch_size](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_peak_gpu_batch_size.png)
![sd_v1-5_peak_gpu_lora_rank](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_peak_gpu_lora_rank.png)
![sd_v1-5_peak_gpu_resolution](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_peak_gpu_resolution.png)
- LoRA tuning reduced about 47% peak RAM and 42% peak VRAM for GPU memory, compared to full parameter fine tuning.
- Gradient checkpointing decreases about 1% peak RAM and 31% peak VRAM for GPU memory further, compared without gradient checkpointing.
- The GPU memory does not change much for different LoRA ranks.
- Larger batch sizes require more GPU memories.
- Larger resolutions require more GPU memories.
- Dreambooth+LoRA+Gradient_Checkpointing can support max batch size as 32, or max resolution as 2048, but Dreambooth can only support max batch size as 8, or max resolution as 1024.
### Fine Tuning Parameters
This section shows the percentage of trainable parameters, and tuned model sizes.
- LoRA tunes quite a few percent (only 0.1% with LoRA rank=8) of all parameters, and the tuned models are very small (only 3.1MB with LoRA rank=8).
| LoRA Rank | Trainable parameters | Total parameters | Trainable Parameter Percentage | Fine tuned model size (MB) |
|---|---|---|---|---|
| 4 | 398592 | 859919556 | 0.05% | 1.57 |
|8 | 797184 | 860318148 | 0.09% | 3.09 |
| 16 | 1594368| 861115332| 0.19%| 6.13|
| 32| 3188736| 862709700| 0.37%| 12.21|
### Fine Tuning Speed And Costs
Fine tuning speeds and costs are affected by many different factors, such as batch size, tuning parameters, image resolutions, GPUs, and datasets. In order to make the report easy to understand, we set the following values in this section:
- Hardware: 1 A100 40G
- use_lora: True
- gradient_checkpointing: True
![sd_v1-5_training_speed_batch_size](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_training_speed_batch_size.png)
![sd_v1-5_training_speed_lora_rank](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_training_speed_lora_rank.png)
![sd_v1-5_training_speed_resolution](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_training_speed_resolution.png)
![sd_v1-5_training_cost_max_steps](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_training_cost_max_steps.png)
- The fine tuning speed increases with batch sizes, decreases with resolution, but is not affected much by LoRA ranks.
- The fine tuning speed is about 11 minutes for 1k steps, and costs less than $1 in 1 A100.
### Fine Tuning Quality
In this benchmark, we mainly benchmark Dreambooth and Dreambooth+LoRA to compare fine tuning quality. We compare [subject fidelity scored (DINO)][8], how well the subject is represented in the generated images, and [prompt fidelity scores (CoCa)][9], how well the generated images match the given prompt, for a single subject, a [dog][10] from the dataset released with the original Dreambooth paper. In practice, we recommend saving checkpoints periodically and inspecting validation prompts visually. We fine tuned the unet without fine tuning the text encoder and used the following hyperparameters:
Dreambooth
- Learning rate: 5e-6
- Batch size: 1
Dreambooth+LoRA
- Learning rate: 1e-4
- Batch size: 1
![sd_v1-5_finetuning_quality_subject_fidelity](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_finetuning_quality_subject_fidelity.png)
![sd_v1-5_finetuning_quality_prompt_fidelity](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_finetuning_quality_prompt_fidelity.png)
- Fine tuning with Dreambooth or Dreambooth+LoRA can result in models with comparable performance. The base model produced images of the class rather than the instance.
- Dreambooth+LoRA is able to achieve the same subject fidelity score as Dreambooth if trained for more epochs.
- Increasing the number of training steps results in better subject fidelity but at the cost of prompt fidelity.
### Suggested Max Batch Sizes By Resolutions
We benchmarked and suggested max batch sizes by resolutions on 1 A100 and 1 V100 as below. This is with LoRA and gradient checkpointing enabled.
![sd_v1-5_batch_size_by_resolution](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_batch_size_by_resolution.png)
### Fine Tuning Cost Optimization
Increasing batch size allows for more images to be considered at each training step for fine tuning. This allows models to be trained in fewer training steps. In this benchmark, we aim to show how batch size can be increased to reduce training costs while still preserving subject and prompt fidelity.
Since the training dataset consists of 5 images, we train with a batch size of 5 and reduce the number of training steps from 400 to 80. Doing so results in a model that has not learned the subject since we’ve decreased the number of training steps. Conceptually, the model is taking a more precise step at each iteration, but it is taking fewer steps. To compensate for this, we increased the learning rate from 5e-6 and observed the best results at 1e-5 for full parameter finetuning.
![sd_v1-5_subject_fidelity_batch_size_5_learning_rate](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_subject_fidelity_batch_size_5_learning_rate.png)
![sd_v1-5_prompt_fidelity_batch_size_5_learning_rate](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_prompt_fidelity_batch_size_5_learning_rate.png)
Comparing cost of training the “best” model for batch size 1 vs. batch size 5
![sd_v1-5_cost_batch_size](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_cost_batch_size.png)
| Train method| Training parameters| Sample image| CoCa (prompt fidelity)| DINO (subject fidelity) | Cost of training on A100 |
|---|---|---|---|---|---|
| dreambooth| dreambooth, num_train_steps=400, batch_size=1, lr=5e-6| ![dog1](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_dog1.png) | 0.12215| 0.76531| $0.26 |
| dreambooth | dreambooth, num_train_steps=80, batch_size=5,lr=1e-5| ![dog2](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_dog2.png)| 0.12644| 0.74697 | $0.15 |
| dreambooth-lora| num_train_steps=500, batch_size=1, lr=1e-4, gc|![dog3](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_dog3.png)| 0.12856| 0.78148 | $0.26|
| dreambooth-lora | num_train_steps=50, batch_size=5, lr=1e-3, gc | ![dog4](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_dog4.png) | 0.12566 | 0.75479 | $0.09 |
A followup question is that since finetuning can be run on a single GPU, should finetuning be run on 1 V100 or A100?
Setup:
- num_train_steps=800 / batch_size
- Resolution=512
![sd_v1-5_cost_training_method_batch_size](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_cost_training_method_batch_size.png)
- Although V100 has a lower $/hr cost than an A100, the same training setup takes longer. Even given the longer training time, the cost on V100 is still lower.
- Dreambooth+LoRA enables training with larger batch sizes, however, larger batch sizes will not necessarily mean faster training time.
- It is possible to fine tune with 1 V100 on 512 resolution with Dreambooth+LoRA.
- Dreambooth fine tuning must be run on 1 A100 at 512 resolution.
## Inference Benchmarks
We provide two serving dockers in vertex model garden for stable diffusion:
- pytorch-diffuser-serve:
- us-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-diffusers-serve
- This serving docker only serves base stable diffusion models and does not contain any optimizations yet.
- pytorch-peft-serve:
- us-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-peft-serve
- This serving docker can serve base stable diffusion models, and base stable diffusion models with fine tuned lora models, and contains optimization for serving.
We run the two serving dockers on T4/V100/A100 to generate 4 512*512 images, and compare the inference speed without network considerations as:
![sd_v1-5_inference_speed_gpu](images/stable_diffusion_v1-5_benchmarking_report/sd_v1-5_inference_speed_gpu.png)
The speed up of optimized pytorch-peft-serve is about 2x than current pytorch-diffuser-serve.
### Serving cost comparison
Pytorch-diffuser-serve (without any optimizations)
| GPU type| Time required to generate 4 512x512 images | Machine unit price ($ / hour) | Cost per image ($) |
|---|---|---|---|
| T4 | 28.6 | 0.4025| 0.00080 |
| V100 | 8.8 | 2.852| 0.00174|
| A100 | 4.2 | 4.2245 | 0.00123 |
Pytorch-peft-serve (with optimizations)
| GPU type | Time required to generate 4 512x512 images | Machine unit price ($ / hour) | Cost per image ($) |
|--- |---|---|---|
| T4 | 12.6 | 0.4025 | 0.00035 |
| V100 | 4.1 | 2.852 | 0.00081 |
| A100 | 1.7 | 4.2245 | 0.00050 |
- The optimized pytorch-peft-serve has approximately half the price per image, compared with the un-optimized pytorch-diffuser-serve.
- Serving the model with a T4 is most cost effective, however, serving with an A100 still has the best throughput and fastest predictions.
[1]: https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/community/model_garden/model_garden_pytorch_stable_diffusion.ipynb
[2]: https://github.com/GoogleCloudPlatform/vertex-ai-samples/tree/main/community-content/vertex_model_garden/model_oss
[3]: https://arxiv.org/abs/2208.12242
[4]: https://arxiv.org/abs/2106.09685
[5]: https://huggingface.co/datasets/Multimodal-Fatima/OxfordFlowers_train
[6]: https://huggingface.co/datasets/Multimodal-Fatima/OxfordFlowers_test_facebook_opt_6.7b_Attributes_ns_6149
[7]: https://github.com/google/dreambooth
[8]: https://arxiv.org/abs/2104.14294
[9]: https://arxiv.org/abs/2205.01917
[10]: https://github.com/google/dreambooth/tree/main/dataset/dog6
@@ -0,0 +1,50 @@
# Dockerfile for serving dockers with AutoGluon.
#
# To build:
# docker build -f model_oss/autogluon/dockerfile/serve.Dockerfile . -t ${YOUR_IMAGE_TAG}
#
# To push to gcr:
# docker tag ${YOUR_IMAGE_TAG} gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
# docker push gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
FROM pytorch/pytorch:2.1.2-cuda11.8-cudnn8-runtime
USER root
# AutoGluon might require libgomp for some dependencies.
RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \
curl \
wget \
vim \
libgomp1
# Install AutoGluon and other dependencies.
RUN pip install --upgrade pip
RUN pip install autogluon==1.0.0
RUN pip install flask==3.0.0
# Dependencies needed to work with GCS.
RUN pip install absl-py==2.0.0
RUN pip install google-cloud-storage==2.7.0
# Copy scripts into the container.
COPY model_oss/autogluon /autogluon
COPY model_oss/util /autogluon/util
WORKDIR /autogluon
# Copy license.
RUN wget https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/LICENSE
RUN wget https://github.com/pallets/flask/blob/main/LICENSE.rst
# Expose the port the app runs on.
EXPOSE 8501
# Set the working directory to a specific path for consistency.
WORKDIR /autogluon
# Change to a non-root user for security purposes.
RUN useradd -m autogluonuser
USER autogluonuser
# Run Flask application.
CMD ["python", "serve.py"]
@@ -0,0 +1,36 @@
# Dockerfile for training dockers with Autogluon.
#
# To build:
# docker build -f model_oss/autogluon/dockerfile/train.Dockerfile . -t ${YOUR_IMAGE_TAG}
#
# To push to gcr:
# docker tag ${YOUR_IMAGE_TAG} gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
# docker push gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
FROM pytorch/pytorch:2.1.2-cuda11.8-cudnn8-runtime
# Install tools.
ENV DEBIAN_FRONTEND=noninteractive
ENV PIP_ROOT_USER_ACTION=ignore
RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \
apt-utils \
curl \
wget \
git \
jq \
gnupg \
build-essential \
tesseract-ocr \
vim
# Install libraries.
RUN pip install autogluon==1.0.0
COPY model_oss/autogluon /autogluon
WORKDIR /autogluon
# Copy license.
RUN wget https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/LICENSE
ENTRYPOINT ["python", "train.py"]
@@ -0,0 +1,87 @@
r"""AutoGluon serving binary.
This module sets up a Flask web server for serving predictions from a
trained AutoGluon model. The server exposes two endpoints:
1. `/ping`: A health check endpoint that returns "pong" to
indicate that the server is running.
2. `/predict`: An endpoint that accepts POST requests with JSON content.
Each request should contain one or more instances for which the
predictions are desired. The endpoint returns the predictions and
associated probabilities in a JSON response.
The server expects an environment variable `model_path` that points to
the directory where the AutoGluon model artifacts are
stored. If `model_path` is not provided, it defaults to '/autogluon/models'.
"""
import json
import logging
import os
from autogluon.tabular import TabularPredictor
import flask
import pandas as pd
from util import constants
from util import fileutils
_SUCCESS_STATUS = 200
_ERROR_STATUS = 500
_PORT = 8501
app = flask.Flask(__name__)
# Check the environment variables.
model_dir = os.getenv('model_path', '/autogluon/models')
logging.info('Model directory passed by the user is: %s', model_dir)
# If the model is on GCS then copy it to a local folder first.
if model_dir.startswith(constants.GCS_URI_PREFIX):
gcs_path = model_dir[len(constants.GCS_URI_PREFIX) :]
local_model_dir = os.path.join(constants.LOCAL_MODEL_DIR, gcs_path)
logging.info('Download %s to %s', model_dir, local_model_dir)
fileutils.download_gcs_dir_to_local(model_dir, local_model_dir)
model_dir = local_model_dir
logging.info('Local model directory is: %s', model_dir)
# Load the predictor at startup.
predictor = TabularPredictor.load(model_dir)
@app.route('/ping', methods=['GET'])
def ping() -> flask.Response:
"""Health check route."""
return flask.Response('pong', status=_SUCCESS_STATUS)
@app.route('/predict', methods=['POST'])
def predict() -> flask.Response:
"""Prediction route."""
try:
# Extract JSON content from the POST request.
data = flask.request.get_json(force=True)
instances = data.get('instances', [])
# Convert instances to DataFrame.
df_to_predict = pd.DataFrame(instances)
# Perform prediction.
predictions = predictor.predict(df_to_predict).tolist()
response = {'predictions': predictions}
return flask.Response(
json.dumps(response),
status=_SUCCESS_STATUS,
mimetype='application/json',
)
except Exception as e: # pylint: disable=broad-exception-caught
return flask.Response(
json.dumps({'error': str(e)}),
status=_ERROR_STATUS,
mimetype='application/json',
)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=_PORT)
@@ -0,0 +1,144 @@
"""AutoGluon training binary. """
import argparse
import json
from typing import Any
from autogluon.tabular import TabularPredictor
import pandas as pd
class BaseConfig:
def to_dict(self) -> dict[str, Any]:
return {
key: value for key, value in self.__dict__.items() if value is not None
}
class DataConfig(BaseConfig):
def __init__(self, train_data_path: Any) -> None:
self.train_data_path = train_data_path
class ProblemConfig(BaseConfig):
def __init__(self, label: Any, problem_type: Any) -> None:
self.label = label
self.problem_type = problem_type
class EvaluationConfig(BaseConfig):
def __init__(self, eval_metric: Any) -> None:
self.eval_metric = eval_metric
class TrainingConfig(BaseConfig):
"""Config for training."""
def __init__(
self,
time_limit: Any,
presets: Any,
hyperparameters: Any,
model_save_path: str,
) -> None:
self.time_limit = time_limit
self.hyperparameters = hyperparameters
self.presets = presets
self.model_save_path = model_save_path
def parse_args() -> (
tuple[DataConfig, ProblemConfig, EvaluationConfig, TrainingConfig]
):
"""Parse command line arguments."""
parser = argparse.ArgumentParser(description="AutoGluon Tabular Predictor")
# Add arguments for each config class
parser.add_argument(
"--train_data_path",
type=str,
required=True,
help="Path to the input data CSV file.",
)
parser.add_argument(
"--label", type=str, required=True, help="Target variable column name."
)
parser.add_argument(
"--problem_type",
type=str,
choices=["binary", "multiclass", "regression", "quantile"],
default=None,
help="Problem type.",
)
parser.add_argument(
"--eval_metric", type=str, default=None, help="Evaluation metric to use."
)
# Add arguments for TrainingConfig if needed
parser.add_argument(
"--time_limit",
type=int,
default=None,
help="Time limit in seconds for training.",
)
parser.add_argument(
"--presets",
type=str,
default="medium_quality",
help="Presets used for training ",
)
parser.add_argument(
"--hyperparameters",
type=json.loads,
default=None,
help="Hyperparameter dictionary in JSON format.",
)
parser.add_argument(
"--model_save_path",
type=str,
default=None,
help="Path to save the trained model.",
)
args = parser.parse_args()
data_config = DataConfig(train_data_path=args.train_data_path)
problem_config = ProblemConfig(
label=args.label, problem_type=args.problem_type
)
eval_config = EvaluationConfig(eval_metric=args.eval_metric)
training_config = TrainingConfig(
time_limit=args.time_limit,
presets=args.presets,
hyperparameters=args.hyperparameters,
model_save_path=args.model_save_path,
)
return data_config, problem_config, eval_config, training_config
def main() -> None:
data_config, problem_config, eval_config, training_config = parse_args()
# Load the training data.
data = pd.read_csv(data_config.train_data_path)
# Create a TabularPredictor.
predictor = TabularPredictor(
label=problem_config.label,
eval_metric=eval_config.eval_metric,
path=training_config.model_save_path,
)
# Fit the model
predictor.fit(
data,
presets=training_config.presets,
time_limit=training_config.time_limit,
hyperparameters=training_config.hyperparameters,
)
if __name__ == "__main__":
main()
@@ -0,0 +1,25 @@
# The provided content is a configuration file for the ZipNeRF
# PyTorch implementation.
# Sets the name of the experiment to 'test'.
Config.exp_name = 'test'
# Specifies the dataset loader, in this case, 'llff' for light field.
Config.dataset_loader = 'llff'
# Defines the near and far clipping planes for the camera view.
Config.near = 0.2
Config.far = 1e6
# Image downsampling.
Config.factor = 4
# For the model configurations.
Model.raydist_fn = 'power_transformation'
Model.opaque_background = True
# Disables the computation of density normals and RGB values, and sets
# the grid level dimension to 1 for PropMLP.
PropMLP.disable_density_normals = True
PropMLP.disable_rgb = True
PropMLP.grid_level_dim = 1
# Disable density normals for NerfMLP
NerfMLP.disable_density_normals = True
@@ -0,0 +1,21 @@
# The provided content is a configuration file for Generative
# Latent Optimization (GLO) vectors in the Pytorch implemnetation of ZipNeRF.
# Specifies the dataset loader, in this case, 'llff' for light field.
Config.dataset_loader = 'llff'
# Defines the near and far clipping planes for the camera view.
Config.near = 0.2
Config.far = 1e6
# Image downsampling.
Config.factor = 4
# For the model configurations.
Model.raydist_fn = 'power_transformation'
Model.num_glo_features = 128
Model.opaque_background = True
PropMLP.disable_density_normals = True
PropMLP.disable_rgb = True
PropMLP.grid_level_dim = 1
NerfMLP.disable_density_normals = True
@@ -0,0 +1,18 @@
# The provided content is a configuration file running ZipNeRF
# training on 8 gpu machine.
compute_environment: LOCAL_MACHINE
debug: false
distributed_type: MULTI_GPU
downcast_bf16: 'no'
gpu_ids: all
machine_rank: 0
main_training_function: main
mixed_precision: fp16
num_machines: 1
num_processes: 8
rdzv_backend: static
same_network: true
tpu_env: []
tpu_use_cluster: false
tpu_use_sudo: false
use_cpu: false
@@ -0,0 +1,120 @@
# Dockerfile for ZipNeRF base image.
#
# To build:
# docker build -f model_oss/cloudnerf/dockerfile/pytorch_cloudnerf_base.Dockerfile . -t ${YOUR_IMAGE_TAG}
#
# To push to gcr:
# docker tag ${YOUR_IMAGE_TAG} gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
# docker push gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-devel
USER root
ARG COLMAP_GIT_COMMIT=main
ARG CUDA_ARCHITECTURES=60;70;75;80;86
# Prevent stop building ubuntu at time zone selection.
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y --allow-releaseinfo-change && apt-get -y upgrade && apt-get install -y --no-install-recommends \
curl \
g++ \
wget \
vim \
bash \
cmake \
imagemagick \
ninja-build \
build-essential \
libboost-program-options-dev \
libboost-filesystem-dev \
libboost-graph-dev \
libboost-system-dev \
libeigen3-dev \
libflann-dev \
libfreeimage-dev \
libmetis-dev \
libgoogle-glog-dev \
libgtest-dev \
libsqlite3-dev \
libglew-dev \
qtbase5-dev \
libqt5opengl5-dev \
libcgal-dev \
libceres-dev \
git \
git-lfs \
python3-cffi \
python3-cryptography \
libffi-dev \
python-dev
# Copy license.
RUN wget https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/LICENSE
# Install google cloud CLI.
RUN wget -q https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-430.0.0-linux-x86.tar.gz
RUN tar xzf google-cloud-cli-430.0.0-linux-x86.tar.gz
RUN ./google-cloud-sdk/install.sh -q
# Make sure gsutil will use the default service account.
RUN echo '[GoogleCompute]\nservice_account = default' > /etc/boto.cfg
# Install deps and install gsutil.
RUN pip install gsutil==5.27
# When building colmap in colab, the link error "undefined reference.
# to '_glapi_tls_Current'" happens. A solution is to install "libglvnd"
# as described in this page https://github.com/colmap/colmap/issues/1271.
RUN git clone --depth 1 --branch v1.7.0 https://github.com/NVIDIA/libglvnd && \
apt-get install -y libxext-dev libx11-dev x11proto-gl-dev && \
cd libglvnd/ && \
apt-get install -y autoconf automake libtool && \
apt-get install -y libffi-dev && \
./autogen.sh && \
./configure && \
make -j4 && \
make install
RUN apt remove nvidia-cuda-toolkit -y \
nvidia-cuda-toolkit \
nvidia-cuda-toolkit-gcc
# Install libraries.
ENV PIP_ROOT_USER_ACTION=ignore
RUN python3 -m pip install --upgrade pip
ENV CUDA_HOME=/usr/local/cuda
RUN git clone --branch main https://github.com/SuLvXiangXin/zipnerf-pytorch.git
# Set current directory to the downloaded 'zipnerf-pytorch' repository.
WORKDIR ./zipnerf-pytorch
# Using git reset command to pin it down to a specific version.
RUN git reset --hard 4de3d21ebb9e15412d36951b56e2d713fddd812b
COPY model_oss/cloudnerf/requirements.txt requirements.txt
RUN pip install -r requirements.txt
# Install gridencoder extensions and nvdiffrast (for textured mesh).
RUN cd .. && \
TORCH_CUDA_ARCH_LIST="6.0 7.0 7.5 8.0 8.6+PTX" CXX=g++ pip install ./zipnerf-pytorch/gridencoder
# Install cuda version of torch_scatter.
RUN pip install torch-scatter==2.1.2 -f https://data.pyg.org/whl/torch-2.0.1+cu118.html
RUN pip install google-cloud-aiplatform==1.25.0
RUN pip install google-cloud-storage==2.9.0
# Build and install COLMAP.
RUN git clone --depth 1 --branch 3.8 https://github.com/colmap/colmap.git
RUN cd colmap && \
git fetch https://github.com/colmap/colmap.git ${COLMAP_GIT_COMMIT} && \
mkdir build && \
cd build && \
cmake .. -GNinja -DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCHITECTURES} && \
ninja && \
ninja install && \
cd .. && rm -rf colmap
RUN git clone --depth 1 --branch v1.0.2 https://github.com/dranjan/python-plyfile.git
RUN sed -i "20 i\sys.path.append('/workspace/zipnerf-pytorch/internal/pycolmap')" /workspace/zipnerf-pytorch/internal/datasets.py
RUN sed -i "21 i\sys.path.append('/workspace/zipnerf-pytorch/internal/pycolmap/pycolmap')" /workspace/zipnerf-pytorch/internal/datasets.py
@@ -0,0 +1,16 @@
# Dockerfile for ZipNeRF COLMAP image calibration.
#
# To build:
# docker build -f model_oss/cloudnerf/dockerfile/cloudnerf_pytorch_calibrate.Dockerfile . -t ${YOUR_IMAGE_TAG}
#
# To push to gcr:
# docker tag ${YOUR_IMAGE_TAG} gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
# docker push gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
FROM us-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-cloudnerf-base:20231206_0923_RC00
COPY model_oss/cloudnerf/local_colmap_and_resize.sh /workspace/zipnerf-pytorch/scripts/local_colmap_and_resize.sh
WORKDIR /workspace/zipnerf-pytorch/
ENTRYPOINT ["bash","scripts/local_colmap_and_resize.sh"]
@@ -0,0 +1,22 @@
# Dockerfile for ZipNeRF rendering.
#
# To build:
# docker build -f model_oss/cloudnerf/dockerfile/pytorch_cloudnerf_render.Dockerfile . -t ${YOUR_IMAGE_TAG}
#
# To push to gcr:
# docker tag ${YOUR_IMAGE_TAG} gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
# docker push gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
FROM us-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-cloudnerf-base:20231206_0923_RC00
COPY model_oss/cloudnerf/render.sh /workspace/zipnerf-pytorch/scripts/render.sh
COPY model_oss/cloudnerf/configs/360.gin /workspace/zipnerf-pytorch/configs/360.gin
COPY model_oss/cloudnerf/configs/360_glo.gin /workspace/zipnerf-pytorch/configs/360_glo.gin
COPY model_oss/cloudnerf/configs/accelerate_config.yaml /root/.cache/huggingface/accelerate/default_config.yaml
RUN sed -i '324s/.*/ keyframe_names = fp.read().splitlines()/' /workspace/zipnerf-pytorch/internal/camera_utils.py
ENV PYTHONPATH "${PYTHONPATH}:/workspace/zipnerf-pytorch/util"
WORKDIR /workspace/zipnerf-pytorch/
ENTRYPOINT ["bash", "scripts/render.sh"]
@@ -0,0 +1,21 @@
# Dockerfile for ZipNeRF training.
#
# To build:
# docker build -f model_oss/cloudnerf/dockerfile/pytorch_cloudnerf_train.Dockerfile . -t ${YOUR_IMAGE_TAG}
#
# To push to gcr:
# docker tag ${YOUR_IMAGE_TAG} gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
# docker push gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
FROM us-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-cloudnerf-base:20231206_0923_RC00
COPY model_oss/cloudnerf/train.sh /workspace/zipnerf-pytorch/scripts/train.sh
COPY model_oss/cloudnerf/configs/360.gin /workspace/zipnerf-pytorch/configs/360.gin
COPY model_oss/cloudnerf/configs/360_glo.gin /workspace/zipnerf-pytorch/configs/360_glo.gin
COPY model_oss/cloudnerf/configs/accelerate_config.yaml /root/.cache/huggingface/accelerate/default_config.yaml
ENV PYTHONPATH "${PYTHONPATH}:/workspace/zipnerf-pytorch/util"
WORKDIR /workspace/zipnerf-pytorch/
ENTRYPOINT ["bash", "scripts/train.sh"]
@@ -0,0 +1,144 @@
#!/bin/bash
# This script runs colmap for scale invariant feature (SIFT) extraction and
# matching to map camera extrinsics and intrinsics values for ZipNeRF,
# given a folder of images and videos
# from a GCS bucket. It uses ffmepg to extract an image from a video at
# 1fps. The folder can contain images or videos. If both images and videos
# are present, the extracted frames from the videos is added to the images
# to create the final combined image dataset.
# vv-docker:google3-begin(internal)
# TODO(b/314042136): Specify cloudnerf colmap fps.
# vv-docker:google3-end
# Initialize variables.
use_gpu=1 # Default to 1 (assuming the docker is run on a machine with GPU)
gcs_dataset_path=""
gcs_experiment_path=""
camera=""
# This loop processes command-line arguments for configuring the container.
# It supports arguments for GPU usage, dataset and experiment paths,
# and camera type.
while [[ $# -gt 0 ]]; do
case $1 in
-use_gpu)
use_gpu="$2"
if ! [[ $use_gpu =~ ^[0-9]+$ ]]; then
echo "Error: -use_gpu must be an integer."
exit 1
fi
shift # past argument
shift # past value
;;
-gcs_dataset_path)
gcs_dataset_path="$2"
shift # past argument
shift # past value
;;
-gcs_experiment_path)
gcs_experiment_path="$2"
shift # past argument
shift # past value
;;
-camera)
camera="$2"
if [[ $camera != "OPENCV" && $camera != "OPENCV_FISHEYE" ]]; then
echo "Error: -camera must be either 'OPENCV' or 'OPENCV_FISHEYE'."
exit 1
fi
shift # past argument
shift # past value
;;
*) # unknown option
echo "Unknown option: $1" >&2
exit 1
;;
esac
done
local_folder="dataset_content"
images_folder="dataset_images"
images_subfolder="images"
output_folder="$images_folder/$images_subfolder"
# Create the local folder if it doesn't exist
mkdir -p "$local_folder"
mkdir -p "$output_folder"
# Download the content from the GCS URI
gsutil -m cp -r "$gcs_dataset_path"/* "$local_folder/"
# Process files in the local folder
for file in "$local_folder"/*; do
if [[ -f "$file" ]]; then
# Check if the file is an image (e.g., jpg, png, etc.)
if file --mime-type "$file" | grep -q "image"; then
# Copy the image to the "images" subfolder within the "dataset_images" folder
cp "$file" "$output_folder/$(basename "$file")"
elif file --mime-type "$file" | grep -q "video"; then
# Use FFmpeg to extract an image every 30 frames from the video
ffmpeg -i "$file" -vf "select='not(mod(n,30))'" "$output_folder/$(basename "$file" ."${file##*.}")_%03d.jpg"
else
echo "Skipping unsupported file: $file"
fi
fi
done
# Run COLMAP Feature extraction
colmap feature_extractor \
--database_path "$local_folder"/database.db \
--image_path "$output_folder" \
--ImageReader.single_camera 1 \
--ImageReader.camera_model "$camera" \
--SiftExtraction.use_gpu "$use_gpu"
# Run COLMAP Feature matching
colmap exhaustive_matcher \
--database_path "$local_folder"/database.db \
--SiftMatching.use_gpu "$use_gpu"
# Bundle adjustment. The default Mapper tolerance is unnecessarily large,
# decreasing it speeds up bundle adjustment steps.
mkdir -p "$local_folder"/sparse
colmap mapper \
--database_path "$local_folder"/database.db \
--image_path "$output_folder" \
--output_path "$local_folder"/sparse \
--Mapper.ba_global_function_tolerance=0.000001
# Downsample images at 1/2, 1/4, 1/8 scales. Save feature matching to
# sqlite database.
# All input and output images:
# $gcs_dataset_path
# $gcs_experiment_path/data/images
# Downsampled output images:
# $gcs_experiment_path/data/images_2/
# $gcs_experiment_path/data/images_4/
# $gcs_experiment_path/data/images_8/
# COLMAP sparse reconstruction files: project.ini, images.bin,
# cameras.bin, points3D.bin
# $gcs_experiment_path/data/sparse/0/
cp -r "$output_folder" "$images_folder"/images_2
pushd "$images_folder"/images_2
ls | xargs -P 8 -I {} mogrify -resize 50% {}
popd
gsutil -m cp -r "$images_folder"/images_2/* "$gcs_experiment_path"/data/images_2
cp -r "$output_folder" "$images_folder"/images_4
pushd "$images_folder"/images_4
ls | xargs -P 8 -I {} mogrify -resize 25% {}
popd
gsutil -m cp -r "$images_folder"/images_4/* "$gcs_experiment_path"/data/images_4
cp -r "$output_folder" "$images_folder"/images_8
pushd "$images_folder"/images_8
ls | xargs -P 8 -I {} mogrify -resize 12.5% {}
popd
gsutil -m cp "$images_folder"/images_8/* "$gcs_experiment_path"/data/images_8
# Copy images and sparse reconstruction files to gcs experiment folder.
gsutil -m cp "$images_folder"/images/* "$gcs_experiment_path"/data/images
gsutil -m cp -r "$local_folder"/sparse "$gcs_experiment_path"/data
gsutil -m cp "$local_folder"/database.db "$gcs_experiment_path"/data
echo "Processing complete."
@@ -0,0 +1,117 @@
#!/bin/bash
# This script runs rendering for ZipNeRF given an experiment folder
# from a GCS bucket with colmap dataset.
# Initialize associative array for arguments.
declare -A args
# vv-docker:google3-begin(internal)
# TODO(b/311468174): Pass gin config file from gcs bucket.
# vv-docker:google3-end
# Function to parse named arguments.
parse_args() {
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-gcs_experiment_path|-gin_config_file|-gcs_keyframes_file)
args[$key]="$2"
shift # past argument
shift # past value
;;
-training_job_name)
training_job_name="$2"
shift # past argument
shift # past value
;;
-rendering_job_name)
rendering_job_name="$2"
shift # past argument
shift # past value
;;
-render_path_frames|-factor|-render_video_fps)
args[$key]="$2"
if ! [[ ${args[$key]} =~ ^[0-9]+$ ]]; then
echo "Error: $key must be an integer."
exit 1
fi
shift # past argument
shift # past value
;;
*)
echo "Unknown option: $1" >&2
exit 1
;;
esac
done
}
# Function to create a directory if it doesn't exist.
create_dir_if_not_exists() {
local dir_path=$1
if [[ ! -d "$dir_path" ]]; then
echo "Creating folder: $dir_path"
mkdir "$dir_path"
else
echo "Folder $dir_path already exists."
fi
}
# Function to launch rendering.
launch_rendering() {
local keyframes_file=$1
local render_bindings=(
"--gin_configs=${args[-gin_config_file]}"
"--gin_bindings=Config.data_dir='${DATASET_PATH}'"
"--gin_bindings=Config.exp_name='${EXPERIMENT}'"
"--gin_bindings=Config.render_path=True"
"--gin_bindings=Config.render_path_frames=${args[-render_path_frames]}"
"--gin_bindings=Config.render_video_fps=${args[-render_video_fps]}"
"--gin_bindings=Config.factor=${args[-factor]}"
)
if [[ -n $keyframes_file ]]; then
render_bindings+=("--gin_bindings=Config.render_spline_keyframes='${keyframes_file}'")
fi
accelerate launch render.py "${render_bindings[@]}"
}
# Parse arguments.
parse_args "$@"
# Extract folder names and paths.
scene_folder_name=$(basename "${args[-gcs_experiment_path]}")
local_dataset_path="local_dataset"
local_experiment_path="exp"
exp_folder_name=$(basename "${args[-gcs_experiment_path]}")
DATASET_PATH="$local_experiment_path/$exp_folder_name/data"
CHECKPOINTS_PATH="$local_experiment_path/$exp_folder_name/checkpoints"
OUTPUT_RENDER_PATH="$local_experiment_path/$scene_folder_name/render"
EXPERIMENT=$exp_folder_name
# Create necessary directories.
create_dir_if_not_exists "$local_dataset_path"
create_dir_if_not_exists "$local_experiment_path"
create_dir_if_not_exists "$local_experiment_path/$exp_folder_name"
create_dir_if_not_exists "$CHECKPOINTS_PATH"
# Create the file log_render.txt in the exp folder.
touch "$local_experiment_path/$exp_folder_name/log_render.txt"
# Copy experiment from GCS bucket to local
gsutil -m cp -r "${args[-gcs_experiment_path]}/data" "$local_experiment_path/$exp_folder_name" || exit 1
gsutil -m cp -r "${args[-gcs_experiment_path]}/checkpoints/${training_job_name}/*" "$CHECKPOINTS_PATH" || exit 1
# Check and copy keyframes file.
if [[ -n ${args[-gcs_keyframes_file]} ]]; then
keyframes_file_basename=$(basename "${args[-gcs_keyframes_file]}")
local_keyframes_file="$local_dataset_path/$keyframes_file_basename"
gsutil cp "${args[-gcs_keyframes_file]}" "$local_keyframes_file" || exit 1
echo "Local keyframe file: $local_keyframes_file"
launch_rendering "$local_keyframes_file"
else
launch_rendering ""
fi
# Copy rendered data back to GCS.
gsutil -m cp -r "$OUTPUT_RENDER_PATH" "${args[-gcs_experiment_path]}/render/${rendering_job_name}"
@@ -0,0 +1,24 @@
--find-links https://download.pytorch.org/whl/torch_stable.html
torch==2.0.1+cu118
numpy==1.26.1
absl_py==2.0.0
accelerate==0.24.0
gin_config==0.5.0
imageio==2.31.6
imageio-ffmpeg==0.4.9
matplotlib==3.8.0
mediapy==1.1.9
ninja==1.11.1.1
opencv_contrib_python==4.8.1.78
opencv_python==4.8.1.78
Pillow==10.3.0
rawpy==0.18.1
scipy==1.11.3
scikit-image==0.22.0
scikit-learn==1.3.2
tensorboard==2.15.0
tensorboardX==2.6.2.2
tqdm==4.66.3
trimesh==4.0.1
xatlas==0.0.8
@@ -0,0 +1,94 @@
#!/bin/bash
# Initialize variables.
training_job_name=""
gcs_experiment_path=""
gin_config_file="configs/360.gin"
factor=4
max_training_steps=25000
# Parse named arguments.
while [[ $# -gt 0 ]]; do
case $1 in
-training_job_name)
training_job_name="$2"
shift # past argument
shift # past value
;;
-gcs_experiment_path)
gcs_experiment_path="$2"
shift # past argument
shift # past value
;;
-gin_config_file)
gin_config_file="$2"
shift # past argument
shift # past value
;;
-factor)
factor="$2"
if ! [[ $factor =~ ^[0-9]+$ ]]; then
echo "Error: -factor must be an integer."
exit 1
fi
shift # past argument
shift # past value
;;
-max_training_steps)
max_training_steps="$2"
if ! [[ $max_training_steps =~ ^[0-9]+$ ]]; then
echo "Error: -max_training_steps must be an integer."
exit 1
fi
shift # past argument
shift # past value
;;
*) # unknown option
echo "Unknown option: $1" >&2
exit 1
;;
esac
done
# Function to create a directory if it doesn't exist.
create_dir_if_not_exists() {
local dir_path=$1
if [[ ! -d "$dir_path" ]]; then
echo "Creating folder: $dir_path"
mkdir "$dir_path"
else
echo "Folder $dir_path already exists."
fi
}
# Extract folder names and paths.
scene_folder_name=$(basename "${gcs_experiment_path}")
local_dataset_path="local_dataset"
local_experiment_path="exp"
DATASET_PATH="$local_experiment_path/$scene_folder_name/data"
EXPERIMENT=$scene_folder_name
# Create necessary directories.
create_dir_if_not_exists "$local_dataset_path"
create_dir_if_not_exists "$local_experiment_path"
create_dir_if_not_exists "$local_experiment_path/$scene_folder_name"
# Copy experiment from GCS bucket to local.
gsutil -m cp -r "${gcs_experiment_path}/data" "$local_experiment_path/$scene_folder_name" || exit 1
echo "GCS Experiment: $gcs_experiment_path"
echo "Gin Config File: $gin_config_file"
echo "Factor: $factor"
echo "Scene: $scene_folder_name"
echo "Local Dataset: $DATASET_PATH"
echo "Local Experiment: $EXPERIMENT"
accelerate launch train.py --gin_configs="$gin_config_file" \
--gin_bindings="Config.data_dir = '${DATASET_PATH}'" \
--gin_bindings="Config.exp_name = '${EXPERIMENT}'" \
--gin_bindings="Config.factor = ${factor}" \
--gin_bindings="Config.max_steps = ${max_training_steps}"
gsutil -m rm -r "${gcs_experiment_path}/checkpoints/${training_job_name}"
gsutil -m cp -r "$local_experiment_path/$scene_folder_name/config.gin" "${gcs_experiment_path}/${training_job_name}_config.gin"
gsutil -m cp -r "$local_experiment_path/$scene_folder_name/checkpoints/*/*" "${gcs_experiment_path}/checkpoints/${training_job_name}"
@@ -0,0 +1,90 @@
# Dockerfile for Detectron2 serving.
#
# To build:
# docker build -f model_oss/detectron2/dockerfile/serving.Dockerfile . -t ${YOUR_IMAGE_TAG}
#
# To push to gcr:
# docker tag ${YOUR_IMAGE_TAG} gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
# docker push gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
FROM pytorch/torchserve:0.7.0-cpu
USER root
# Install tools.
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
wget \
vim
# run and update some basic packages software packages, including security libs
RUN apt-get update && apt-get install -y \
software-properties-common && \
add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
apt-get update && apt-get install -y \
gcc-9 g++-9 apt-transport-https ca-certificates gnupg curl
# Install gcloud tools for gsutil as well as debugging
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | \
tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
apt-get update -y && apt-get install google-cloud-sdk -y
USER model-server
# install detectron2 dependencies
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --user numpy==1.24.2
RUN python3 -m pip install --user opencv-python==4.7.0.72
RUN python3 -m pip install --user 'git+https://github.com/facebookresearch/detectron2.git@v0.6'
# Install GCS storage library.
RUN pip install google-cloud-storage==2.6.0
# For mask encoding.
RUN pip install --upgrade pycocotools==2.0.6
ARG MODEL_NAME=detectron2_serving
ENV MODEL_NAME="${MODEL_NAME}"
# health and prediction listener ports
ARG AIP_HTTP_PORT=7080
ENV AIP_HTTP_PORT="${AIP_HTTP_PORT}"
ARG MODEL_MGMT_PORT=7081
# expose health and prediction listener ports from the image
EXPOSE "${AIP_HTTP_PORT}"
EXPOSE "${MODEL_MGMT_PORT}"
EXPOSE 8080 8081 8082 7070 7071
# create torchserve configuration file
USER root
RUN echo "service_envelope=json\n" \
"inference_address=http://0.0.0.0:${AIP_HTTP_PORT}\n" \
"management_address=http://0.0.0.0:${MODEL_MGMT_PORT}" >> /home/model-server/config.properties
USER model-server
# Copy license.
RUN wget https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/LICENSE
# Copy model artifacts.
COPY ./model_oss/detectron2/handler.py /home/model-server/handler.py
WORKDIR /home/model-server/
# Create model archive file packaging model artifacts and dependencies.
# Note(lavrai): The model `.pth` file and `cfg.yaml` file will be set by the
# customer as an environment variable and will be later loaded by the
# `handler.py` file.
RUN torch-model-archiver \
--model-name="${MODEL_NAME}" \
--version=1.0 \
--handler=/home/model-server/handler.py \
--export-path=/home/model-server/model-store \
-f
# run Torchserve HTTP serve to respond to prediction requests
CMD ["ls", "-ltr", "/home/model-server/model-store/", ";", \
"torchserve", "--start", "--ts-config=/home/model-server/config.properties", \
"--models", "${MODEL_NAME}=${MODEL_NAME}.mar", \
"--model-store", "/home/model-server/model-store"]
@@ -0,0 +1,100 @@
# Dockerfile for Detectron2 training.
#
# To build:
# docker build -f model_oss/detectron2/dockerfile/train.Dockerfile . -t ${YOUR_IMAGE_TAG}
#
# To push to gcr:
# docker tag ${YOUR_IMAGE_TAG} gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
# docker push gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
FROM nvidia/cuda:11.1.1-cudnn8-devel-ubuntu18.04
# Using an older system (18.04) to avoid opencv incompatibility (issue#3524).
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y \
python3.7 python3.7-dev python3.7-distutils \
python3-opencv ca-certificates git wget sudo ninja-build \
curl wget vim
# Make python3 available for python3.7.
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2
RUN update-alternatives --config python3
# Make python available for python3.7.
RUN ln -sv /usr/bin/python3.7 /usr/bin/python
# Create a non-root user.
ARG USER_ID=1000
RUN useradd -m --no-log-init --system --uid ${USER_ID} appuser -g sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER appuser
WORKDIR /home/appuser
ENV PATH="/home/appuser/.local/bin:${PATH}"
RUN wget https://bootstrap.pypa.io/pip/get-pip.py && \
python3.7 get-pip.py --user && \
rm get-pip.py
# Important! Otherwise, it uses existing numpy from host-modules
# which throws error.
RUN pip install --user numpy==1.20.3
# Install dependencies:
# See https://pytorch.org/ for other options if you use
# a different version of CUDA.
RUN pip install --user tensorboard==2.11.0
# cmake from apt-get is too old.
RUN pip install --user cmake==3.25.2
RUN pip install --user torch==1.10.0+cu111 torchvision==0.11.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html
RUN pip install --user setuptools==59.5.0
RUN pip install --user opencv-python==4.7.0.72
RUN pip install --user cloudml-hypertune==0.1.0.dev6
RUN pip install --user fvcore==0.1.5.post20221221
# Install detectron2.
RUN git clone -b v0.6 https://github.com/facebookresearch/detectron2 detectron2_repo
# Set FORCE_CUDA because during `docker build` cuda is not accessible.
ENV FORCE_CUDA="1"
# This will by default build detectron2 for all common cuda
# architectures and take a lot more time,
# because inside `docker build`, there is no way to tell
# which architecture will be used.
ARG TORCH_CUDA_ARCH_LIST="Kepler;Kepler+Tesla;Maxwell;Maxwell+Tegra;Pascal;Volta;Turing"
ENV TORCH_CUDA_ARCH_LIST="${TORCH_CUDA_ARCH_LIST}"
RUN pip install --user -e detectron2_repo
# Set a fixed model cache directory.
ENV FVCORE_CACHE="/tmp"
# Copy license.
RUN wget https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/LICENSE
# Copy model-garden detectron2 files to '/home/appuser/trainer' folder.
ADD ./model_oss/detectron2 /home/appuser/trainer
################ Copy plain_train_net.py to task.py and
# then modify it using sed commands. ###################
# Src: https://github.com/facebookresearch/detectron2/blob/v0.6/tools/plain_train_net.py
RUN sudo cp /home/appuser/detectron2_repo/tools/plain_train_net.py /home/appuser/trainer/task.py
# Make additional changes to task.py.
# Note(lavrai): Start adding SED commands from end of file towards the top
# so that the line numbers do not keep changing for the source file.
# For entry-point:
RUN sudo sed -i "214 d" /home/appuser/trainer/task.py
RUN sudo sed -i "213 a\ default_arg_parser = default_argument_parser()" /home/appuser/trainer/task.py
RUN sudo sed -i "214 a\ extended_parser = trainer_utils.extend_parser_arguments(default_arg_parser)" /home/appuser/trainer/task.py
RUN sudo sed -i "215 a\ args = extended_parser.parse_args()" /home/appuser/trainer/task.py
# For main() function:
RUN sudo sed -i "192 a\ trainer_utils.register_dataset(args)" /home/appuser/trainer/task.py
# For setup() function:
RUN sudo sed -i "184 a\ cfg.SOLVER.BASE_LR = args.lr" /home/appuser/trainer/task.py
RUN sudo sed -i "185 a\ cfg.OUTPUT_DIR = args.output_dir" /home/appuser/trainer/task.py
RUN sudo sed -i "186 a\ cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url(config_file_copy)" /home/appuser/trainer/task.py
RUN sudo sed -i "182 a\ config_file_copy = args.config_file" /home/appuser/trainer/task.py
RUN sudo sed -i "183 a\ args.config_file = model_zoo.get_config_file(args.config_file)" /home/appuser/trainer/task.py
# For new import:
RUN sudo sed -i "27 a\from detectron2 import model_zoo" /home/appuser/trainer/task.py
RUN sudo sed -i "21 a\import trainer_utils" /home/appuser/trainer/task.py
ENV PYTHONPATH /home/appuser/trainer
ENTRYPOINT ["python", "-m", "trainer.task"]
@@ -0,0 +1,154 @@
"""Custom handler for Detectron2 serving."""
import io
import json
import os
from typing import Any, List, Tuple
import cv2
from detectron2.config import get_cfg
from detectron2.engine import DefaultPredictor
from google.cloud import storage
import numpy as np
import pycocotools.mask as mask_util
import torch
def get_bucket_and_blob_name(gcs_filepath: str) -> Tuple[str, str]:
"""Gets bucket and blob name from gcs path."""
# The gcs path is of the form gs://<bucket-name>/<blob-name>
gs_suffix = gcs_filepath.split("gs://", 1)[1]
return tuple(gs_suffix.split("/", 1))
def download_gcs_file(src_file_path: str, dst_file_path: str):
"""Downloads gcs-file to local folder."""
src_bucket_name, src_blob_name = get_bucket_and_blob_name(src_file_path)
client = storage.Client()
src_bucket = client.get_bucket(src_bucket_name)
src_blob = src_bucket.blob(src_blob_name)
src_blob.download_to_filename(dst_file_path)
class ModelHandler:
"""Custom model handler for Detectron2."""
def __init__(self):
self.error = None
self._batch_size = 0
self.initialized = False
self.predictor = None
self.test_threshold = 0.5
def initialize(self, context: Any):
"""Initialize."""
print("context.system_properties: ", context.system_properties)
print("context.manifest: ", context.manifest)
self.manifest = context.manifest
properties = context.system_properties
# Get threshold from environment variable.
# This will be set by customer.
self.test_threshold = float(os.environ.get("TEST_THRESHOLD"))
print("test_threshold: ", self.test_threshold)
# Get model and config file location from environment variables.
# These will be set by customer when doing model upload.
gcs_model_file = os.environ["MODEL_PTH_FILE"]
gcs_config_file = os.environ["CONFIG_YAML_FILE"]
print("Copying gcs_model_file: ", gcs_model_file)
print("Copying gcs_config_file: ", gcs_config_file)
# Copy these files from GCS location to local file.
# Note(lavrai): GCSFuse path does not seem to work here for now.
model_file = "./model.pth"
config_file = "./cfg.yaml"
download_gcs_file(src_file_path=gcs_model_file, dst_file_path=model_file)
if not os.path.exists(model_file):
raise RuntimeError("Missing model_file: %s" % model_file)
download_gcs_file(src_file_path=gcs_config_file, dst_file_path=config_file)
if not os.path.exists(config_file):
raise RuntimeError("Missing config_file: %s" % config_file)
# Set up config file.
cfg = get_cfg()
cfg.merge_from_file(config_file)
cfg.MODEL.WEIGHTS = model_file
cfg.MODEL.DEVICE = (
cfg.MODEL.DEVICE + str(properties.get("gpu_id"))
if torch.cuda.is_available()
else "cpu"
)
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = self.test_threshold
# Build predictor from config.
self.predictor = DefaultPredictor(cfg)
self._batch_size = context.system_properties["batch_size"]
self.initialized = True
def preprocess(self, batch: List[Any]) -> List[Any]:
"""Preprocess raw input and return as list of images."""
print("Running pre-processing.")
images = []
for request in batch:
request_data = request.get("data")
input_bytes = io.BytesIO(request_data)
img = cv2.imdecode(np.fromstring(input_bytes.read(), np.uint8), 1)
images.append(img)
return images
def inference(self, model_input: List[Any]) -> List[Any]:
"""Runs inference."""
print("Running model-inference.")
return [self.predictor(image) for image in model_input]
def postprocess(self, inference_result: List[Any]) -> List[Any]:
"""Post process inference result."""
response_list = []
print("Num inference_items are:", len(inference_result))
for inference_item in inference_result:
predictions = inference_item["instances"].to("cpu")
print("Predictions are:", predictions)
boxes = None
if predictions.has("pred_boxes"):
boxes = predictions.pred_boxes.tensor.numpy().tolist()
scores = None
if predictions.has("scores"):
scores = predictions.scores.numpy().tolist()
classes = None
if predictions.has("pred_classes"):
classes = predictions.pred_classes.numpy().tolist()
masks_rle = None
if predictions.has("pred_masks"):
# Do run length encoding, else the mask output becomes huge.
masks_rle = [
mask_util.encode(np.asfortranarray(mask))
for mask in predictions.pred_masks
]
for rle in masks_rle:
rle["counts"] = rle["counts"].decode("utf-8")
response = {
"classes": classes,
"scores": scores,
"boxes": boxes,
"masks_rle": masks_rle,
}
response_list.append(json.dumps(response))
print("response_list: ", response_list)
return response_list
def handle(self, data: Any, context: Any) -> List[Any]: # pylint: disable=unused-argument
"""Runs preprocess, inference, and post-processing."""
model_input = self.preprocess(data)
model_out = self.inference(model_input)
output = self.postprocess(model_out)
print("Done handling input.")
return output
_service = ModelHandler()
def handle(data: Any, context: Any) -> List[Any]:
if not _service.initialized:
_service.initialize(context)
if data is None:
return None
return _service.handle(data, context)
@@ -0,0 +1,97 @@
"""Detectron2 trainer helper functions."""
import argparse
from detectron2.data.datasets import register_coco_instances
def extend_parser_arguments(
parser: argparse.ArgumentParser,
) -> argparse.ArgumentParser:
"""Adds additional model-garden related arguments."""
parser.add_argument(
"--train_dataset_name",
required=False,
default="",
type=str,
help=(
"The training dataset name for registration. "
"For example: 'balloon_train'."
),
)
parser.add_argument(
"--train_coco_json_file",
required=False,
default="",
type=str,
help="The path to the training coco-json format file.",
)
parser.add_argument(
"--train_image_root",
required=False,
default="",
type=str,
help="The path to the root folder containing the training images.",
)
parser.add_argument(
"--val_dataset_name",
required=False,
default="",
type=str,
help=(
"The validation dataset name for registration. "
"For example: 'balloon_val'."
),
)
parser.add_argument(
"--val_coco_json_file",
required=False,
default="",
type=str,
help="The path to the validation coco-json format file.",
)
parser.add_argument(
"--val_image_root",
required=False,
default="",
type=str,
help="The path to the root folder containing the validation images.",
)
parser.add_argument(
"--output_dir",
required=True,
type=str,
help="The path to the output directory.",
)
# Add hyper-parameter tuning related variables.
parser.add_argument(
"--lr",
type=float,
default=0.00025,
help="The learning rate to be tuned.",
)
parser.add_argument(
"--hp_eval_task",
type=str,
choices=["bbox", "segm"],
default="bbox",
help="The task choice for HP tuning.",
)
return parser
def register_dataset(args: argparse.Namespace):
"""Register the input dataset in Detectron2 Coco format."""
if args.train_dataset_name:
register_coco_instances(
name=args.train_dataset_name,
metadata={},
json_file=args.train_coco_json_file,
image_root=args.train_image_root,
)
if args.val_dataset_name:
register_coco_instances(
name=args.val_dataset_name,
metadata={},
json_file=args.val_coco_json_file,
image_root=args.val_image_root,
)
@@ -0,0 +1,83 @@
# This Dockerfile converts JAX vision transformer model to
# tensorflow saved model format.
# Here is an example to build this dockerfile:
# PROJECT="your gcp project"
# IMAGE_TAG="jax-f-vlm-model-conversion:${USER}-test"
# docker build -f model_oss/fvlm/dockerfile/jax_fvlm_model_conversion.Dockerfile . -t "${IMAGE_TAG}"
# docker tag "${IMAGE_TAG}" "gcr.io/${PROJECT}/${IMAGE_TAG}"
# docker push "gcr.io/${PROJECT}/${IMAGE_TAG}"
# See https://cloud.google.com/tensorflow-enterprise/docs/overview for details.
FROM gcr.io/deeplearning-platform-release/tf2-gpu.2-12.py310:m110
ENV DEBIAN_FRONTEND=noninteractive
# Install basic libs
RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
curl \
wget \
sudo \
gnupg \
libsm6 \
libxext6 \
libxrender-dev \
lsb-release \
ca-certificates \
build-essential \
git \
libgl1
# Copy Apache license.
RUN wget https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/LICENSE
# Install required libs
RUN pip install --upgrade pip
# Using the commit 6712c224985c694001ba8ee68697bbf4dcb32edb on Jan 4th, 2024.
ARG COMMIT_ID=6712c224985c694001ba8ee68697bbf4dcb32edb
RUN git clone -c \
remote.origin.fetch=+${COMMIT_ID}:refs/remotes/origin/${COMMIT_ID} \
https://github.com/google-research/google-research --no-checkout --progress \
--depth 1
WORKDIR ./google-research
RUN git sparse-checkout init --cone
RUN git sparse-checkout set fvlm
RUN git checkout ${COMMIT_ID}
# The following pip installs are pinned down versions satisfying
# fvlm/requirements.txt file.
# NOTE: Using `no-deps` flag to avoid overwriting of dependent library
# versions. For example, both `chex` and `jax` can overwrite each other's
# `jax-lib` version.
# Note: The following libraries are pinned down versions of:
# https://github.com/google-research/google-research/blob/master/fvlm/requirements.txt
RUN pip install --no-cache-dir tensorflow==2.12.0
RUN pip install --no-cache-dir tensorflow-datasets==4.9.2
RUN pip install --no-cache-dir numpy==1.23.5
RUN pip install --no-cache-dir torch==2.0.1
RUN pip install --no-cache-dir torchvision==0.15.2
RUN pip install --no-cache-dir opencv-python==4.7.0.72
RUN pip install --no-cache-dir tqdm==4.65.0
RUN pip install --no-cache-dir git+https://github.com/openai/CLIP.git@a1d071733d7111c9c014f024669f959182114e33
RUN pip install --no-cache-dir Pillow==9.5.0
RUN pip install --no-cache-dir orbax-checkpoint==0.3.3
RUN pip install --no-cache-dir gin-config==0.5.0
RUN pip install --no-cache-dir pycocotools==2.0.6
RUN pip install --no-cache-dir contextlib2==21.6.0
RUN pip install --no-cache-dir ml-collections==0.1.1
RUN pip install --no-cache-dir chex==0.1.7
RUN pip install --no-cache-dir optax==0.1.5
# Dependencies already included. Use no-deps to not update numpy.
RUN pip install --no-cache-dir --no-deps flax==0.7.2
RUN pip install --no-cache-dir --no-deps clu==0.0.9
RUN pip install --no-cache-dir jax[cuda11_cudnn86]==0.4.9 \
--find-links https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
RUN pip install --no-cache-dir ml-dtypes==0.2.0
RUN pip install --no-cache-dir tensorflow_text==2.12.0
WORKDIR ./fvlm
ENV PYTHONPATH ./
ENTRYPOINT ["python", "export_saved_model.py"]
@@ -0,0 +1,78 @@
# This Dockerfile trains the F-VLM model on GPU.
# Here is an example to build this dockerfile:
# PROJECT="your gcp project"
# IMAGE_TAG="jax-f-vlm-train:${USER}-test"
# docker build -f model_oss/fvlm/dockerfile/jax_fvlm_train_gpu.Dockerfile . -t "${IMAGE_TAG}"
# docker tag "${IMAGE_TAG}" "gcr.io/${PROJECT}/${IMAGE_TAG}"
# docker push "gcr.io/${PROJECT}/${IMAGE_TAG}"
# See https://cloud.google.com/tensorflow-enterprise/docs/overview for details.
FROM gcr.io/deeplearning-platform-release/tf2-gpu.2-12.py310:m110
ENV DEBIAN_FRONTEND=noninteractive
# Install basic libs
RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
curl \
wget \
sudo \
gnupg \
libsm6 \
libxext6 \
libxrender-dev \
lsb-release \
ca-certificates \
build-essential \
git
# Copy Apache license.
RUN wget https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/LICENSE
# Install required libs
RUN pip install --upgrade pip
# The following pip installs are pinned down versions satisfying
# fvlm/requirements.txt file.
# Get F-VLM repository by using git sparse-checkout to avoid downloading entire
# google-research repository.
# Using the commit 6712c224985c694001ba8ee68697bbf4dcb32edb on Jan 4th, 2024.
ARG COMMIT_ID=6712c224985c694001ba8ee68697bbf4dcb32edb
RUN git clone -c \
remote.origin.fetch=+${COMMIT_ID}:refs/remotes/origin/${COMMIT_ID} \
https://github.com/google-research/google-research --no-checkout --progress \
--depth 1
WORKDIR ./google-research
RUN git sparse-checkout init --cone
RUN git sparse-checkout set fvlm
RUN git checkout ${COMMIT_ID}
# Note: The following libraries are pinned down versions of:
# https://github.com/google-research/google-research/blob/master/fvlm/requirements.txt
RUN pip install --no-cache-dir tensorflow==2.12.0
RUN pip install --no-cache-dir tensorflow-datasets==4.9.2
RUN pip install --no-cache-dir numpy==1.23.5
RUN pip install --no-cache-dir torch==2.0.1
RUN pip install --no-cache-dir torchvision==0.15.2
RUN pip install --no-cache-dir opencv-python==4.7.0.72
RUN pip install --no-cache-dir tqdm==4.65.0
RUN pip install --no-cache-dir git+https://github.com/openai/CLIP.git@a1d071733d7111c9c014f024669f959182114e33
RUN pip install --no-cache-dir Pillow==9.5.0
RUN pip install --no-cache-dir orbax-checkpoint==0.3.3
RUN pip install --no-cache-dir gin-config==0.5.0
RUN pip install --no-cache-dir pycocotools==2.0.6
RUN pip install --no-cache-dir contextlib2==21.6.0
RUN pip install --no-cache-dir ml-collections==0.1.1
RUN pip install --no-cache-dir chex==0.1.7
RUN pip install --no-cache-dir optax==0.1.5
# Dependencies already included. Use no-deps to not update numpy.
RUN pip install --no-cache-dir --no-deps flax==0.7.2
RUN pip install --no-cache-dir --no-deps clu==0.0.9
# Installing jax at the very end with GPU support.
# NOTE: Not using `no-deps` flag here because we need CUDA support.
RUN pip install --no-cache-dir jax[cuda11_cudnn86]==0.4.9 \
--find-links https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
WORKDIR ./fvlm
ENV PYTHONPATH ./
ENTRYPOINT ["python", "train_and_eval.py"]
@@ -0,0 +1,138 @@
# This Dockerfile trains the F-VLM model on TPU.
# Here is an example to build this dockerfile:
# PROJECT="your gcp project"
# IMAGE_TAG="jax-f-vlm-train-tpu:${USER}-test"
# docker build -f model_oss/fvlm/dockerfile/jax_fvlm_train_tpu.Dockerfile . -t "${IMAGE_TAG}"
# docker tag "${IMAGE_TAG}" "gcr.io/${PROJECT}/${IMAGE_TAG}"
# docker push "gcr.io/${PROJECT}/${IMAGE_TAG}"
FROM python:3.11
# Get libtpu shared library. See go/what-is-libtpu.
RUN curl -L https://storage.googleapis.com/cloud-tpu-tpuvm-artifacts/libtpu/1.6.0/libtpu.so -o /lib/libtpu.so
ENV DEBIAN_FRONTEND=noninteractive
# Install basic libs
RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
curl \
wget \
sudo \
gnupg \
libsm6 \
libxext6 \
libxrender-dev \
lsb-release \
ca-certificates \
build-essential \
git \
libgl1
# Copy Apache license.
RUN wget https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/LICENSE
# Install required libs
RUN pip install --upgrade pip
# Get F-VLM repository by using git sparse-checkout to avoid downloading entire
# google-research repository.
# Using the commit 05ece4b1c97285b48b51fa44321ccb2cb347406a on Dec 11th, 2023.
ARG COMMIT_ID=05ece4b1c97285b48b51fa44321ccb2cb347406a
RUN git clone -c \
remote.origin.fetch=+${COMMIT_ID}:refs/remotes/origin/${COMMIT_ID} \
https://github.com/google-research/google-research --no-checkout --progress \
--depth 1
WORKDIR ./google-research
RUN git sparse-checkout init --cone
RUN git sparse-checkout set fvlm
RUN git checkout ${COMMIT_ID}
# Note: The following libraries are pinned down versions of:
# https://github.com/google-research/google-research/blob/master/fvlm/requirements.txt
RUN pip install --no-cache-dir ml_dtypes==0.3.1
RUN pip install --no-cache-dir tensorstore==0.1.51
RUN pip install --no-cache-dir MarkupSafe==2.1.3
RUN pip install --no-cache-dir Pillow==9.5.0
RUN pip install --no-cache-dir PyYAML==6.0.1
RUN pip install --no-cache-dir absl_py==1.4.0
RUN pip install --no-cache-dir array_record==0.4.1
RUN pip install --no-cache-dir astunparse==1.6.3
RUN pip install --no-cache-dir cachetools==5.3.1
RUN pip install --no-cache-dir certifi==2023.7.22
RUN pip install --no-cache-dir charset_normalizer==3.3.0
RUN pip install --no-cache-dir chex==0.1.83
RUN pip install --no-cache-dir click==8.1.7
RUN pip install --no-cache-dir clip==0.2.0
RUN pip install --no-cache-dir clu==0.0.9
RUN pip install --no-cache-dir contourpy==1.1.1
RUN pip install --no-cache-dir cycler==0.12.1
RUN pip install --no-cache-dir dm_tree==0.1.8
RUN pip install --no-cache-dir etils==1.5.1
RUN pip install --no-cache-dir filelock==3.12.4
RUN pip install --no-cache-dir flatbuffers==23.5.26
RUN pip install --no-cache-dir flax==0.7.4
RUN pip install --no-cache-dir fonttools==4.43.1
RUN pip install --no-cache-dir fsspec==2023.9.2
RUN pip install --no-cache-dir ftfy==6.1.1
RUN pip install --no-cache-dir gast==0.5.4
RUN pip install --no-cache-dir gin_config==0.5.0
RUN pip install --no-cache-dir google_auth==2.23.3
RUN pip install --no-cache-dir google_auth_oauthlib==1.0.0
RUN pip install --no-cache-dir google_pasta==0.2.0
RUN pip install --no-cache-dir googleapis_common_protos==1.61.0
RUN pip install --no-cache-dir grpcio==1.59.0
RUN pip install --no-cache-dir h5py==3.10.0
RUN pip install --no-cache-dir importlib_resources==6.1.0
RUN pip install --no-cache-dir 'jax[tpu]==0.4.18' \
-f https://storage.googleapis.com/jax-releases/libtpu_releases.html
RUN pip install --no-cache-dir jaxlib==0.4.18
RUN pip install --no-cache-dir jinja2==3.1.2
RUN pip install --no-cache-dir keras==2.14.0
RUN pip install --no-cache-dir kiwisolver==1.4.5
RUN pip install --no-cache-dir libclang==16.0.6
RUN pip install --no-cache-dir markdown==3.5
RUN pip install --no-cache-dir matplotlib==3.8.0
RUN pip install --no-cache-dir mpmath==1.3.0
RUN pip install --no-cache-dir networkx==3.1
RUN pip install --no-cache-dir numpy==1.26.0
RUN pip install --no-cache-dir nvidia_cublas_cu12==12.1.3.1
RUN pip install --no-cache-dir nvidia_cuda_cupti_cu12==12.1.105
RUN pip install --no-cache-dir nvidia_cuda_nvrtc_cu12==12.1.105
RUN pip install --no-cache-dir nvidia_cuda_runtime_cu12==12.1.105
RUN pip install --no-cache-dir nvidia_cudnn_cu12==8.9.2.26
RUN pip install --no-cache-dir nvidia_cufft_cu12==11.0.2.54
RUN pip install --no-cache-dir nvidia_curand_cu12==10.3.2.106
RUN pip install --no-cache-dir nvidia_cusolver_cu12==11.4.5.107
RUN pip install --no-cache-dir nvidia_cusparse_cu12==12.1.0.106
RUN pip install --no-cache-dir nvidia_nccl_cu12==2.18.1
RUN pip install --no-cache-dir nvidia_nvjitlink_cu12==12.2.140
RUN pip install --no-cache-dir nvidia_nvtx_cu12==12.1.105
RUN pip install --no-cache-dir opencv_python==4.8.1.78
RUN pip install --no-cache-dir orbax_checkpoint==0.4.1
RUN pip install --no-cache-dir promise==2.3
RUN pip install --no-cache-dir protobuf==3.20.3
RUN pip install --no-cache-dir psutil==5.9.5
RUN pip install --no-cache-dir pyasn1==0.5.0
RUN pip install --no-cache-dir pycocotools==2.0.7
RUN pip install --no-cache-dir pygments==2.16.1
RUN pip install --no-cache-dir regex==2023.10.3
RUN pip install --no-cache-dir rich==13.6.0
RUN pip install --no-cache-dir scipy==1.11.3
RUN pip install --no-cache-dir sympy==1.12
RUN pip install --no-cache-dir tensorboard==2.14.1
RUN pip install --no-cache-dir tensorboard_data_server==0.7.1
RUN pip install --no-cache-dir tensorflow==2.14.0
RUN pip install --no-cache-dir tensorflow_datasets==4.9.3
RUN pip install --no-cache-dir torch==2.1.0
RUN pip install --no-cache-dir torchvision==0.16.0
RUN pip install --no-cache-dir urllib3==2.0.6
RUN pip install --no-cache-dir wcwidth==0.2.8
RUN pip install --no-cache-dir werkzeug==3.0.0
RUN pip install --no-cache-dir wheel==0.41.2
RUN pip install --no-cache-dir tensorflow_text==2.14.0
WORKDIR ./fvlm
ENV PYTHONPATH ./
ENTRYPOINT ["python", "train_and_eval.py"]
@@ -0,0 +1,21 @@
number_of_netty_threads=32
job_queue_size=1000
model_store=/home/model-server/model-store
workflow_store=/home/model-server/wf-store
default_response_timeout=1800
service_envelope=json
inference_address=http://0.0.0.0:7080
management_address=http://0.0.0.0:7081
metrics_address=http://0.0.0.0:7082
models={\
"imagebind_serving": {\
"1.0": {\
"defaultVersion": true,\
"marName": "imagebind_serving.mar",\
"minWorkers": 1,\
"maxWorkers": 1,\
"batchSize": 1\
}\
}\
}
@@ -0,0 +1,74 @@
# Dockerfile for the serving docker for ImageBind.
#
# To build:
# docker build -f model_oss/imagebind/dockerfile/serve.Dockerfile . -t ${YOUR_IMAGE_TAG}
#
# To push to gcr:
# docker tag ${YOUR_IMAGE_TAG} gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
# docker push gcr.io/${YOUR_PROJECT}/${YOUR_IMAGE_TAG}
FROM pytorch/torchserve:0.7.0-gpu
USER root
ENV infer_port=7080
ENV mng_port=7081
ENV model_name="imagebind_serving"
ENV PATH="/home/model-server/:${PATH}"
# Install tools.
RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \
curl \
wget \
vim \
git \
libgeos-dev
# Install libraries.
ENV PIP_ROOT_USER_ACTION=ignore
RUN python3 -m pip install --upgrade pip
RUN pip install absl-py==1.4.0
RUN pip install google-cloud-storage==2.7.0
# Install ImageBind and dependencies.
RUN git clone https://github.com/facebookresearch/ImageBind.git
WORKDIR ImageBind
# Pin the commit at 07/14/2023.
RUN git reset --hard 95d27c7fd5a8362f3527e176c3a80ae5a4d880c0
# Modify tokenizer file path from ImageBind repo to work with the server.
RUN sed -i '25d' imagebind/data.py
RUN sed -i '25 i\BPE_PATH = "/home/model-server/ImageBind/bpe/bpe_simple_vocab_16e6.txt.gz"' imagebind/data.py
RUN pip install .
WORKDIR /home/model-server
# Copy license.
RUN wget https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/LICENSE
# Copy model artifacts.
COPY model_oss/imagebind/handler.py /home/model-server/handler.py
COPY model_oss/imagebind/config.properties /home/model-server/config.properties
COPY model_oss/util/ /home/model-server/util/
ENV PYTHONPATH /home/model-server/
# Expose ports.
EXPOSE ${infer_port}
EXPOSE ${mng_port}
# Archive model artifacts and dependencies.
# Do not set --model-file and --serialized-file because model and checkpoint
# will be dynamically loaded in handler.py.
RUN torch-model-archiver \
--model-name=${model_name} \
--version=1.0 \
--handler=/home/model-server/handler.py \
--runtime=python3 \
--export-path=/home/model-server/model-store \
--archive-format=default \
--force
# Run Torchserve HTTP serve to respond to prediction requests.
CMD ["torchserve", "--start", \
"--ts-config", "/home/model-server/config.properties", \
"--models", "${model_name}=${model_name}.mar", \
"--model-store", "/home/model-server/model-store"]
@@ -0,0 +1,277 @@
"""Custom handler for the ImageBind model."""
import logging
import os
from typing import Any, Dict, List
from imagebind import data as data_util
from imagebind.models import imagebind_model
from imagebind.models.imagebind_model import ModalityType
from PIL import Image
import torch
from torchvision import transforms
from ts.torch_handler import base_handler
from util import constants
from util import fileutils
_VIDEO_KEY_TO_AVOID_CONFLICT_WITH_IMAGE = "video"
class ImageBindHandler(base_handler.BaseHandler):
"""Custom handler for the ImageBind model.
Attributes:
map_location: Mapping storage location.
device: Device on which to run inference.
manifest: TorchServe manifest.
task: Task for which to run the ImageBind model.
model: ImageBind model instance.
"""
def initialize(self, context: Any) -> None:
"""Initializes the ImageBind model handler.
Args:
context: TorchServe context, which contains system information and the
manifest.
Raises:
ValueError: A task that is unsupported by the handler.
"""
properties = context.system_properties
self.map_location = (
"cuda"
if torch.cuda.is_available() and properties.get("gpu_id") is not None
else "cpu"
)
self.device = torch.device(
self.map_location + ":" + str(properties.get("gpu_id"))
if torch.cuda.is_available() and properties.get("gpu_id") is not None
else self.map_location
)
self.manifest = context.manifest
self.task = os.environ.get("TASK", constants.FEATURE_EMBEDDING_GENERATION)
if self.task not in [
constants.FEATURE_EMBEDDING_GENERATION,
constants.ZERO_SHOT_CLASSIFICATION,
]:
raise ValueError(f"Invalid task: {self.task}.")
logging.info(
"Handler initializing ImageBind pretrained model for task %s.",
self.task,
)
self.model = imagebind_model.imagebind_huge(pretrained=True)
self.model.eval()
self.model.to(self.device)
logging.info("Initialized ImageBind pretrained model.")
self.initialized = True
def preprocess(self, data: Any) -> List[Dict[str, Any]]:
"""Preprocesses input data, including text, image, audio and video data.
Args:
data: Input data.
Returns:
A list of processed data samples, with each sample being a dictionary of
modality (key): input (value) pairs.
"""
logging.info("Preprocessing: %d instances received.", len(data))
preprocessed_sample_list = []
for item in data:
preprocessed_sample = {}
if ModalityType.TEXT in item:
preprocessed_sample[ModalityType.TEXT] = (
data_util.load_and_transform_text(
item[ModalityType.TEXT], self.device
)
)
for image_modality in [
ModalityType.VISION,
ModalityType.DEPTH,
ModalityType.THERMAL,
]:
if image_modality in item:
image_paths = item[image_modality]
local_image_paths = fileutils.download_gcs_file_list_to_local(
image_paths, constants.LOCAL_DATA_DIR
)
is_depth_or_thermal = image_modality in [
ModalityType.DEPTH,
ModalityType.THERMAL,
]
preprocessed_sample[image_modality] = (
self._load_and_transform_image_data(
local_image_paths,
self.device,
is_depth_or_thermal=is_depth_or_thermal,
)
)
if ModalityType.AUDIO in item:
audio_paths = item[ModalityType.AUDIO]
local_audio_paths = fileutils.download_gcs_file_list_to_local(
audio_paths, constants.LOCAL_DATA_DIR
)
preprocessed_sample[ModalityType.AUDIO] = (
data_util.load_and_transform_audio_data(
local_audio_paths, self.device
)
)
if _VIDEO_KEY_TO_AVOID_CONFLICT_WITH_IMAGE in item:
video_paths = item[_VIDEO_KEY_TO_AVOID_CONFLICT_WITH_IMAGE]
local_video_paths = fileutils.download_gcs_file_list_to_local(
video_paths, constants.LOCAL_DATA_DIR
)
preprocessed_sample[_VIDEO_KEY_TO_AVOID_CONFLICT_WITH_IMAGE] = (
data_util.load_and_transform_video_data(
local_video_paths, self.device
)
)
if ModalityType.IMU in item:
# Input data in the IMU modality are expected in shape [B, 6, 2000].
preprocessed_sample[ModalityType.IMU] = torch.tensor(
item[ModalityType.IMU], dtype=torch.float32, device=self.device
)
if preprocessed_sample:
preprocessed_sample_list.append(preprocessed_sample)
return preprocessed_sample_list
def _load_and_transform_image_data(
self,
image_paths: List[str],
device: torch.device,
is_depth_or_thermal: bool = False,
) -> torch.Tensor:
"""Loads and transforms 3-channel images, depth images and thermal images.
Args:
image_paths: A list of image paths.
device: Device onto which to load images.
is_depth_or_thermal: Whether the images are depth or thermal images.
Returns:
A list of processed tensors corresponding to the input images.
Raises:
ValueError: The input image_paths is None.
"""
if image_paths is None:
raise ValueError("image_paths must not be None.")
image_outputs = []
for image_path in image_paths:
transforms_list = [
transforms.Resize(
224, interpolation=transforms.InterpolationMode.BICUBIC
),
transforms.CenterCrop(224),
transforms.ToTensor(),
]
if not is_depth_or_thermal:
transforms_list.append(
transforms.Normalize(
mean=(0.48145466, 0.4578275, 0.40821073),
std=(0.26862954, 0.26130258, 0.27577711),
)
)
data_transform = transforms.Compose(transforms_list)
with open(image_path, "rb") as fopen:
if is_depth_or_thermal:
image = Image.open(fopen).convert("L")
else:
image = Image.open(fopen).convert("RGB")
image = data_transform(image).to(device)
image_outputs.append(image)
return torch.stack(image_outputs, dim=0)
def inference(
self, data: List[Dict[str, Any]], *args, **kwargs
) -> List[Dict[str, Any]]:
"""Runs inference using the ImageBind model.
Args:
data: A list of processed data samples, with each sample being a
dictionary of modality (key): input (value) pairs.
*args: Additional inference args.
**kwargs: Additional inference kwargs.
Returns:
A list of model outputs, with each output being a dictionary of
modality (key): embedding (value) pairs.
"""
output_list = []
with torch.no_grad():
for inputs in data:
if _VIDEO_KEY_TO_AVOID_CONFLICT_WITH_IMAGE in inputs:
# Allows inference on both image and video data, which both fall under
# ModalityType.VISION.
video_inputs = {
ModalityType.VISION: inputs[
_VIDEO_KEY_TO_AVOID_CONFLICT_WITH_IMAGE
]
}
video_embeddings = self.model(video_inputs)
video_embeddings[_VIDEO_KEY_TO_AVOID_CONFLICT_WITH_IMAGE] = (
video_embeddings[ModalityType.VISION]
)
del video_embeddings[ModalityType.VISION]
del inputs[_VIDEO_KEY_TO_AVOID_CONFLICT_WITH_IMAGE]
else:
video_embeddings = {}
embeddings = self.model(inputs)
embeddings.update(video_embeddings)
output_list.append(embeddings)
return output_list
def postprocess(self, output_list: List[Dict[str, Any]]) -> List[Any]:
"""Postprocesses model outputs for the task of interest.
For feature embedding generation, returns the embeddings for each modality
for each input.
For zero-shot classification, generates classification probabilities
between the inputs of a pair of modalities for all possible pairings.
Args:
output_list: A list of model outputs, with each output being a dictionary
of modality (key): embedding (value) pairs.
Returns:
A list of postprocessed model outputs for the task of interest, with each
output corresponding to an input.
Raises:
ValueError: Fewer than two modalities are provided for zero-shot
classification, or the task is not supported.
"""
preds = []
if self.task == constants.FEATURE_EMBEDDING_GENERATION:
for item in output_list:
preds.append({k: v.tolist() for k, v in item.items()})
elif self.task == constants.ZERO_SHOT_CLASSIFICATION:
for item in output_list:
modalities = list(item.keys())
if len(modalities) < 2:
raise ValueError(
"Two or more modalities are needed for task"
f" {constants.ZERO_SHOT_CLASSIFICATION}."
)
pairwise_probs = {}
for m1 in modalities:
for m2 in modalities:
if m1 == m2:
continue
probs = torch.softmax(item[m1] @ item[m2].T, dim=-1)
pairwise_probs[
f"Classify each input in {m1} (row) against inputs in"
f" {m2} (column)"
] = probs.tolist()
preds.append(pairwise_probs)
else:
raise ValueError(f"Task {self.task} is not supported by the handler.")
return preds
@@ -0,0 +1,151 @@
# This Dockerfile converts JAX vision transformer model to
# tensorflow saved model format.
# Here is an example to build this dockerfile:
# PROJECT="your gcp project"
# IMAGE_TAG="jax-vit-model-conversion:${USER}-test"
# docker build -f model_oss/jax_vision_transformer/dockerfile/jax_vit_model_conversion.Dockerfile . -t "${IMAGE_TAG}"
# docker tag "${IMAGE_TAG}" "gcr.io/${PROJECT}/${IMAGE_TAG}"
# docker push "gcr.io/${PROJECT}/${IMAGE_TAG}"
FROM tensorflow/tensorflow:2.12.0-gpu
ENV DEBIAN_FRONTEND=noninteractive
# Install basic libs
RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
curl \
wget \
sudo \
gnupg \
libsm6 \
libxext6 \
libxrender-dev \
lsb-release \
ca-certificates \
build-essential \
git
# Copy Apache license.
RUN wget https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/LICENSE
# Get 'vision_transformer' repository from github.
RUN git clone https://github.com/google-research/vision_transformer
# Set current directory to the downloaded 'vision_transformer' repository.
WORKDIR ./vision_transformer
# Using git reset command to pin it down to a specific version.
RUN git reset --hard e66b4732d44504251197a3da3f5949f3f3ce9ca6
# Install required libs
RUN pip install --upgrade pip
# The following pip installs are pinned down versions of those inside
# vit_jax/requirements.txt file.
# NOTE: Using `no-deps` flag to avoid overwriting of
# dependent library versions. For example,
# both `chex` and `jax` can overwrite each others
# `jax-lib` version.
RUN pip install --no-deps absl-py==1.4.0
RUN pip install --no-deps aqtp==0.0.10
RUN pip install --no-deps array-record==0.2.0
RUN pip install --no-deps astunparse==1.6.3
RUN pip install --no-deps cached-property==1.5.2
RUN pip install --no-deps cachetools==5.3.0
RUN pip install --no-deps certifi==2019.11.28
RUN pip install --no-deps chardet==3.0.4
RUN pip install --no-deps chex==0.1.7
RUN pip install --no-deps click==8.1.3
RUN pip install --no-deps cloudpickle==2.2.1
RUN pip install --no-deps clu==0.0.9
RUN pip install --no-deps contextlib2==21.6.0
RUN pip install --no-deps dacite==1.8.1
RUN pip install --no-deps dbus-python==1.2.16
RUN pip install --no-deps decorator==5.1.1
RUN pip install --no-deps dm-tree==0.1.8
RUN pip install --no-deps einops==0.6.1
RUN pip install --no-deps etils==1.3.0
RUN pip install --no-deps flatbuffers==23.3.3
RUN pip install --no-deps flax==0.6.10
RUN pip install --no-deps git+https://github.com/google/flaxformer@9adaa4467cf17703949b9f537c3566b99de1b416
RUN pip install --no-deps gast==0.4.0
RUN pip install --no-deps google-auth==2.16.2
RUN pip install --no-deps google-auth-oauthlib==0.4.6
RUN pip install --no-deps google-pasta==0.2.0
RUN pip install --no-deps googleapis-common-protos==1.59.0
RUN pip install --no-deps grpcio==1.51.3
RUN pip install --no-deps h5py==3.8.0
RUN pip install --no-deps idna==2.8
RUN pip install --no-deps importlib-metadata==6.1.0
RUN pip install --no-deps importlib-resources==5.12.0
RUN pip install --no-deps keras==2.12.0
RUN pip install --no-deps libclang==16.0.0
RUN pip install --no-deps Markdown==3.4.3
RUN pip install --no-deps markdown-it-py==2.2.0
RUN pip install --no-deps MarkupSafe==2.1.2
RUN pip install --no-deps mdurl==0.1.2
RUN pip install --no-deps ml-collections==0.1.1
RUN pip install --no-deps msgpack==1.0.5
RUN pip install --no-deps nest-asyncio==1.5.6
RUN pip install --no-deps numpy==1.23.5
RUN pip install --no-deps oauthlib==3.2.2
RUN pip install --no-deps opt-einsum==3.3.0
RUN pip install --no-deps optax==0.1.5
RUN pip install --no-deps orbax-checkpoint==0.1.6
RUN pip install --no-deps packaging==23.0
RUN pip install --no-deps pandas==2.0.1
RUN pip install --no-deps pip==23.1.2
RUN pip install --no-deps promise==2.3
RUN pip install --no-deps protobuf==4.22.1
RUN pip install --no-deps psutil==5.9.5
RUN pip install --no-deps pyasn1==0.4.8
RUN pip install --no-deps pyasn1-modules==0.2.8
RUN pip install --no-deps Pygments==2.15.1
RUN pip install --no-deps PyGObject==3.36.0
RUN pip install --no-deps python-apt==2.0.1+ubuntu0.20.4.1
RUN pip install --no-deps python-dateutil==2.8.2
RUN pip install --no-deps pytz==2023.3
RUN pip install --no-deps PyYAML==6.0
RUN pip install --no-deps requests==2.22.0
RUN pip install --no-deps requests-oauthlib==1.3.1
RUN pip install --no-deps requests-unixsocket==0.2.0
RUN pip install --no-deps rich==13.3.5
RUN pip install --no-deps rsa==4.9
RUN pip install --no-deps scipy==1.10.1
RUN pip install --no-deps setuptools==67.6.0
RUN pip install --no-deps six==1.14.0
RUN pip install --no-deps tensorboard==2.12.0
RUN pip install --no-deps tensorboard-data-server==0.7.0
RUN pip install --no-deps tensorboard-plugin-wit==1.8.1
RUN pip install --no-deps tensorflow==2.12.0
RUN pip install --no-deps tensorflow-cpu==2.12.0
RUN pip install --no-deps tensorflow-datasets==4.9.2
RUN pip install --no-deps tensorflow-estimator==2.12.0
RUN pip install --no-deps tensorflow-hub==0.13.0
RUN pip install --no-deps tensorflow-io-gcs-filesystem==0.31.0
RUN pip install --no-deps tensorflow-metadata==1.13.1
RUN pip install --no-deps tensorflow-probability==0.20.0
RUN pip install --no-deps tensorflow-text==2.12.1
RUN pip install --no-deps tensorstore==0.1.36
RUN pip install --no-deps termcolor==2.2.0
RUN pip install --no-deps toml==0.10.2
RUN pip install --no-deps toolz==0.12.0
RUN pip install --no-deps tqdm==4.65.0
RUN pip install --no-deps typing_extensions==4.5.0
RUN pip install --no-deps tzdata==2023.3
RUN pip install --no-deps urllib3==1.25.8
RUN pip install --no-deps Werkzeug==2.2.3
RUN pip install --no-deps wheel==0.40.0
RUN pip install --no-deps wrapt==1.14.1
RUN pip install --no-deps zipp==3.15.0
# Installing jax at the very end with GPU support.
# NOTE: Not using `no-deps` flag here because
# we need CUDA support.
RUN pip install jax[cuda11_cudnn82]==0.4.6 \
--find-links https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
ENV PYTHONPATH ./vit_jax
COPY ./model_oss/jax_vision_transformer/vit_jax2tf.py ./
COPY ./model_oss/jax_vision_transformer/vit_config_without_data.py vit_jax/configs/vit.py
ENTRYPOINT ["python", "vit_jax2tf.py"]
@@ -0,0 +1,149 @@
# This Dockerfile runs the JAX based Vision transformer training on GPU.
# See https://github.com/google-research/vision_transformer#running-on-cloud
# for more details.
# Here is an example to build this dockerfile:
# PROJECT="your gcp project"
# IMAGE_TAG="trainn_vit_gpu:${USER}-test"
# docker build -f model_oss/jax_vision_transformer/dockerfile/train_vit_gpu.Dockerfile . -t "${IMAGE_TAG}"
# docker tag "${IMAGE_TAG}" "gcr.io/${PROJECT}/${IMAGE_TAG}"
# docker push "gcr.io/${PROJECT}/${IMAGE_TAG}"
FROM tensorflow/tensorflow:2.12.0-gpu
ENV DEBIAN_FRONTEND=noninteractive
# Install basic libs
RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
curl \
wget \
sudo \
gnupg \
libsm6 \
libxext6 \
libxrender-dev \
lsb-release \
ca-certificates \
build-essential \
git
# Copy Apache license.
RUN wget https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/LICENSE
# Get 'vision_transformer' repository from github.
RUN git clone https://github.com/google-research/vision_transformer
# Ser current directory to the downloaded 'vision_transformer' repository.
WORKDIR ./vision_transformer
# Using git reset command to pin it down to a specific version.
RUN git reset --hard e66b4732d44504251197a3da3f5949f3f3ce9ca6
# Install required libs
RUN pip install --upgrade pip
# The following pip installs are pinned down versions of those inside
# vit_jax/requirements.txt file.
# NOTE: Using `no-deps` flag to avoid overwriting of
# dependent library versions. For example,
# both `chex` and `jax` can overwrite each others
# `jax-lib` version.
RUN pip install --no-deps absl-py==1.4.0
RUN pip install --no-deps aqtp==0.0.10
RUN pip install --no-deps array-record==0.2.0
RUN pip install --no-deps astunparse==1.6.3
RUN pip install --no-deps cached-property==1.5.2
RUN pip install --no-deps cachetools==5.3.0
RUN pip install --no-deps certifi==2019.11.28
RUN pip install --no-deps chardet==3.0.4
RUN pip install --no-deps chex==0.1.7
RUN pip install --no-deps click==8.1.3
RUN pip install --no-deps cloudpickle==2.2.1
RUN pip install --no-deps clu==0.0.9
RUN pip install --no-deps contextlib2==21.6.0
RUN pip install --no-deps dacite==1.8.1
RUN pip install --no-deps dbus-python==1.2.16
RUN pip install --no-deps decorator==5.1.1
RUN pip install --no-deps dm-tree==0.1.8
RUN pip install --no-deps einops==0.6.1
RUN pip install --no-deps etils==1.3.0
RUN pip install --no-deps flatbuffers==23.3.3
RUN pip install --no-deps flax==0.6.10
RUN pip install --no-deps git+https://github.com/google/flaxformer@9adaa4467cf17703949b9f537c3566b99de1b416
RUN pip install --no-deps gast==0.4.0
RUN pip install --no-deps google-auth==2.16.2
RUN pip install --no-deps google-auth-oauthlib==0.4.6
RUN pip install --no-deps google-pasta==0.2.0
RUN pip install --no-deps googleapis-common-protos==1.59.0
RUN pip install --no-deps grpcio==1.51.3
RUN pip install --no-deps h5py==3.8.0
RUN pip install --no-deps idna==2.8
RUN pip install --no-deps importlib-metadata==6.1.0
RUN pip install --no-deps importlib-resources==5.12.0
RUN pip install --no-deps keras==2.12.0
RUN pip install --no-deps libclang==16.0.0
RUN pip install --no-deps Markdown==3.4.3
RUN pip install --no-deps markdown-it-py==2.2.0
RUN pip install --no-deps MarkupSafe==2.1.2
RUN pip install --no-deps mdurl==0.1.2
RUN pip install --no-deps ml-collections==0.1.1
RUN pip install --no-deps msgpack==1.0.5
RUN pip install --no-deps nest-asyncio==1.5.6
RUN pip install --no-deps numpy==1.23.5
RUN pip install --no-deps oauthlib==3.2.2
RUN pip install --no-deps opt-einsum==3.3.0
RUN pip install --no-deps optax==0.1.5
RUN pip install --no-deps orbax-checkpoint==0.1.6
RUN pip install --no-deps packaging==23.0
RUN pip install --no-deps pandas==2.0.1
RUN pip install --no-deps pip==23.1.2
RUN pip install --no-deps promise==2.3
RUN pip install --no-deps protobuf==4.22.1
RUN pip install --no-deps psutil==5.9.5
RUN pip install --no-deps pyasn1==0.4.8
RUN pip install --no-deps pyasn1-modules==0.2.8
RUN pip install --no-deps Pygments==2.15.1
RUN pip install --no-deps PyGObject==3.36.0
RUN pip install --no-deps python-apt==2.0.1+ubuntu0.20.4.1
RUN pip install --no-deps python-dateutil==2.8.2
RUN pip install --no-deps pytz==2023.3
RUN pip install --no-deps PyYAML==6.0
RUN pip install --no-deps requests==2.22.0
RUN pip install --no-deps requests-oauthlib==1.3.1
RUN pip install --no-deps requests-unixsocket==0.2.0
RUN pip install --no-deps rich==13.3.5
RUN pip install --no-deps rsa==4.9
RUN pip install --no-deps scipy==1.10.1
RUN pip install --no-deps setuptools==67.6.0
RUN pip install --no-deps six==1.14.0
RUN pip install --no-deps tensorboard==2.12.0
RUN pip install --no-deps tensorboard-data-server==0.7.0
RUN pip install --no-deps tensorboard-plugin-wit==1.8.1
RUN pip install --no-deps tensorflow==2.12.0
RUN pip install --no-deps tensorflow-cpu==2.12.0
RUN pip install --no-deps tensorflow-datasets==4.9.2
RUN pip install --no-deps tensorflow-estimator==2.12.0
RUN pip install --no-deps tensorflow-hub==0.13.0
RUN pip install --no-deps tensorflow-io-gcs-filesystem==0.31.0
RUN pip install --no-deps tensorflow-metadata==1.13.1
RUN pip install --no-deps tensorflow-probability==0.20.0
RUN pip install --no-deps tensorflow-text==2.12.1
RUN pip install --no-deps tensorstore==0.1.36
RUN pip install --no-deps termcolor==2.2.0
RUN pip install --no-deps toml==0.10.2
RUN pip install --no-deps toolz==0.12.0
RUN pip install --no-deps tqdm==4.65.0
RUN pip install --no-deps typing_extensions==4.5.0
RUN pip install --no-deps tzdata==2023.3
RUN pip install --no-deps urllib3==1.25.8
RUN pip install --no-deps Werkzeug==2.2.3
RUN pip install --no-deps wheel==0.40.0
RUN pip install --no-deps wrapt==1.14.1
RUN pip install --no-deps zipp==3.15.0
# Installing jax at the very end with GPU support.
# NOTE: Not using `no-deps` flag here because
# we need CUDA support.
RUN pip install jax[cuda11_cudnn82]==0.4.6 \
--find-links https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
COPY ./model_oss/jax_vision_transformer/vit_config_without_data.py vit_jax/configs/vit.py
ENV PYTHONPATH ./vit_jax
ENTRYPOINT ["python", "-m", "vit_jax.main"]
@@ -0,0 +1,27 @@
"""Returns a config for a Vision Transformer model without asking for data."""
import ml_collections
from vit_jax.configs import common
from vit_jax.configs import models
def get_config(model: str) -> ml_collections.ConfigDict:
"""Returns default parameters for finetuning ViT `model`."""
config = common.get_config()
get_model_config = getattr(models, f'get_{model}_config')
config.model = get_model_config()
# These values are often overridden on the command line.
config.base_lr = 0.03
config.total_steps = 500
config.warmup_steps = 100
config.pp = ml_collections.ConfigDict()
config.pp.train = 'train'
config.pp.test = 'test'
config.pp.resize = 448
config.pp.crop = 384
# This value MUST be overridden on the command line.
config.dataset = ''
return config

Some files were not shown because too many files have changed in this diff Show More