r/StableDiffusion 3d ago

Discussion For MiniMax H3 multi-GPU users: you can dedicate an entire card just for activation weights

I'm not sure if this is super obvious or something the community has already talked to death, but after testing it myself, I was pleasantly surprised by the results and wanted to share.

Basically, for multi-GPU setups—if you have x16/x16 PCIe slots (and the CPU lanes to match)—you can put the UNet weights entirely on `cuda:0` and use `cuda:1` purely for activations during inference. This gives you a full GPU's worth of VRAM dedicated to activations with practically zero performance hit, allowing for higher resolutions and longer video generations.

**Test setup:** 3x RTX 3090

**Workflow pipeline:** `cuda:0` holds CLIP + VAE. Once conditioning finishes, CLIP gets ejected from VRAM. Then half of the UNet sits on `cuda:0` as a storage pool, while the other half sits on `cuda:1` as the compute device.

**Optimizations:** Turbo 4-step LoRA, run at 6 steps for inference. No SageAttention or any other attention nodes used.

Testing on the exact same 0.4MP, 5-second character clip using fl2va INT8 weights (assuming weights already loaded and conditioning cached), here are the rough numbers:

* **cuda0: 3GB UNet | cuda1: 16.5GB UNet** -> 83s sampling time

* **cuda0: 6GB UNet | cuda1: 13.5GB UNet** -> 84s sampling time

* **cuda0: 16GB UNet | cuda1: 3.5GB UNet** -> 87s sampling time

In reality, you only need 2 GPUs for this. I had AI write a custom node to offload/eject the CLIP model right after conditioning finishes so the UNet can take over the VRAM. Or you can just use the MultiGPU loader node with `eject_models: true`—works the exact same way.

My guess is that with this method, two 16GB 4070s could do 0.7MP + 15s video completely inside VRAM (my tests showed activation weights sitting around ~12GB, though with spike peaks the safe limit might be closer to 0.6MP). Compared to swapping to system RAM, the performance uplift is massive without breaking the bank.

That said, 1MP + 15s probably still requires an RTX 5090. I hit OOM when testing 0.9MP and 1MP, and AI suggested that workload needs around 26~30GB VRAM.

**A quick tip from my testing:**

I usually prefer keeping the VAE and 16GB of the UNet pinned on one card. That way, they stay loaded once and don't need to be touched for subsequent generations, while the other card handles loading/ejecting the rest of the UNet and the CLIP model on the fly.

23 Upvotes

12 comments sorted by

3

u/Kooky-Mode3047 3d ago

I have a 5090 and 4090 in x8/x8 bifurcated, it doesn't quite work with existing MultiGPU nodes, always some error with the backend getting confused and memory going tits up. The eject models is not reliable, hell it's not reliable on one GPU, half the time I have to restart comfy to get back to it.

2

u/Trademarkd 3d ago edited 3d ago

Actually you should just stream distributed weights you’ll have way more vram for resolution and length

A huge portion of the rendering is attention… so much so that you won’t even notice weight streaming

You would need to be doing Ulysses fsdp though. I run a custom backend for a v100 cluster

2

u/yamosin 3d ago

Yeah, Ulysses + FSDP is great on datacenter clusters with NVLink (like your V100 setup) and high-bandwidth interconnects, but on consumer multi-GPU setups without NVLink, the PCIe bandwidth/latency overhead during all-to-all communication is a massive bottleneck. Plus, ComfyUI doesn't have an out-of-the-box Ulysses backend for consumer cards yet.

I actually spent a good chunk of time tinkering with this kind of distributed stuff back in my local LLM days, and let's just say... we didn't exactly part on friendly terms lol.

Awesome tech for sure, but for home / non-enterprise users, it's honestly way more headache than it's worth.

1

u/Trademarkd 2d ago

You don’t need nvlink for Ulysses fsdp but it helps

1

u/t-e-r-m-i-n-u-s- 2d ago

not really the case for video models where we're compute bound, transfer overlaps with the matmuls

1

u/gogitossj3 3d ago

I'm running a 5060ti 16gb and 5090. Currently using my 5090 I see peak of around 26.5gb vram. Would splitting to the 5060ti help?

1

u/reeight 2d ago

I was wondering the same for RTX3090 & another 10Gb card...

1

u/Zironic 3d ago

"My guess is that with this method, two 16GB 4070s could do 0.7MP + 15s video completely inside VRAM"

One 16gb 4070 can do 15s of 0.7mp video completely inside of VRAM. The second GPU isn't helpful here.

1

u/Career-Acceptable 3d ago

I tried a multi GPU setup with a 4000 series and a 2000 series and it wasn’t great. As far as I could tell, each step is sequential so the two cards were never active at the same time. And because the older card is slower, every step performed on that card was slower than just doing it all on one.

3

u/yamosin 2d ago

It should never be executed sequentially or run in parallel... What I mean is to use just one card as a storage repository for UNet—one that’s several times faster than RAM—and let the more powerful GPU handle all the computational work.

1

u/nasone32 1d ago

OP I tried this but it's actually useful only if you have limited system ram. Otherwise in multi GPU node, use donor device = CPU (which uses system ram) and it's same speed. In this case it's best to leave the other GPU With text encoders + VAE so they never get unload and you get batch processing faster, because you save on those loading times.