Repository navigation
LTX-2.5 on 8 and 12 GB cards and in less host RAM - #75
Merged
Merged
Conversation
… 4 layers from pinned memory
ltx23_text_embeds() runs the connectors on a connectors-only pipeline (optionally from raw prompt_embeds), so Gemma, the connectors and the render pipeline never share host RAM. ltx23_load_pipeline(resident_from = "disk") keeps no host copy of the GPU-resident NF4 blocks and re-reads them from the artifact per render. pin = FALSE now also leaves staging buffers unpinned. ltx23_memory_profile() picks split_text and resident_from from available host RAM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LTX-2.5 on 8 and 12 GB cards, and in less host RAM.
Small cards
ltx23_load_pipeline(resident_gb = )keeps the leading NF4 blocks on the GPU and streams the rest from pinned host memory, one block per TorchScript call. Below 7 GB the text connectors stream too.load_gemma4_nf4(stream = TRUE)streams the Gemma 4 layers.ltx23_memory_profile()picksresident_gb = vram - 4below 14 GB andstream_textbelow 12 GB.Simulated with a ballast tensor on the 16 GB card, 768x512x121: 12 GB and 8 GB both render in ~84 s, the same as 16 GB.
Less host RAM
The one-process flow needs ~31 GB of host RAM (pinned staging plus Gemma 4). Two ways to need less:
ltx23_text_embeds(), free that, then load the render pipeline without connectors and passconnector_embeds.resident_from = "disk". The GPU-resident blocks keep no host copy and are re-read from the artifact each render (~1 GB/s through safetensors).pin = FALSEonltx23_load_pipelinenow also disables the staging pins. Freed pinned memory stays in torch's host cache, so a pipeline you plan to drop has to load unpinned.ltx23_memory_profile(host_ram_gb = )detects available RAM and returnssplit_text(below 32 GB) andresident_from("disk"below 22 GB).Measured under a 20 GB cgroup cap, 768x512x121, render 2:
The text phase peaks at 12.4 GB. Host and disk latents are bit-identical.
Not done
serve.Randrecommend("ltx")don't use the new profile fields yet.Tests
Full suite: 1611 passed, 0 failed. New tests cover disk-staging parity (exact output match across offload/onload), the host-RAM profile cases, and the loader and
ltx23_text_embedserrors.Version 0.2.2.18.