Readit News logoReadit News
Posted by u/speedylight 3 years ago
Ask HN: What ML platform are you using?
I am interested to know what ML platforms you use for personal/hobbyist projects... Do you rent GPU instances from the likes of Azure, GCP, AWS or do you use managed solutions like Paperspace Gradient, or Colab? why or not?

I am very much a beginner in the space of machine learning and have been overwhelmed by the choices available. Eventually I do want to simply want to build my own rig and just train models on that, but I don't have that kind of money right now, nor is it easy to find GPUs even if could afford them.

So I am basically stuck to cloud solutions for now, which is why I want to hear personal experiences of HN folks who have used any of the available ML platforms. Their benefits, short comings, which are more beginner friendly, cost effective, etc

I am also not opposed to configuring environments myself rather than using managed solutions (such as Gradient) if it is more cost effective to do so, or affords better reliability // better than average resource availability... because I read some complaints that Colab has poor GPU availability since shared among subscribers, and that the more you use it the less time is allocated to you... not sure how big of a problem it actually is though.

I am very motivated to delve into this space (it's been on my mind a while) and I want to do it right, which is why I am asking for personal experiences on this forum given that there is a very healthy mix of technology hobbyists as well as professionals on HN, of which the opinion of both is equally valuable to me for different reasons.

Also please feel free to include any unsolicited advice such as learning resources, anecdotes, etc,

Thanks for reading until the end.

mdp2021 · 3 years ago
> I am very much a beginner in the space of machine learning

While the (precious and useful) advice around seem to cover mostly the bigger infrastructures, please note that

you can effectively do an important slice of machine learning work (study, personal research) with just a battery-efficiency-level CPU (not GPU), in the order of minutes, on a battery. That comes before going to "Big Data".

And there are lightweight tools: I am current enamoured with Genann («minimal, well-tested open-source library implementing feedfordward artificial neural networks (ANN) in C», by Lewis Van Winkle), a single C file of 400 lines compiling to a 40kb object, yet well sufficient to solve a number of the problems you may meet.

https://codeplea.com/genann // https://github.com/codeplea/genann

After all, is it a good idea to use tools that automate process optimization while you are learning the deal? Only partially. You should build - in general and even metaphorically - the legitimacy of your Python ops on a good C ground.

And: note that you can also build ANNs in R (and other math or stats environments). If needed or comfortable...

Also note - reminder - that the MIT lessons of Prof. Patrick Winston for the Artificial Intelligence course (classical AI with a few lessons on ANNs) are freely available. That covers the grounds before a climb into the newer techniques.

joconde · 3 years ago
Note that this won't work with reasonably performant CNNs. Passing an image batch through a large-ish ResNet takes half a second on our GPUs, several minutes at full load on CPU. This makes training infeasible, and most models small enough to work on CPU are so far from state-of-the-art that you can't do any worthwhile computer vision research with them.
mdp2021 · 3 years ago
Yes, but note on the other hand that simpler infrastructures such as one-digit-wide-GB GPUs you could buy and install on your workstation could be similarly frustrating, because you may easily encounter their limits (as in, "I got this semi-specialized equipment and I cannot get an output above 1024x768?!").

So, while one is learning, the case could be for being conservative and work directly on available tools, which will be revealing on some scalability requirements, also optimistically: you do not need a full lab to do (reasonable) linear regression, nor to train networks for OCR, largely not to get acquainted with the various techniques in the discipline.

When the needs push, it sometimes will not be just high-end consumer equipment to solve your problem, so on the side of hardware already some practical notion of actual constraints of scale will help orientation. Because you do not need a GPU for most pathfinding (nor for getting a decent grasp of the techniques I am aware of), and when you will want to produce new masterpieces from a Rembrandt "ROM construct"¹ (and much humbler projects) a GPU will not suffice.

(¹reprising the Dixie Flatline module in William Gibson's Neuromancer)

sillysaurusx · 3 years ago
Why start with vision? Do some language models. I used to train those all the time on my laptop.

GPT 5MB for the win. It really works.

mdp2021 · 3 years ago
...I am curious, now that I know about Fabrice Bellard's LibNC (bellard.org/libnc), if that «image batch through a large-ish ResNet» would be faster using this library - which can work on both CPU and CUDA...
37ef_ced3 · 3 years ago
Fast CPU transformers: https://bellard.org/libnc

Fast CPU convolutions: https://NN-512.com

Both are completely stand-alone (no external dependencies).

mdp2021 · 3 years ago
> Fast CPU transformers: https://bellard.org/libnc

And especially, from Fabrice Bellard (QEMU, FFMPEG...)

I do not know how you found it: it is not even in his site's index!

--

I see that NN-512 is a personal project of yours: congratulations! Though it seems to be a go-lang application that generates specialized C for convolutional NNs... Not a general purpose library, not for beginners.

cweill · 3 years ago
I worked in Google Research for over 5 years doing Machine Learning, and recently quit to build my own ML start-up. These days, I solve a mix of NLP, computer vision, and tabular problems, all with state of the art neural network techniques. I've tried many setups.

My advice is go with Colab Pro ($50/mo) and TensorFlow/Keras. You can go with Pytorch too if you prefer.

I made the mistake of buying a 2080Ti for my desktop thinking it would be better, but no. Consumer grade hardware is nowhere near as good/fast as the server grade hardware you get in Colab. Plus you have the option to use TPUs in Colab if you want to scale up quickly.

You really don't need to get fancy with this setup. The best part of using Colab is you can work on your laptop from anywhere, and never worry about your ML model hogging all your RAM (and swap) or compute and slowing your local machine down. Trust me, this sucks when it happens, and you have to restart!

As for your data, you can host it in a GCS bucket. For small data (<1TB) even better is Google drive (I know, crazy). Colab can mount your Google drive and loads from it extremely quickly. It's like having a remote filesystem, except with a handy UI and collaboration options, and an easy way to inspect and edit your data.

sillysaurusx · 3 years ago
(OP, please don’t subject yourself to TensorFlow/Keras. The moment Jax became available on TPUs publicly, the moment I stopped using TF. And boy oh boy, “never looked back” is an understatement. I still cringe remembering all the time I spent trying to get tf.function to just please, please work, like a housewife alarmed that neither her partner nor herself are able to actually work.)
m3at · 3 years ago
To support your point with data, here is a graph of usage of TF vs PyTorch in papers over time: https://horace.io/pytorch-vs-tensorflow/
mark_l_watson · 3 years ago
Great advice! BTW, your startup https://creatorml.com/ is very cool, what a creative idea.
cweill · 3 years ago
Thank you! Feel free to reach out to me on Twitter or Discord (linked on the homepage) if you want to chat.
apohn · 3 years ago
Note that Colab Pro is $10/month and Pro+ is $50/month.

The $10 is more than enough for learning Deep Learning.

cweill · 3 years ago
100% agreed. Start with the $10 plan. I forgot how much it cost for the middle tier. The one benefit of the higher tier is you get access to better GPUs, and can run multiple colabs in parallel effectively getting multiple accelerators at once if you're doing distributed hyperparameter tuning.
rewq4321 · 3 years ago
+1 and you can even connect your Colab to a GCP Marketplace Colab runtime that has no time limit (but will cost us) if you e.g. need to run something for a few days (although then you don't get the awesome Google drive mounting - hope they fix this eventually)
lumost · 3 years ago
Honestly, I've found that most ML tooling is overly complicated for most ML projects.

I use a paperspace VM + Parsec for personal ML projects. Whenever I've done the math an hourly rate on a standard VM w/GPU is better than purchasing a local machine and the complexity of a workflow management tool for ML just isn't worth it unless you are collaborating across many researchers. As an added bonus, you can re-use these VMs for any hobby gaming you might do.

The majority of ML methods train quickly on a single large modern GPU for typical academic datasets. The scaling beyond 1 GPU or 1 host leads to big model research. While big models are a hot field, this is where you would need large institutional support to do anything interesting. A model isn't big unless it's > 30 GB these days :)

Even in a typical industrial setting, you'll find the majority of scientists using various python scripts to train and preprocess data on a single server. Data wrangling is the main component which requires large compute clusters.

jdeaton · 3 years ago
I put together a linux box with a 2080ti a few years ago and have been using it consistently for personal ml research ever since. Ive found it well worth the investment and learned that the ease with which I can jump into hacking on a project is key, which is why this works so well for me. I can just ssh in at any time and start experimenting with models. Even if its not technically economical when you do the math, the ease, reliability and fact that I know my models arent being billed per hour helps encourage me to experiment often, which is kwy to learning.

As for software, I do everything with jax and tensorboard for viewing experiments. Jax is a phenomenal library for personal ml learning as its extremely flexible and has relatively low level composable abstractions.

anonymousDan · 3 years ago
What do you wrt CUDA and linux? I'm a linux person but every time I try and mess around with CUDA the whole thing gets super annoying. I don't want to have to reinstall everything every time there is a kernel upgrade . Maybe there is some trick with WSL2 now?
mark_l_watson · 3 years ago
I can’t speak to using WSL2 on Windows, but on my Linux System76 GPU laptop I get around CUDA configuration time sinks by not updating my configuration for long periods of time. I don’t mind spending setup time once every 6 months, but I don’t want to waste my time during it frequently. System76 has new container oriented CUDA setup that is OK, but I liked just setting everything up on my own, and then not modifying anything for as long as possible.
timzaman · 3 years ago
Get a decent NVIDIA GPU. Then install PyTorch and off you go. I advise to make all your own tooling, as you likely have a specific use-case, and so your tooling can be tailored to that. Most ML tools are very generic, or so simply you might as well do them yourself. The advantage if having your own box, is that (1) you'll learn some systems skills building it and (2) since you invested in it, you should feel obligated to use it! Good luck.
cyber_kinetist · 3 years ago
I would say the exact same thing if the circumstances weren’t so dire, but an NVIDIA GPU is so expensive nowadays that it might be a bit better to use rented services (like the paid version of Google Colab) for now, if you have any monetary constraints.

Maybe GPU prices will stabilize after Ethereum switches to POS and manufacturing pipelines get back to normal, but then I’m not that sure after seeing US trying to go ham with sanctions all over the place.

throwawaybbq1 · 3 years ago
I have a 3090 for serious (hobby) work and a 1070 from 4ish years back next to my bed. I think getting anything 1070 or better is good enough at the beginner level (training baby datasets/models from scratch such as MNIST/CIFAR, transfer learning the big models). I just don't understand the cost argument .. you can get this stuff used. Main thing is you need CUDA.

The 3090 machine gets about the same use as the 1070 in my case. While it is nice to have more GPU memory to have huge batches and train things faster, this is a quality of life improvement/bragging to be honest. Serious work in some sub-areas needs multi-GPUs or enterprise grade hardware (e.g. A100s).

Software-wise, I just use Pytorch/Pytorch lignting/keras, and anaconda.

Edit: I used to build my own machines in my younger days. The two machines I spoke of above are alienware. Got them on black friday sales. Cost-wise, they were ridiculously cheap for the power they give/impact on my career.

y42 · 3 years ago
You do not necessarily need a high performance GPU to step into ML. I'm running a couple of my hobby projects either on my notebook or an old discarded former Server hardware with onboard GPU.
dougSF70 · 3 years ago
+1 on that. I had a Mac Pro 5.1 that was surplus to requirements. Its 10 years old with 64GB of Ram and 2 x 6core processors. I stripped off the OS and installed Ubuntu along with an nVidia 750 - $100. For learning purposes and running hyper-parameter tuning it is pretty robust.
raffraffraff · 3 years ago
And you can run your own github/gitlab runner on the GPU box and set up CI in your projects. It's good practice (and good practise). And it's free. This unchains you from your PC so you can push code from anywhere and it'll crunch the numbers for you. You just need to install docker, run the runner and make sure you're using a runner container with the NVIDIA stuff installed and you pass through the GPU to the container.
mark_l_watson · 3 years ago
It is very different when you are paying for DL compute yourself, not as part of a job. I have mostly worked in DL for 7 years, but I also have your use case of running my own experiments and simply wanting to learn new things on my own time.

I am biased towards using Keras and I suggest you bookmark these curated examples https://keras.io/examples/

I bought an at home GPU rig 3 years ago and I regret that decision. As many other people here have mentioned Google Colab is a great resource and will save you so much time because you will not be setting up your infrastructure. Start with the free version and when you really need to, switch to Pro or Pro+.

For more flexibility, set up a GPU VPS instance that you can stop when not in use to save money. I like GCP and AWS, but I used to use Azure and that is also a great service. When a VPS is in a stopped state, you only pay a little money for storage. I will sometimes go weeks without starting up my GPU VPS to run an experiment. Stick with Colab when it is good enough for what you are doing.

Now for a little off topic tangent: be aware that most knowledge work is in the process of being automated. Don’t be disappointed if things you spend time learning get automated away. Look at the value of studying new tech as being very transitory, and you will always be in the mode you are in right now: a good desire to learn new things. Also, think of deep learning in the context of using it for paid work to solve real problems. As soon as you feel ready, start interviewing for an entry level deep learning or machine learning job.

crimsoneer · 3 years ago
Honestly, if you're a beginner in the machine learning space, you're not going to need GPUs for a LONG time, and would benefit from learning what's going on under the hood. Install Python on your machine, learn to structure your projects well, environments and requirements, etc. if and when you need more, figure it out then.
modeless · 3 years ago
I think Colab is very popular since it's free. Should be perfect for a beginner who doesn't want to spend money. I don't think there's a lot of lock-in so just try it and see. There are bigger questions to worry about, like should you use TensorFlow (no) or PyTorch (yes) or JAX (maybe). That's much harder to change later.