accelerate icon indicating copy to clipboard operation
accelerate copied to clipboard

[Community Contributions] examples on distributed inference using 🤗 Accelerate

Open sayakpaul opened this issue 2 years ago • 11 comments

The inference/distributed directory houses examples on running distributed inference with accelerate:

  • Phi2 for language generation
  • Stable Diffusion for image generation

The strategy followed there is to load an entire model onto each GPU and sending chunks of a batch through each GPU’s model copy at a time. Synthetic data generation has become an essential toolkit for every ML Engineer. So, it'd be beneficial to extend these examples to include some more use cases:

  • Image captioning
  • Speech data generation

Some nice to haves:

  • Include artifact serialization as done in this
  • Keep the artifact serialization code under a thread to not block GPU execution

How can you help?

You could help us contribute an example on any of the above-mentioned use cases or you can come up with your own 🤗 Help us make the art of synthetic data generation scalable, easy, and accessible.

sayakpaul avatar Sep 04 '24 10:09 sayakpaul

For image recaptioning, I have a quick and dirty PoC here that assumes streaming from webdataset and uses multiprocessing from torch: https://gist.github.com/sayakpaul/dfb26d6562b62ba8c2f613dc912a28a8#file-generate_captions_multigpu-py. Would be nice to make it more efficient and leverage accelerate to make things cleaner and simpler.

sayakpaul avatar Sep 05 '24 02:09 sayakpaul

Hey @sayakpaul @muellerzr! If it is still actual, I am going to add one more example for Video captioning using LLaVA-NeXT-Video-7B-hf

VladOS95-cyber avatar Oct 18 '24 15:10 VladOS95-cyber

Of course it's up, that would be so cool! Cc: @a-r-r-o-w

sayakpaul avatar Oct 18 '24 15:10 sayakpaul

Hi! I'd like to add an image captioning example using BLIP-2. Is this still open for contributions?

GANESH-NADKARNI avatar May 07 '26 13:05 GANESH-NADKARNI

is it still open?

krishna2426 avatar Jun 14 '26 16:06 krishna2426

hey @muellerzr @sayakpaul ! Is it still open,if yes,i would like to work on it

Tweezky66 avatar Jun 27 '26 22:06 Tweezky66

Hi @sayakpaul @muellerzr! Is this still available for people to contribute? I want to create a distributed batch inference example script using Qwen2.5 or Whisper for audio or Gemma 2. Let me know if you have a model that would be most useful!

lokeshps321 avatar Jul 30 '26 16:07 lokeshps321

I'd like to take this one ([Community Contributions] examples on distributed inference ). I'll dig into the root cause and follow up with a PR shortly. (claiming via @LeonxLJX)

LeonxLJX avatar Sep 01 '26 10:09 LeonxLJX

I'd like to take this one ([Community Contributions] examples on distributed inference ). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)

LeonxLJX avatar Sep 01 '26 10:09 LeonxLJX

Hi! I'd like to add examples on distributed inference using Accelerate. Plan: write a tutorial with multi-GPU inference, include code and expected output. May I be assigned?

LeonxLJX avatar Sep 01 '26 10:09 LeonxLJX

Hi @sayakpaul and @muellerzr! Is this issue still active for contributions?

If so, I would love to contribute a distributed batch inference example script using Whisper for scalable speech data generation / audio transcription, or alternatively using Qwen2.5-VL / Gemma 2 if there's a specific multimodal/text model the team is prioritizing right now.

Let me know if either of these directions sounds good, and I'd be happy to open a PR!

mohamadar77 avatar Sep 09 '26 10:09 mohamadar77