docs: add VRAM requirements + note SDPA attention dispatch gap - #45
Open
moduvoice wants to merge 1 commit into
Open
docs: add VRAM requirements + note SDPA attention dispatch gap#45moduvoice wants to merge 1 commit into
moduvoice wants to merge 1 commit into
Conversation
Adds a missing Hardware Requirements section (checkpoint download size, peak VRAM, RTF measured on a real Tesla T4 16GB), documents that custom lyrics currently require the full preprocess pipeline since cli.inference has no --lyrics/--text flag, and notes a measured attention backend config/reality mismatch (config reports "sdpa" but all 22 layers run eager LlamaAttention) worth fixing separately.
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.
Motivation
While verifying this project's inference pipeline on a real NVIDIA Tesla T4 (16GB, Turing/sm_75 — a
common budget/free-tier GPU, e.g. Google Colab's free tier), I found some hardware-specific
behavior and a documentation gap that aren't currently covered. This PR adds that documentation
only — no code or behavior changes.
Changes
model.pt+model-svc.pt= 5.61GB; separate Preprocess bundle 6.92GB), measured peak inference VRAM (1.6–2.7GB), and measured real-time factor (RTF ≈ 0.66) — both SVS and SVC comfortably fit a 16GB T4.cli.inferencehas no--lyrics/--textargument — it only accepts pre-built, frame-aligned metadata JSON via--prompt_metadata_path/--target_metadata_path, so synthesizing custom lyrics currently requires running the full preprocess pipeline (vocal separation + ASR + MIDI transcription, ~6.92GB extra checkpoints) first.DiffLlama's top-levelconfig._attn_implementationreports"sdpa", but all 22 transformer layers actually instantiate eagerLlamaAttentionat runtime (each layer builds its ownLlamaConfig(...)insoulxsinger/models/modules/llama.py, which never passes throughPreTrainedModel._autoset_attn_implementation(), so it silently falls back to the"eager"class default). Forcing the same weights through real SDPA (self_attn.__class__swapped toLlamaSdpaAttention, no weight/architecture change) measured 2.31x faster inference and ~40% lower peak VRAM with no measurable output-quality regression. This looks unintentional and may be worth fixing in the attention dispatch code — flagging it here as a candidate issue/PR rather than fixing it in this docs-only change.Testing
model.pt2,818,092,278 bytes,model-svc.pt2,793,965,154 bytes; Preprocess bundle 6,917,669,445 bytes across 8 files).bash example/infer.shverbatim (fp16,n_steps=32,cfg=3,control=score): 51.24s of audio synthesized in 33.77s wall time (RTF ≈ 0.659).self_attn.__class__.__name__across all 22 layers isLlamaAttention, notLlamaSdpaAttention, despiteconfig._attn_implementation == "sdpa"— and (2) a controlled before/after benchmark (2 runs each,torch.cuda.synchronize()timing +torch.cuda.max_memory_allocated()): eager 34.05s/34.61s (avg 34.33s, peak VRAM 2.71GB) vs. SDPA-patched 14.81s/14.92s (avg 14.87s, peak VRAM 1.63GB) — 2.31x speedup, ~40% VRAM reduction, output magnitude within normal run-to-run variance.