pytorch / ignite

High-level library to help with training and evaluating neural networks in PyTorch flexibly and transparently.
https://pytorch-ignite.ai
BSD 3-Clause "New" or "Revised" License
4.52k stars 615 forks source link

Event handler to "unlock" GCPs Vertex.AI hyperparameter tuning service #3023

Open St3V0Bay opened 1 year ago

St3V0Bay commented 1 year ago

Dear PyTorch team,

I have developed a custom event handler that would make ignite code (more specifically: MONAI code) accessible to hyperparamer tuning jobs in GCP Vertex AI. It is an Ignite-tified version of this Link. As you can see from the code in the link, the metrics are simply saved at a certain time, in a certain place with a certain syntax. Once this is possible the Vertex HPO orchestration kicks in. Input arguments are controlled via Vertex.AI custom training jobs and output model performance can be extracted from that output file written at the end of the training.

Why is this useful? With this handler Ignite code can be subject to "outsourced" hyperparameter screening with just adding this handler and a few lines of Vertex config files. I found the outsourcing of HPO to the cloud platform way easier than coding it myself.

If you want I can contribute my solution to the codebase via a PR. Just let me know. image003_obf image002_obf image001

vfdev-5 commented 1 year ago

@St3V0Bay looks great, thanks for posting!

If you want I can contribute my solution to the codebase via a PR. Just let me know.

Yes, this contribution is very welcome! Technically, we split the code as following:

I expect that we would need to install and use a python client for vertex ai, so most probably we can put the code into contrib module. Let me know if you need any guidance.

github-actions[bot] commented 1 year ago

Hey 👋, I've just created a thread for this issue on PyTorch-Ignite Discord where you can quickly talk to the community on the topic.

🤖 This comment was automatically posted by Discuss on Discord