Here you're looking at 30+ second requests that take GBs of memory on average. Even the big cloud providers don't have a good out of the box solution that doesn't cost an arm and leg.
-
-
Replying to @deepwhitman
That's exactly what we found- it's soooo expensive. At the very least it pays to do a lot of research into optimization before you put something up.
1 reply 0 retweets 1 like -
Replying to @citnaj
I think the ideal solution would be a serverless one so you're not having a GPU humming all the time and in case you get a traffic spike you can spin up multiple nodes to handle it. I'm in the process of trying out Google AI Cloud Platform. Let's see if that works.
1 reply 2 retweets 1 like -
Replying to @deepwhitman @citnaj
One other learning I'll share is that the compute time increases close to exponentially for image size in my experience...so you can get away with higher traffic for something like DeOldify if you limit images to say 256px.
2 replies 0 retweets 1 like -
Replying to @deepwhitman
Yes very true. Nice thing about DeOldify is that you can get back as a result the same resolution image as you input while the model renders the colors with a much smaller version. Chroma-subsampling- unique advantage of doing colorization.
2 replies 0 retweets 1 like -
Replying to @citnaj
Oh and one other thing which may be obvious but I was too dumb to realize. You HAVE to have an asynchronous workflow. As in you can't have a user send a request, keep the request open while the server does its thing, and then send the colorized image back.
1 reply 0 retweets 1 like -
Replying to @deepwhitman @citnaj
This only works if you are going to have 1-3 concurrent users at a time and then your server gets F**ked.
1 reply 0 retweets 1 like -
Replying to @deepwhitman @citnaj
So you want to design queues where the request gets closed and the user is directed to a new page where the image will appear once it's done being processed. This way performance degradation only results in an increased queue time but not in your server exploding (happened to me)
1 reply 0 retweets 1 like -
Replying to @deepwhitman @citnaj
The advantage of queues is you can have priority queues, so paid users get first in line while free ones have an increased wait time yada yada
1 reply 0 retweets 1 like -
Replying to @deepwhitman @citnaj
And also manage size of servers...so maybe you do an image size check and if its less than 512 px you send it to a smaller server to save compute etc.
1 reply 0 retweets 1 like
This all sounds very sensible. Thanks for doing the hard learning for us! :)
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.