Live data from Hacker News

Microsoft Zero and DeepSpeed: Memory Efficient Large Neural Network Training

microsoft.com

1–10 of 21 posts

Re: Microsoft Zero and DeepSpeed: Memory Efficient Large Neural Network Training

#2
Even from the paper, it's hard to tell what this library actually does: Section 5 in https://arxiv.org/pdf/1910.02054.pdf

The paper talks about parameter partitioning and overlapped communication, but doesn't actually give many details on how those things happen.

The library appears to be an implementation of some common algos for solving the 'pebble game,' as explained decently here: https://medium.com/tensorflow/fitting-larger-networks-into-m...

The essential point is that:

(1) model parallelism is hard to do and has historically been done manually to scale wide models across GPUs

(2) inter-GPU I/O is expensive for vanilla data-parallel jobs (that typically use naive mirroring strategies)

(3) researchers have figured out now how to 'compile' a deep model so that layers span GPUs and save on both memory usage and I/O

(4) so scaling wide models is still hard, but now we have better tools for deep models

Existing all-reduce-based data-parallel problems have already been well-studied (see e.g. https://people.eecs.berkeley.edu/~jfc/papers/14/Kylix.pdf ), so it's really nice to see gains through new techniques.

Definitely like seeing this 'compilation' being wrapped up into a library. Just wish they did a better job of communicating key ideas.

Re: Microsoft Zero and DeepSpeed: Memory Efficient Large Neural Network Training

#4
I work in deep learning for 3D imaging, and memory has constantly been the primary bottleneck for our group. U-net for example tends to be fairly "chonky", and isn't really super great in terms of parameter efficiency (but it is nice when you need an out of the box network that just "works"...). This has led medical imaging to use a lot of "patching" and other sliding window sort of techniques to help get over this burden.

I tend to think that a lot of this is due to Facebook/Google/Etc being more interested in 2D picture images, and hasn't really put a ton of effort into developing approaches that are exponentially harder in terms of parameters. While I don't think I can comment on if parallelism is the future to solve (vs. single massive GPU memory chips vs. more efficient NN design vs. data compression techniques), I think this is where a lot of the bleeding technical edge will come from.

Re: Microsoft Zero and DeepSpeed: Memory Efficient Large Neural Network Training

#6
post #5

I'm from the DeepSpeed team, we're happy to answer questions if people have them.

This is great and looks very easy to use! I'd expect it to have a huge impact given how easy it makes for people to leverage a few or a few thousand GPUs. I do have a few questions, of course.

Is it getting a lot of internal use already (beyond the example we just heard about)?

Is it possible to do inference using a CPU and a lot of RAM using a model trained on multiple GPUs via DeepSpeed?

Does it work with TPUs right out of the box? It looks like maybe not - if not, any plans to support them?

Can you use DeepSpeed to train using a lot of CPUs + ram rather than GPUs?

Re: Microsoft Zero and DeepSpeed: Memory Efficient Large Neural Network Training

#7
Looks like what it does is similar to what Alex did a few years back with One Weird Trick paper: https://arxiv.org/abs/1404.5997

When attempting to train transformers, I do notice a lot of time spend on allreduce more than with CNN models, probably due the parameter sizes. OWT seems to be natural to exploit for this situation (a lot of GEMMs, lot time spent on allreduce).

Edit:

Read the paper. The implementation is much less tricky than OWT, but for a good reason probably. Language model's GEMMs are smaller, therefore, partition the model would have efficiency impact (smaller GEMM will be slower). This does require much better interconnects, which NVLink / infiniband conveniently provides, that is also not available on consumer grade hardware anywhere (2-way NVLink is not meaningful).

Re: Microsoft Zero and DeepSpeed: Memory Efficient Large Neural Network Training

#8
post #6
post #5

I'm from the DeepSpeed team, we're happy to answer questions if people have them.

This is great and looks very easy to use! I'd expect it to have a huge impact given how easy it makes for people to leverage a few or a few thousand GPUs. I do have a few questions, of course. Is it getting a lot of internal use already (beyond the example we just heard about)? Is it possible to do inference using a CPU and a lot of RAM using a model trained on multiple GPUs via DeepSpeed? Does it work with TPUs righ…

> Is it getting a lot of internal use already (beyond the example we just heard about)?

We have hundreds of internal users of DeepSpeed using it to train production ready models, many of which have been already shipped.

> Is it possible to do inference using a CPU and a lot of RAM using a model trained on multiple GPUs via DeepSpeed?

It is definitely possible to do inference on CPU using a model trained on multiple GPUs via DeepSpeed. For models trained without model parallelism, this is straight forward. The tricky part is if the model was trained using model parallelism, which would require merging checkpoints corresponding to different pieces of the model into a single one.

> Does it work with TPUs right out of the box? It looks like maybe not - if not, any plans to support them?

The ZeRO technology is compatible with TPU or any accelerator in a cluster setting, but we have not tested it with the TPUs. It likely would require some small refactoring to get DeepSpeed to work with TPUs. We do not have any internal plans to support them yet, but of course completely open to contribution from the community.

> Can you use DeepSpeed to train using a lot of CPUs + ram rather than GPUs?

It is possible to use DeepSpeed to train using a lot of CPUs. The major limitation of the approach is that CPUs can be an order of magnitude slower than GPUs in terms of computational performance.

Re: Microsoft Zero and DeepSpeed: Memory Efficient Large Neural Network Training

#10

Even from the paper, it's hard to tell what this library actually does: Section 5 in https://arxiv.org/pdf/1910.02054.pdf The paper talks about parameter partitioning and overlapped communication, but doesn't actually give many details on how those things happen. The library appears to be an implementation of some common algos for solving the 'pebble game,' as explained decently here: https://medium.com/tensorflow/fi…

We tried to communicate the key ideas in the video released with the blog post. It shows how DeepSpeed and the ZeRO optimizer save memory, and shows exactly what happens during each iteration of training. It is quite different from standard data or model parallelism.

The ZeRO optimizer helps scale large models regardless of the model topology. It works equally well for wide or deep models. Please let us know if you have specific questions that we can address.

Post reply on HN