R
RunPod2mo ago
giustiro

Deploying MIGAN model to Serverless.

Hi, could someone recommend how to deploy the MIGAN model in a RunPod serverless wrapper? There are 2 areas where I need advice: Downloading the model Invoking the model from Python to expose it in the RunPod wrapper. I already have an implementation, but it is very bad and slow, when it should be very fast, as the model is very lightweight (<50MB) and even runs well on CPU. I'm taking this to Docker and from there, setting up the serverless environment in RunPod. What tips can you share to implement this model effectively? The model: https://github.com/Picsart-AI-Research/MI-GAN Thanks!
GitHub
GitHub - Picsart-AI-Research/MI-GAN: [ICCV 2023] MI-GAN: A Simple B...
[ICCV 2023] MI-GAN: A Simple Baseline for Image Inpainting on Mobile Devices - Picsart-AI-Research/MI-GAN
20 Replies
nerdylive
nerdylive2mo ago
read this
nerdylive
nerdylive2mo ago
GitHub
GitHub - Picsart-AI-Research/MI-GAN: [ICCV 2023] MI-GAN: A Simple B...
[ICCV 2023] MI-GAN: A Simple Baseline for Image Inpainting on Mobile Devices - Picsart-AI-Research/MI-GAN
giustiro
giustiro2mo ago
Hi, thanks for your anwser @nerdylive , would you mind to explain your pov? That's how already i've deployed on serverless, i mean, this is the work flow right now: -A job is fired. -The serverless worker starts running. -The container is up. -Inside the container, the iopaint API is mounted. -It looks for the Model weights (can't figure out how to persist them). -No Model present so it will download it. -There, the job params are passed to the iopaint API. -Iopaint process the request. -The response (in happy path) all way back until container and worker are released. How it should be done in my opinion: -A job is fired. -The serverless worker starts running. -The container is up. -MIGAN model is ready (no download required) and it *directly *process the job's req/params. -The response (in happy path) all way back until container and worker are released. In other words, I want to avoid to use iopaint wraper. I don't know much about python and the iopaint 'wraper' is a bit complex to me. If someone can help or advice I would be very gratefull! I can share snippets of code if needed of course
nerdylive
nerdylive2mo ago
Ask on iopaint? Im not really familiar with them so try exploring codes, docs So sorry can't help this further except if you got the code that accepts some kind of input and outputs Ill try to help implementing it on runpod for this migan model
flash-singh
flash-singh2mo ago
@giustiro bake the model into the container image
nerdylive
nerdylive2mo ago
yeah or put it on network storage
giustiro
giustiro2mo ago
Hi. thanks for your inputs, I've deployed a new docker version with updates. As I mentioned before, I had a working example, sometimes it was filing, but working anyways. Now I need some help, the exact same endpoint template, with new Docker tag (updated from 0.2.4 to 0.2.7) it is throwing a lot of logs and it always fails! There were no significant changes, only tried to place the model relative to the app & src folders, so the model is ready to use. please @nerdylive @flash-singh can you take a look? attaching the logs.
giustiro
giustiro2mo ago
Observations: #1 HTTPConnectionPool(host='0.0.0.0', port=5000): its expected to be there until the internal FastAPI builds. Then the retry mechanism will hit it with job parameters. I repeat, THIS WAS WORKING around a month ago. But there are a lot of other errors I haven't seen before, even the 0.0.0.0:5000/v1/api/inapint fails over and over. #2 When serving the docker locally (with extra arg --rp_serve_api, everything starts as expected and no strange logs are shown. #3 -Docker base image: runpod/base:0.6.2-cpu -python sdk: runpod==1.4.2
giustiro
giustiro2mo ago
here it is, the exact same container, running perfectly on my end.
No description
nerdylive
nerdylive2mo ago
Hey What kind of errors are you experiencing? Are you maybe seeing pods as serverless? Also which one are you using? I believe its serverless, please help me with posting the error you're experiencing ( full line )
giustiro
giustiro2mo ago
Hi, thanks for your time, sure, the logs is plenty of errors and tracebacks, please do check the logs i've shared, let my attach it once again. Please open it and you will clearly see what I'm telling you. In the other hand, when i ran the container locally, there is nothing but the expected messages from pythong indicating FastApi wrapers are up and running.
giustiro
giustiro2mo ago
And this is the serverless config
No description
nerdylive
nerdylive2mo ago
Hows your handler file ND dockerfile?
giustiro
giustiro2mo ago
I have good news, it looks like the amount of logs showed can be dismissed, because I've tried my original config and it worked fine in the runpod' serverless. So let me tweek some configs and will comment back my updates
nerdylive
nerdylive2mo ago
Alright great
Want results from more Discord servers?
Add your server