-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How Much Does it Cost? 💸 😬 #98
Comments
Not sure to understand these costs: Fly.io pricing).
|
@ndrean the models are not pruned with the VM every time the app is started (it was a misconception that was fixed in #82). Currently, the models are being saved in the volume and they are not re-downloaded every time it restarts. You can see it in the logs, actually:
The problem is that models take up a fair amount of space ( However, the cost is definitely bigger with the RAM usage. There's no way around this, as it's used to run inference on the images being uploaded. Although GPUs are much better at this, the costs are severely higher. @nelsonic unfortunately there's no way around this. There's been people using the application, which is great. But, as with any LLM/ML-based application, it's hard to make it in any free-tier cloud solution without putting the money in. The app has already been optimized to reduce costs (inbound/outbound data reduced with persistent storages, reducing file limit of images by optimizing it before feeding into the model, reducing Hz of audio file on the client-side before feeding it into the model). Unfortunately, we have to pull the plug. With increased activity, this "hobbyist" project sucks money (even more so when they're stopped, as shown in your image). I'd love to have this online for any person to check it out. But it's not feasible :( I'm going to shut down the machine now. |
@LuchoTurtle I admit I don't understand the Fly.io docs ....🤔 |
@ndrean the documentation are correct. The application's filesystem is wiped whenever they restart. That's why they offer volumes to place persistent data (data we want to keep in-between restarts). Currently, the models are inside one of these volumes, hence why they don't need to be downloaded. What #82 did was fix the path of the volume inside Fly.io, which was previously incorrect. |
I've deleted the machine. We can spawn a new one whenever we want to. |
I don't think they differentiate it on the billing page, unfortunately. According to https://fly.io/docs/about/billing/#machine-billing:
So they bill based on the preset per second it is used + any additional RAM we specify. Because the machine wasn't always being used, we didn't pay the 124 dollars that you showed in the picture. |
@LuchoTurtle didn't want you to |
@LuchoTurtle quick question: (though probably a rabbit hole…)
A. Person uploads the image to AWS S3
This would mean that our only marginal cost would be electricity and no surprise bills when it gets to the top of HN. asking cause if we could put together a decent machine for This could serve our needs quite well and we could run other models on it without ever having to worry about boot times etc. Thoughts? 💭 |
Though we probably have to spend a decent chunk on the GPU ... We will use it for a few tasks so I think it's worth investigating. 💭 |
Currently, this project targets the CPU (by default, since running on GPU entails having specific drivers according to the hardware). Regarding which GPU to choose, I can't really provide an informed decision. I know vRAM is quite important. Of course, I'm not expecting you to get a H100, that's wayyy too overkill. But it seems that the 3090 seems like a good compromise and a performance-to-cost ratio. I'd hold on purchasing anything yet, though. It needs to be confirmed that inference can be run on the GPU with Bumblebee before making any purchases that can be rather costly :) |
Ok. Thanks for your reply. Seems like this will require some further thought. What do we need to do next? 💭 |
I'd need to check running locally on the GPU to see if it works. Since I've a 1080, it's CUDA, so it should work with a 3090, theoretically. I just need to know it actually uses the GPU first :) |
https://blog.themvp.in/hardware-requirements-for-machine-learning/ Used - like new - the This is certainly more than we were spending on Fly.io but if it means we can do more with Machine Learning with a baseline load I think it's worth it. 💭 |
My 2ç input. If Whisper (Speech-to-Text) is the sink or bottleneck, can a cloud service be considered? Did not see figures on pricing. |
@ndrean your insight is always welcome. ❤️ We want to be 100% certain that an image we classify is not being used for any other purpose. Same goes for voice recordings. Ref: dwyl/video#91 |
Fair point. If you open your machine and offer such a service, how do you guarantee the user's privacy? I mean, you store images on S3 - publicly available - and run a local database. |
It really depends on if we want to make the service public or just for people using our App. For people using our App they know we aren’t using their images for “training” and also won’t leak them. But we don’t have advanced access controls on images yet beyond restricting access to just the person that uploaded them. |
If you use the app as such, all images are saved altogether in your public bucket, and the corresponding URL is saved in a database, meaning a semantic search can deliver any image approximating your query, yours or not. A simple login and the addition of the user_id in the image schema can overcome images from becoming publicly available, at least through the semantic search. But when you receive a response, you receive an URL to display the image. Doesn't the URL display the bucket origin name? Since the bucket is public, can't you exploit this?
Instead of an S3 URL, you use a path on the Filesystem. If you erase the uploaded paths after a search, you can run a search only once. |
Predictably, someone has already setup a biz around renting GPU time: https://www.gpudeploy.com/connect |
@LuchoTurtle did you re-enable this App? We just got a invoice for 💸 🔥 |
@LuchoTurtle If you're not applying for "AI Jobs" and needing to showcase this classifier App, |
Why on earth are we using this many resources for a non-production DB?! 😮 |
@nelsonic I did not do any modifications to the app (you can check the activity logs on Checking the logs of the
Should I stop these machines? https://fly.io/apps/imgai-db/machines Maybe they're the culprit. I'm stopping them, just in case. The DB is now stopped. |
But if we are just holding the data in the |
Probably not, but I haven't made any modifications to the My fear is that maybe we're having costs with the volumes? https://fly.io/docs/about/billing/#volume-billing But we're only using So they should fall under the |
Indeed. "haven't made any modifications". To be clear: the So the change that was made in May simply wasn't enough for us to avoid these silly high bills! But it's there and we're spending more money on an App that nobody is using than all our other apps combined! Please just scale down the
🤦♂️Part of being a "Senior" engineer is taking responsibility for your actions. Like spending the company's money. Apologies if this comes across as "harsh", but most |
The amount of time I'd take to respond to this properly is definitely not worth it given my backlog of tasks. I'll let the comments about optimizations regarding this topic, issues, commits, the README.md's and related asked questions (e.g. https://community.fly.io/t/build-failed-with-elixir-bumblebee/15779/4) speak for themselves :)
I digress. To reduce costs:
This volume has 2GB but only around
With all of the above in mind, I initially shut down the machines because it's where the higher cost was. The steps that I made addressed the extra computing power and paying for extra provisioned volume. A single node with Now there should be no charge per month. |
And the winners are cloud service providers, and GPU companies more recently. |
As noted by @LuchoTurtle in #97 (comment) 💬
This "hobby" app is costing us considerably more money than we originally expected. 📈
The most recent invoice on Fly.io was
$48.61
for Mar 1 - Apr 1, 2024 https://fly.io/dashboard/dwyl-img-class/billingThe current month (April 2024) Amount Due is already
$14.34
and we're only on the 4th!!If we extrapolate the total will be
7.5 x ($14.34 - $5) + $5 = $75
💸 🔥This is already more than we spend on our Internet & Phone bill ... 🤯
If the cost could be kept to $10/month it would be fine. 👌
Todo
I'm keen to keep this app available for people to test without having to run it on
localhost
. 💻But if the casual visitor is costing us this kind of cash, imagine if this got to the top of
HN
! 😬The text was updated successfully, but these errors were encountered: