[docs] DGX Spark (GB10) performance & tuning guide + reproduction examples - #1631
Merged
SolitaryThinker merged 5 commits intoAug 6, 2026
Merged
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Contributor
Merge Protections🔴 1 of 1 protections blocking · waiting on 👀 reviews and 🤖 CI
🔴 PR merge requirementsWaiting for
This rule is failing.
|
Contributor
Pre-commit checks failedHi @Mister-Raggs, the pre-commit checks have failed. To fix them locally: # Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install
# Run all checks and auto-fix what's possible
pre-commit run --all-filesCommon fixes:
After fixing, commit and push the changes. The checks will re-run automatically. For future commits, |
…mples Add a performance/tuning guide for the DGX Spark that picks up where the install guide leaves off: which models are practical on the GB10, what actually makes them faster (distilled few-step models, bf16 VAE decode), and what gives little or nothing on this unified-memory hardware (building FlashAttention, torch.compile of the VAE, linear quantization on long-sequence models) with the reasons why. - docs/getting_started/installation/spark_performance.md: new guide, incl. a "what helps vs what doesn't" matrix and the opt-in FP4 attention path. - examples/inference/optimizations/spark_benchmark.py: reproduces the headline claims (few-step median timing + fp32-vs-bf16 decode A/B), in-process. - examples/inference/optimizations/qad_fp4_ab.py: FP4 attention quality/speed A/B on the QAD checkpoint (one arm per process). - Cross-links from installation.md, spark.md, and optimizations.md.
…he benchmark - spark_performance.md: "Memory: one unified 128 GB pool" section (nvidia-smi N/A, torch reserved as the real footprint, decode buffers as the pressure) and a GB10-specific "Gotchas" section. - spark_benchmark.py: report peak GPU memory (torch reserved) + unified pool free/total alongside the timing.
Verified on a DGX Spark (GB10, torch 2.12.0+cu130, transformers 5.14.0): - few-step FastWan gen ~40 s (was ~30 s); ~18x vs full-step - bf16 VAE decode 1.14x, MS-SSIM 0.9999 (was ~1.2-1.3x); ~5-7% e2e - Wan2.1-1.3B few-step peaks at ~8.4 GB (measured via pipeline peak_memory_mb) - spark_benchmark.py reads peak_memory_mb from the result (worker-measured) instead of the main-process torch allocator (which reads ~0)
… around code blocks) Reword the "weights + activations + KV" line so the wrapped "+ KV" isn't misread as a list marker (the auto-fix would corrupt it to "- KV"), and add the blank lines PyMarkdown wants around a fenced code block.
generate_video returns a plain dict, so getattr(result, ...) always hit the fallback: generation_time silently became wall time and peak_memory_mb was always None. Use dict access. Label the measured metric honestly: generation_time is the full pipeline (text-encode + denoise + decode), not denoise. Also: the sm_121 runtime allowlist landed via hao-ai-lab#1647; hao-ai-lab#1598 is the remaining kernel build.
SolitaryThinker
force-pushed
the
docs/spark-device-guide
branch
from
August 6, 2026 21:22
d32de9a to
f85778d
Compare
Collaborator
|
Pushed two maintainer commits to this branch: a rebase onto current main and a small fix commit.
Verified the docs' checkable claims and the scripts compile; GPU numbers in the guide are yours to re-confirm with the fixed timing since generation_time may shift them slightly. |
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.
Summary
The Spark install guide (
installation/spark.md) gets you running on a GB10, butstops there. This adds the layer above it: which models are practical on the
GB10, what actually makes them faster, and what gives little or nothing on this
unified-memory hardware (and why) — so users don't spend a night tuning knobs
that can't move here.
New page
docs/getting_started/installation/spark_performance.md:VAE-decode-bound on the ~270 GB/s unified LPDDR5X.
default), distilled models ✅, VSA ✅ — vs building FlashAttention ❌ (SDPA is
already flash-efficient on sm_121),
torch.compileof the VAE ❌, andlinear-only quantization ❌ on long-sequence models (attention dominates the
denoise; linears are a few %). FP4 attention is covered as an opt-in path.
nvidia-smiN/A,peak_memory_mbas the real per-run figure) and a gotchas section.
New examples under
examples/inference/optimizations/:spark_benchmark.py— reproduces the headline claims (few-step median timing +fp32-vs-bf16 decode A/B + peak memory), in-process to control for the GB10's
few-step run-to-run variance.
qad_fp4_ab.py— FP4 attention quality/speed A/B on the QAD checkpoint(
FastVideo/FastWan-QAD-1.3B), one arm per process.Plus cross-links from
installation.md,spark.md, and a note at the top ofinference/optimizations.md.Test evidence — all numbers measured on a DGX Spark (GB10)
Environment: GB10 (cc 12.1), torch 2.12.0+cu130, transformers 5.14.0, CUDA 13.
Every number in the guide is one of these measured values (no estimates carried
over). Sample stills from the FP4-attention A/B (bf16 vs FP4) are visually
equivalent; I'll attach them to the PR.
Depends on (merge order)
This PR is written assuming two other Spark PRs are on
main, and should mergeafter both:
ATTN_QAT_INFERFP4 attention on sm_121a) —qad_fp4_ab.pyand the guide's FP4-attention section rely on the sm_121 kernel + allowlist it
adds. [kernel] Build + allow attn_qat_infer FP4 attention on sm_121a (DGX Spark) #1598 also documents the sm_121 backend in
optimizations.md, so this PRdeliberately does not touch that section (only adds a cross-link).
BatchEncodingfix) — the guide references running Cosmos-2.5;without this, Cosmos-2.5 inference crashes at text-encode on recent transformers.
Both PRs also touch
installation/spark.md/inference/optimizations.md, indifferent sections from this one — landing them first avoids a both-touched merge.
Related (not duplicated)
duplicating the harness.
single-GPU GB10 benchmark config needs CI gating first).