TheNoise on stacked GPUs

TheNoise (lemonade-sdk/thenoise) loads one model on one card. We added --devices, which spreads one model over several cards, so models bigger than any single card run on the cards we have: three 16 GB Tesla P100s and a 12 GB RTX 2060 in one server. Pull request: lemonade-sdk/thenoise#116.

Cornelia B. Windiate, November 1875 illustration, not a reconstruction

A three-masted canal schooner lost with all hands on Lake Huron after freezing spray iced her down. Made with Klein 9B and Wan 2.2 14B on the stacked cards. The weather behind it: Storm Lab: Windiate 1875.

Five shots: the gale, the crew chipping ice, the iced schooner, her loss, the empty lake. 16 seconds, Wan 2.2 14B image-to-video on the stack (the loss is a first-to-last-frame clip, so it is abrupt). Ends: “In memory of all those who lived and died by the inland seas.”

Results

ModelWeightsCardsSpeedResult
Flux.2 Klein 4B4 GB2× P1001.91 s/step (one card 1.89)pixel-identical to one card
Flux.2 Klein 9B34 GB3× P100 + RTX 20608.6 s/step, 1024×576runs; fits no single card here
Wan 2.2 14B image-to-video40 GB3× P100 + RTX 2060~75 s/step, 832×480×33runs; fits no single card here
thenoise video --devices cuda:0,cuda:1,cuda:2,cuda:3 \ --place dit=split,dit_low=split,text_encoder=cpu \ --dit …high_noise_14B… --dit-low …low_noise_14B… --vae … --text-encoder … \ --image start.png --prompt "…" --width 832 --height 480 --frames 33 --steps 4

Wan 2.2 14B on four cards

Wan 2.2 14B image-to-video, split over 3× P100 + RTX 2060. 832×480, 33 frames.
Earlier: Wan 2.2 5B on one 16 GB card, the most that fit (640×352, upscaled for view).

Same image, one card or two

Klein 4B, same seed. Left on one P100, right split over two P100s (2.3 + 1.5 GiB). The two files are identical.

One P100
One P100
Two P100s
Split over two P100s
Klein 9B
Klein 9B on four cards (the model still misspells long words)

How it works

The DiT's blocks are dealt out to the cards in proportion to their free memory. A hook moves each block's inputs to its card; only the hidden state crosses between cards, and tensors every block reads are copied once per step. The text encoder can go whole on one card or on the CPU; it runs once per prompt. The rest of TheNoise keeps one primary card and does not know about the split.

Two fixes came with it, because our cards are older than TheNoise expects. Pascal cards (P100) now run with a CUDA 12.6 build of torch: kernels built only for newer cards are skipped on them, card by card. Attention on cards older than Ampere now uses torch's memory-efficient kernel; before, Wan 14B asked for 29 GB for one attention layer.

Forge stills on the P100: Klein 4B on a P100, the same shot on an RX 6700 XT (ROCm).