Ask HN: What ML platform are you using?

149 points by speedylight ↗ HN
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.

83 comments

[ 3.9 ms ] story [ 136 ms ] thread
What do you want to train and why?
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.
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.

We use Kubeflow at our shop. If you use a managed K8s offering, it’s quite simple to manage, and of course you can deploy all your other stuff alongside it using the same tool stack.
Colab (Pro+?) should be enough until you decide to spend 500$/mo.
I like Colab for the most part since I'm biased towards Python, but being centered around Jupyter notebooks does have its shortcomings. Also, despite being a service offered by Google, I prefer PyTorch over Tensorflow.

For smaller projects, I generally find a Towhee pipeline (https://towhee.io/pipelines) that I then fine-tune on my 3080.

> I am also not opposed to configuring environments myself rather than using managed solutions

vast.ai has pretty low prices and gives you remote ssh into a GPU instance that you then have root on (albeit containerized).

Having a local GPU is effectively a requirement for doing "development" work (e.g. getting an architecture and/or codebase to the point where you would even be able to start training). Unfortunately, getting your own GPU is just absurdly expensive these days and probably not worth it. In the meantime, colab/kaggle/paperspace can be _okay_ as dev environments. Unfortunately, renting compute on vast.ai all day just to do occasional dev work gets expensive pretty quickly.

For something in-between vast.ai and AWS, datacrunch.io has slightly higher prices, with remote SSH into a server and a few more "niceties" that you get with a traditional cloud such as CPU instances and the ability to use those to pre-load data onto disk.

If and when you are able to get a GPU - just make sure to get nvidia as they have a stranglehold over the industry. The RTX cards are great - I've been doing tons of multimodal work on an RTX 2070 I bought pre-pandemic for around 350$. It only has 8 GiB of vram but is actually quite similar to a server-style V100 otherwise. I assume it probably costs like 2000$ these days.

If you're interested in the realm of running inference/training on giant models (say GPT-J 20B), you may find yourself in lack of VRAM. Using libraries like deepspeed, you can split the work across multiple GPU's. I highly recommend investing time to learning multi-GPU libraries or framework-provided features like pytorch's distributed data parallel as the size of models becomes a limiting factor very quickly in the case of transformers. A sibling comment mentions that you will need institutional support for training such models. This may be true, unfortunately. All I will say is that if you are even mildly competent, the demand for that type of work is increasing a lot lately.

Oh and yes, there is a new-ish site called replicate that I have been using to allow people to run inference on models that I've trained https://replicate.com/ without needing to be a coder. A lot of people use colab for this but that platform is annoying to support in practice.

I have been using Google Colab and AWS for 'big' personal projects while I use my PC to train light models. Colab is neat because it's free and I like the style of their notebooks. However, you cannot always find available GPU and I wouldn't recommend free Colab for anything else than learning and experimenting with ML. I have been using AWS Ubuntu server set up with PyTorch and had OK experience, but you need to be careful about pricing and set up policies, as well as remember to turn off your machines when you're not working on them if you don't want your credit card to blow up. In the future, I might give Google Colab Pro a try, but most of the work now I do on the company's server.

Anecdote: When I was taking the 'Computing For Data Science' class, we had a task to learn to use AWS tools like SageMaker, NLP bot or DeepRacer and present it in the class. The professor was also new to the whole AWS ecosystem. He opened many instances and left them running for a week which ended up taking 1000$ from bank account.. (Moral of the story: don't use aws with the card where all your money is)

Personally I stick with the classic SMLNJ
This made me smile
Every single time I see someone say “ML” I read it as meta language
You can run on-demand training jobs on GCP vertex ai training. I'm not sure the price point but it's pretty useful both for development and training.
Are you just interested in the training part and managing the trained models, or you'd actually like to productionize the models and serve them at scale?

A lot of end-to-end platforms are available nowadays that try to cover the entire lifecycle of a model from data prep, ETL, to training, serving, monitoring, operating. However, I found none of them really robust enough to cover all these cases perfectly, so I resorted to using different pieces from different vendors combined with my own stuff to make the entire platform suit my needs. This is still not perfect, though, and I think there's a lot of room for improvement in the space to enable really easy to use and scalable MLOps.

Still some of the tools I found to be ok: TensorFlow TFX, Kubeflow (to some extent - ops are a nightmare), Feast, MLFlow, GCP Vertex and AWS Sagemaker can get some work done, too.

I'd say for the foreseeable future I simply want to focus training and running trained models, I don't plan to do anything at scale like launch a business, so the creating and training aspect is the one I want and probably should only focus on at first either way.

But I like your approach of stitching together various vendors so they fit your use case, I think it can be really flexible but also probably more expensive and slightly harder to manage... I think it can be worth the tradeoff though.

Thank you for the input!

You make a good point there. Personally I’ve struggled quite a bit moving from one off models to taking them to production. Would you mind elaborating on what you mean by none of the platforms being robust enough?
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.
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.
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.
+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.
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.

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.

The problem is that even a 1070 is ridiculously expensive these days (About $400 on Newegg, that was the cost of a RTX 2070 a few years ago!) If you can get an used GPU from a friend that would be great, but other than that you’re going to have to shell hundreds of dollars for an old GPU that you will probably have to upgrade soon.

I don’t know the OP’s financial situation, but if you’re a poor student than these things certainly matter.

Good points .. however, my advice for the cash strapped students on HN: Buying 1 good machine will last you 4+ years easily these days. Buying a system like Alienware with a 3070-3080 was under 2K Canadian over the recent Black Friday shopping event. Over 4 years, that is $500. If you are studying CS, it is absolutely worth buying a decent machine. You don't need a top of the line machine but you need to be able to study your craft on something more powerful than a rasperry pi or junky old machine.

I was quite poor growing up, and I recall buying a 3K machine when I started undergrad (that was crap hardware by today's standard). And i have no doubt that having this machine helped me get my first job, and things got better from then. If you are in CS, think of it as an investment, and make it pay off!

Btw, I am trying to be positive .. pls don't construe anything here as negative. I appreciate that money is tight for a lot of folks. Paying 10% interest to buy a 3K machine is not a good idea!! I just skimped a lot as a student, and some of it was quite pointless. I wish someone explained this to me, and hence my comment.

If you are in a situation where you'd have to take a loan to buy a system, pls don't feel like you need a GPU to do anything useful. I am certain one can make do with just colab and a web browser. Good luck to all the students out there!! Life is hard at that stage .. it gets far easier once you have a paying job in the field.

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.

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?
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.
Thr best option for you is- Gradient Paperspace and Colab. Both are free and managed.

Learn Machine Learning first. Do not spend time on managing infra for ML while you are learning ML. Focus on learning ML first.

You can make decent cutting edge models and SOTA classic models just with free options. I am saying this because I have done this.

I suggest that you get Colab Pro after that.

AWS burns a hole on your pocket, and you should not spend money on that now. Although, AWS SageMaker is pretty tension-free experience.

I personally use GCP. I like the tooling around it to be the most convenient.

I suggest you learn the basics first. Learn classic ML, CNNs, RNNs, LSTM, Transformers, learn the necessary Maths, and even GANs if you are inclined.

If done in the right way, it will take you a 5/6 months to 18/20 months, depending on your time commitment, your current levels of grasp on programming and Math.

Do not rush or hurry.

When you reach that point, you can think of spending serious money for Deep Learning projects.

A few months back, I have gotten into TPUs, and these are fantastic. And GCP is my only option for these. I have only used TPUs for learning and personal project and never for work. I intend to keep it that way for a while.

can you please be specific on "necessary Math"? trying to apply pareto principle and cut down amount of time needed to brush up what seemingly all of lower division math courses.
Not the parent but I would say you just need a little of statistics and a little of calculus and linear algebra. If you are interested in theory then you need more.

For statistics I would recommend "All of Statistics".

The level of calculus required is to know to differentiate.

Algebra is more important. Any introductory linear algebra book would do. If you are able to multiply matrices and solve equations you can postpone a topic until necessary like for example eigenvectors or matrix factorization.

My advice is to first jump into the pool and learn swimming as needed. But learn swimming, use the concrete problems to motivate yourself.

My suggestion is to learn just high school amount of Differential Calculus, Linear Algebra. That much Statistics is not needed.

And do these the right way- forget about being able to prove stuff for test, or remembering the heuristics for solving problems in tests, or being able to pick the correct option from many in test.

Just forget how you studied for test. Learn limited things- very very deeply.

Learn why and how exactly each thing works. Each and every part.

The resources for these are-

1. Mathematics for Machine Learning: Linear Algebra (Coursera, Imperial)

2. - do - : Calculus

3. Essence of Linear Algebra Playlist: 3blue1brown

4. Essence of Calculus Playlist, Ibid

5. Khan Academy Statistics Playlist for High School

Again, understand each and every part very deeply.

This much Math is enough to get started with Machine Learning.

(You will need much much, much more if you want to be a Research Engineer or an Assistant Professor doing active research.

But you can chart your own path after a while.)

Then you start doing ML.

Then you learn whatever math is needed along the way.

Never, ever load your head with a bunch of math concepts just to "prepare" yourself for studying ML. I, very highly advise against it.

So,

Learn very basic stuff, but make the concepts crystally clear -> start doing ML -> learn more math as you face the need.

Learning math is a noble and worthy goal. But do not confuse it with "learning math so that I can study ML".

Two things I forgot to mention.

If you want to see what the curriculum of a "Math for ML" from a top research uni looks like, you should check out the website of Math for ML course offered by Universitat Tubingen [0]. If you know those, you will be able to read the math of most papers that you will come across.

Secondly, the best way to get started with ML is to do the Andrew Ng classic on Coursera. Then move on to FastAI [1]. Fastai is a fantastic learning resource and you will learn many nice things from Jeremy Howard that will help you make your own models. But do NOT limit yourself with fastai. It's a crappy software- too many limitation, syn sugars, API anti patterns, etc.

Learn PyTorch for full-fledged projects.

[0]: https://www.tml.cs.uni-tuebingen.de/teaching/2020_maths_for_...

[1]: https://fast.ai

I recommend to use Colab for learning because so many research papers publish their own examples as a Colab link nowadays, so you'll have plenty of stuff to try out and explore.

For the actual deployment in production, the only thing that's really affordable is if you send your own GPU workstations to a colocation hosting company. But that's a lot of work.

I created something that lets you get free GPU on VS Code with Google Colab with just 1-click. Have a look at https://github.com/DerekChia/colab-vscode

This is my default go-to as a poor man ML setup, with environment and dependencies set up automatically via bash script on start up.

For learning (and for development on most projects, until it actually comes time to train the real model) the K80 or whatever the lower tier is on colab is fine as a gpu.

The problem with colab IMO is that if it's your main platform, you'll be pushed to use notebooks for everything which is not really a good practice. Whatever you use, I'd suggest focusing on building a real train.py script (I'm assuming you'll be using python) that takes command line arguments for the hyperparameters. Don't get sloppy and just have things run as a bunch of cells.

If you are learning, my unsolicited advice is don't use built in datasets, make sure you can write datasets / dataloaders yourself so you understand what is going on and can adapt to your own work. All the stock examples using built in mnist or whatever gloss over the most important parts of setting up the data

> All the stock examples using built in mnist or whatever gloss over the most important parts of setting up the data

Could you elaborate on this / provide a link to a tutorial explaining what’s going on?

I want to add to your advice: not all of your code has to live in Colab. If you create a public repo on GitHub, then on Colab you can simply do a pip install using the git URI for your repo. Your GitHub repo will need to be setup as a proper Python library, but there are many simple examples you can find on the web.

I find this technique to be particularly useful since the same GitHub based libraries that I use on Colab I sometimes also use from Common Lisp locally on my laptop using py4cl.

I have been working last 1.5 years on my master thesis and I my setup evolved Colab -> Kaggle -> Azure ML.

Colab you is great for diving into examples that are already premade for colab.

Kaggle is better in my opinion in dataset handling, you can import public or upload your dataset with ease. They give you 30+ gpu hours for a week with ability to train your models in background. This can’t be done in Colab.

ML Azure platform is next level when you can pay for it. I’ve got credits from school. You can start experiments from python sdk with your own configurations, setup python environments, upload datasets, etc.

Working with a large well known tech company, with surprisingly basic/non-existent ML until only very recently.

Using Redshift to do a lot of the heavy lifting and initial data preparation, then SageMaker for hosting models and scoring, and Tableau for dashboards.

While you can do training within SageMaker, we have a cluster of EC2 instances using H2O libraries (xgboost) to train, then wrap the resulting model as a docker image and deploy it to ECR and link to a SageMaker endpoint.

Clunky and very much human-in-the-loop for training and deployment, but you can't run before you can crawl in this space.

I found Redshift to be far inferior to Snowflake as a data warehouse for marshalling any tables or views you need for ML work. There's lots of statistical functions available within Snowflake that will speed things up for you if you need pre-calculations on feature sets.
colab or rapidminer.

both of them work great for scratch projects.

I haven't experienced any real issues with GPU availability on Colab, I suggest that you just go ahead and use it and wait with the premature optimization until you actually hit a wall and need it.

For general advice focused on beginners and ESPECIALLY practical, cheap and efficient methods and hacks to do DL, I recommend searching in https://www.fast.ai/ and their forums https://forums.fast.ai/

I'll try to search inside fast.ai if there is a more specific link to give. I know that one of their chief pieces of advice has been to use Colab and take advantage of the 300$ free credit you get (per credit card) when signing up to Google Cloud, which you can use for DL.

Disclaimer - I'm one of the creators of DagsHub, we created the platform especially to help people like you with the difficulties of managing things like data and model versioning, experiment tracking, labeling, etc. we'd love to have you onboard, and thanks for reading until the end :)

Try it out on a local Linux machine first, if you have one. There are plenty of ML techniques outside of neural networks which train perfectly well on a CPU, so I'd start there.

Look at some kind of AutoML framework like AutoGluon, then dive deeper on the components it uses once you've got through the initial setup process. AutoGluon will let you train some basic models with all the data cleaning and normalisation steps handled for you.

> 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.

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.
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)

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.

...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...
Fast CPU transformers: https://bellard.org/libnc

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

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

> 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.

FWIW this is the first link on the index page: https://bellard.org/nncp/ which mentions libnc as its underlying ML library.
(Yes, well, NNCP is an attempt to perform lossless data compression through ANN - which is quite interesting, and of definite theoretic interest, though yet not practical in its more defined purpose e.g. because of speed, hence presumably power efficiency. The other is the invention of water.

It is like "Let me show you my new idea for a cupboard..." - ok, nice! - "...I created through a new lightweight portable all-purpose "Fabrice Bellard"-quality Swiss army knife for automation that operates on any material and that you may use if you want" - YES!? REALLY?... Metaphors do not come close.

This, LibNC, is an Artificial Intelligence engine signed Fabrice Bellard, in low level implementation... It's a "revolution".)