Commit Graph
108 Commits
Author SHA1 Message Date
6d925d5333 [feat] dreamverse-monorepo: Phase 1 — skeleton + tooling
Establish the apps/dreamverse/ subfolder + monorepo tooling per
.agents/memory/dreamverse-integration/integration-plan.md Phase 1.
No Dreamverse content moved yet — that's Phase 2/3.

* Add apps/dreamverse/{README.md, pyproject.toml, server/__init__.py,
  server/tests/__init__.py}.
* Add docs/contributing/dreamverse-development.md with local dev commands.
* Root pyproject.toml: add [tool.uv.workspace] members = ["apps/dreamverse"];
  add apps* to setuptools exclude; add gpu pytest marker.
* .pre-commit-config.yaml: exclude ^apps/dreamverse/web/.
* .gitignore: scope Node artifacts + unignore product assets.
* uv.lock: regenerated by `uv lock` to include the new workspace member.

Co-authored-by: Junda (David) Su <90978028+Davids048@users.noreply.github.com>
Co-authored-by: Matthew Noto <99706358+RandNMR73@users.noreply.github.com>
Co-authored-by: XOR-op <17672363+XOR-op@users.noreply.github.com>
Co-authored-by: Zhang Peiyuan <42993249+jzhang38@users.noreply.github.com>
2026-05-07 13:37:25 -07:00
3a0f39d626 feat(ltx2): wire FP4 inference through fastvideo.layers.quantization
The public LTX-2 path was previously running full bf16 even when
callers set ``pipeline_config.dit_config.quant_config = FP4Config()``,
because:

* the DiT used plain ``torch.nn.Linear`` for FP4-eligible projections
  (``attn1/attn2.to_q/k/v/out``, ``audio_to_video_attn``,
  ``video_to_audio_attn``, FFN ``fc_in``/``fc_out``), so
  ``LinearBase.quant_method.apply`` was never reached;
* the loader did not call ``convert_model_to_fp4`` after weights
  loaded, so even matched layers had no ``_fp4_weight*`` buffers;
* ``QuantizationMethods`` did not register ``"FP4"``, so the typed
  ``engine.quantization.transformer_quant`` surface had no way to
  select it.

This commit completes the inference wire-up through the existing
``fastvideo.layers.quantization`` registry — no parallel pathway:

* swap ``nn.Linear`` → ``ReplicatedLinear`` for the LTX-2 attention
  ``to_q``/``to_k``/``to_v``/``to_out``/``to_gate_compress`` and the
  FFN ``fc_in``/``fc_out`` (``GELUApprox.proj`` and ``FeedForward``
  ``project_out``). Other linears (timestep MLP, caption proj,
  patchify, AdaLN scale/shift) stay ``nn.Linear`` to match internal.
* port ``_supports_prequantized_input`` and
  ``_linear_project_with_optional_prequant`` so the attention forward
  quantizes input once and reuses the ``(x_fp4, x_scale, x_global_sf)``
  tuple across q/k/v projections — matches internal exactly.
* plumb ``quant_config`` and ``prefix`` through
  ``BasicAVTransformerBlock`` → ``_init_transformer_blocks`` →
  ``LTXModel`` → ``LTX2Transformer3DModel`` so each
  ``ReplicatedLinear`` gets the correct
  ``ltx2.blocks.<i>.<sub>.<proj>`` prefix that
  ``FP4Config.get_quant_method`` matches against.
* register ``"FP4"`` in ``QuantizationMethods`` literal +
  ``get_quantization_config`` registry so typed
  ``engine.quantization.transformer_quant: "FP4"`` resolves to a
  concrete ``FP4Config()`` instance.
* add ``transformer_quant`` carrier on ``FastVideoArgs`` and
  ``__post_init__._apply_transformer_quant`` to pin the resolved
  quant config onto ``dit_config.quant_config`` (without
  overwriting an explicit setter on the dit_config).
* add ``_maybe_convert_model_to_fp4`` in ``fsdp_load.py`` that
  walks the loaded model once and registers
  ``_fp4_weight*``/``_fp4_alpha``/``_weight_global_sf`` buffers on
  layers whose ``quant_method`` is ``FP4QuantizeMethod``. flashinfer
  is imported lazily inside ``convert_model_to_fp4`` so this is a
  no-op on hosts without the FP4 kernels.
* restore ``LinearBase`` fallback to ``UnquantizedLinearMethod`` when
  ``quant_config.get_quant_method`` returns ``None`` — ``FP4Config``
  only tags a curated subset of layers, and the previous
  ``assert quant_method is not None`` would crash any non-tagged
  layer that received a quant_config.

Non-FP4 callers are unaffected: ``UnquantizedLinearMethod.apply``
runs the standard ``F.linear`` path, and parameter names
(``to_q.weight``, ``to_out.0.weight`` from ``nn.ModuleList``) are
identical to the previous ``nn.Sequential`` layout.

Co-authored-by: Junda (David) Su <90978028+Davids048@users.noreply.github.com>
Co-authored-by: Matthew Noto <99706358+RandNMR73@users.noreply.github.com>
Co-authored-by: XOR-op <17672363+XOR-op@users.noreply.github.com>
Co-authored-by: Zhang Peiyuan <42993249+jzhang38@users.noreply.github.com>
2026-05-07 13:37:25 -07:00
82e532727f feat(api): typed per-component CompileConfig + FastVideoArgs carriers
Extend the typed inference API so callers can drive torch.compile per
component without falling back to the legacy flat-kwargs pathway.

* ``CompileConfig`` now exposes ``vae_enabled``, ``audio_vae_enabled``,
  ``dit_kwargs``, ``text_encoder_kwargs``, ``vae_kwargs``,
  ``audio_vae_kwargs`` alongside the existing ``enabled`` /
  ``text_encoder_enabled`` switches. The master ``backend``/
  ``fullgraph``/``mode``/``dynamic``/``extras`` continue to apply to
  every compiled submodule unless a per-component kwargs dict is
  non-empty (in which case it overrides entirely — matches the
  FastVideo-internal precedent).
* Add the matching runtime carrier fields on ``FastVideoArgs``:
  ``enable_torch_compile_text_encoder/vae/audio_vae`` plus
  ``torch_compile_kwargs_dit/text_encoder/vae/audio_vae``. These let
  the legacy flat-kwargs path round-trip through the typed config.
* ``api/compat.legacy_from_pretrained_to_config`` now lifts the new
  flat kwargs into ``CompileConfig``, and
  ``generator_config_to_fastvideo_args`` writes them back out so
  ``VideoGenerator.from_pretrained(model_path, ...)`` callers keep
  working unchanged.

No behavior change yet — these surfaces are ports of carriers only.
The composed pipeline base will start consuming them in the next
commit.

Co-authored-by: Junda (David) Su <90978028+Davids048@users.noreply.github.com>
Co-authored-by: Matthew Noto <99706358+RandNMR73@users.noreply.github.com>
Co-authored-by: XOR-op <17672363+XOR-op@users.noreply.github.com>
Co-authored-by: Zhang Peiyuan <42993249+jzhang38@users.noreply.github.com>
2026-05-07 13:37:25 -07:00
3ef2466810 fix(api): propagate generic refine_* args + match internal randn
Three small parity fixes uncovered while comparing the LTX-2 distilled
path against FastVideo-internal:

* `FastVideoArgs.__post_init__` now calls `_resolve_refine_args()` to
  copy the public-facing generic `refine_*` knobs onto their
  `ltx2_refine_*` runtime carriers (mirrors internal lines 303-322).
  Without this, callers that set `refine_lora_path=...` via the typed
  CLI/config surface would silently drop the value, surfacing later as
  the "applied to 0 layers" warning.
* Revert the patch-noise sampler in `_randn_ltx2_video_latents` from
  `randn_tensor` back to `torch.randn` to bit-match internal under
  single-generator inference. `randn_tensor` is identical for a single
  `torch.Generator` but diverges for `list[Generator]` (per-sample
  seeds), which is the only place the two paths could disagree.
* Classify the 19 previously-unclassified `refine_*` / `ltx2_refine_*`
  / `ltx2_audio_latent_path` / `ltx2_images` / `ltx2_image_crf` /
  `ltx2_conditioning_latent_*` / `ltx2_video_conditions` fields in the
  schema-parity inventory yaml so the parity test passes.

Co-authored-by: Junda (David) Su <90978028+Davids048@users.noreply.github.com>
Co-authored-by: Matthew Noto <99706358+RandNMR73@users.noreply.github.com>
Co-authored-by: XOR-op <17672363+XOR-op@users.noreply.github.com>
Co-authored-by: Zhang Peiyuan <42993249+jzhang38@users.noreply.github.com>
2026-05-07 13:37:25 -07:00
65cb91ed70 [docs] streaming: Dynamo native-backend integration reference
docs/design/server_contracts/dynamo.md documents the integration shape
the ai-dynamo/dynamo native backend package consumes. Per the refactor
decision, no Dynamo code lives in FastVideo — the backend package
ships in the Dynamo repo at components/src/dynamo/fastvideo/ with the
layout mirroring components/src/dynamo/sglang/.

Captured here:

* the 8-symbol public surface Dynamo imports (VideoGenerator plus
  ContinuationState, GenerationRequest, SamplingConfig, InputConfig,
  OutputConfig, VideoEvent, VideoResult) and what is available today
  vs. what lands in PR 7.10
* target backend package layout matching the sglang template
* full NvCreateVideoRequest <-> GenerationRequest mapping table and
  VideoFinalEvent <-> NvVideosResponse reverse mapping
* worked examples: aggregated handler (works today with generate_video
  + asyncio.to_thread), streaming handler (post-PR 7.10 via
  generate_async), health check payload (swapping to
  default_health_check_request() after PR 7.10)
* init function sketch, registration (ModelType::Videos fast path),
  args adapter
* contract guarantees that let the adapter be written once and not
  chase FastVideo drift
* explicit no-import list for the adapter

Also wires the server_contracts/ section into mkdocs.yml under Design.

Co-authored-by: Junda (David) Su <90978028+Davids048@users.noreply.github.com>
Co-authored-by: Matthew Noto <99706358+RandNMR73@users.noreply.github.com>
Co-authored-by: XOR-op <17672363+XOR-op@users.noreply.github.com>
Co-authored-by: Zhang Peiyuan <42993249+jzhang38@users.noreply.github.com>
2026-05-07 13:37:25 -07:00
11bdafa812 [docs] streaming: OpenAI HTTP contract reference
docs/design/server_contracts/ lands the contract reference set that PR
8 locks down ahead of the streaming + Dynamo upstreams. This commit
adds the index page plus the OpenAI HTTP reference:

* endpoint catalogue (/v1/videos/generations, list, status, content,
  images, models, health)
* VideoGenerationsRequest shape with SGLang-compatible extensions
* merge precedence (body > default_request > hardcoded fallback)
  with a pointer to the explicit-path tracking mechanism that makes
  it work
* continuation-state roundtrip on the stateless surface
* HTTP error code table
* explicit non-goals: flat legacy kwargs, private Dreamverse fields,
  raw tensor payloads — all excluded from this boundary by design

Co-authored-by: Junda (David) Su <90978028+Davids048@users.noreply.github.com>
Co-authored-by: Matthew Noto <99706358+RandNMR73@users.noreply.github.com>
Co-authored-by: XOR-op <17672363+XOR-op@users.noreply.github.com>
Co-authored-by: Zhang Peiyuan <42993249+jzhang38@users.noreply.github.com>
2026-05-07 13:37:25 -07:00
William Lin 140bd1a6cf [misc]: standardize install instructions on uv pip install (#1279) 2026-05-02 12:45:50 -07:00
William Lin 36b53ff350 [bugfix]: classify stable_audio fields in schema parity inventory (#1275) 2026-05-02 00:12:10 -07:00
William Lin 9801037c3d [refactor] tests/local_tests: organize by model family (#1269) 2026-05-01 01:49:54 -07:00
alexzms 37418946c8 [docs]: clarify real_score_guidance_scale CFG parameterization (#1256) 2026-04-26 16:38:00 +08:00
William Lin 95fd29e0cb [feat] Streaming WebSocket server skeleton (single generator + fMP4) (#1251) 2026-04-26 00:33:49 -07:00
William Lin e0dc5f2b0c [feat] Add typed LTX-2 continuation state and streaming session store (#1250) 2026-04-24 01:28:07 -07:00
William Lin 70ee5d230c [feat] [6/n] Improve API: LTX-2 public preset + asset wiring + gpu_pool translation (#1239) 2026-04-23 11:36:45 -07:00
William Lin 145a3f166b [feat] [4/n] Improve API: refactor sampling param and merge with presets (#1234) 2026-04-16 14:10:02 -07:00
William Lin 88a5a933ab [feat] [3/n] Improve API: extend support to cli (#1226) 2026-04-14 15:20:47 -07:00
William Lin 76c62d7a00 [feat] [1/n] API improvements: add intial files for new fastvideo public API (#1218) 2026-04-05 18:13:19 -07:00
vishruthb 5789955bbe [feat] add gen3c (cosmos-7b) model and pipeline support (#1059) 2026-04-01 11:42:02 +00:00
Jinzhe Pan 12d699cd78 [ci] Add direct test retry with check overwrite and aggregate status refresh (#1214) 2026-04-01 17:21:28 +08:00
Jinzhe Pan 81fd80c8ee [ci] Add TEST_SCOPE routing for clean single-test execution (#1203) 2026-03-31 19:40:59 +08:00
Jinzhe Pan de0de04212 [ci] Replace Merge Queue with auto-merge — reduce CI complexity (#1200) 2026-03-31 10:09:33 +08:00
Jinzhe Pan be35003cb1 [ci] Merge Queue, label system overhaul, and slash commands (2/2) (#1187) 2026-03-30 08:22:35 +08:00
Jinzhe Pan 26bd4db253 [ci] CI infrastructure cleanup and workflow reorganization (1/2) (#1186) 2026-03-29 17:01:09 -07:00
Jinzhe PanandWill Lin e294ca011c [feat]: overhaul SSIM test infrastructure — partition scheduling, helper migration, CI fixes (#1185)
Co-authored-by: Will Lin <wlsaidhi@gmail.com>
2026-03-29 23:59:25 +00:00
alexzms 14261bc98c [feat] pre-commit support 120 col num (#1167) 2026-03-11 20:19:30 -07:00
1a383f3f66 [refactor] train v1 clean up
Co-authored-by: alexzms <3036648523@qq.com>
Co-authored-by: Peiyuan Zhang <a1286225768@slurm-h200-204-215.slurm-compute.tenant-slurm.svc.cluster.local>
2026-03-09 18:58:56 -07:00
alexzmsandPeiyuan Zhang bc27a032c5 [feat] Refactor training framework into fastvideo/train (#1159)
Co-authored-by: Peiyuan Zhang <a1286225768@gmail.com>
2026-03-09 15:16:42 -07:00
Ajay Anubolu 02c1c49b75 [CI] Add inference performance regression tests (#1140) 2026-03-07 08:26:54 +08:00
Jinzhe Pan 5190c1bb1e [Doc] add doc for inference architecture (#1147) 2026-03-02 13:44:27 -08:00
Zhang Peiyuan fea556269b [Misc] Fix memory leakage in VideoGenerator (#1132) 2026-02-26 19:51:32 -08:00
Junda (David) Su e315657066 [docs] [kernel] Migrate to uv (#1127) 2026-02-25 14:13:50 -08:00
Zhang PeiyuanandWill Lin fc80d95d7e [Misc] Remove STA (#1124)
Co-authored-by: Will Lin <wlsaidhi@gmail.com>
2026-02-23 15:14:42 -08:00
Zhang Peiyuan 128d0b7fc5 [Misc] Remove Teacache (#1121) 2026-02-22 16:53:07 -08:00
Zhang Peiyuan 03d9ce2edb [Misc] Remove StepVideo (#1118) 2026-02-21 17:15:42 -08:00
6736dc06a5 Improve Docs (#1112)
Co-authored-by: Peiyuan Zhang <a1286225768@slurm-h200-204-227.slurm-compute.tenant-slurm.svc.cluster.local>
Co-authored-by: Peiyuan Zhang <a1286225768@slurm-login-0.slurm-login.tenant-slurm.svc.cluster.local>
2026-02-19 14:23:32 -08:00
William Lin 75e193a2c9 [core] Refactor and centralize our registry for models, pipelines, and sampling params (#1066) 2026-02-05 14:40:30 -08:00
William Linandgemini-code-assist[bot] 7fc5f241da [misc] Fix naming instruction in runpod.md (#1067)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-02-05 13:45:49 -08:00
XOR-op 38a6bd93d3 [chore]: update sageattn3 installation instructions (#1050) 2026-01-29 15:45:52 -08:00
William Lin 3ae58c277a [docs] Update design overview and add agents tutorial (#1044) 2026-01-27 15:56:58 -08:00
XOR-opandWill Lin e8c854bcf1 [docs] Offloading instruction (#1022)
Co-authored-by: Will Lin <wlsaidhi@gmail.com>
2026-01-26 13:40:28 -08:00
William Lin 06860e96fe [docs] Update runpod instructions (#1043) 2026-01-26 13:13:54 -08:00
alexzms 560628709c [Bug Fix] Add autograd wrapper for block-sparse attention in fastvideo-kernel + fix CMake extension linking (#1015) 2026-01-16 21:16:43 -08:00
XOR-op b7f69c2c1d [feat!] Disable FSDP inference by default (#1001) 2026-01-13 14:20:05 -08:00
Shreejith SGandWill Lin d9c996310b [docs]: add LoRA extraction utilities documentation (#992)
Co-authored-by: Will Lin <wlsaidhi@gmail.com>
2026-01-06 16:36:26 -06:00
William Lin 8eb3140b2f [misc] pin fastvideo-kernel in .toml file (#989) 2026-01-05 13:42:32 -06:00
William Lin e7f6db9bd1 [docs] Update docs and README (#975) 2026-01-04 14:59:19 -06:00
Qi Jia 5285116e73 [docs]: fix various broken links across the documentation (#979) 2026-01-01 20:02:39 -06:00
William Lin 87f8a2782d [docs] refactor attention docs (#964) 2025-12-26 15:21:49 -06:00
William LinandShreejithSG 2f6230abcf [kernel] Reorg and fix fastvideo-kernel (#962)
Co-authored-by: ShreejithSG <shreejithsg@gmail.com>
2025-12-26 01:50:24 -06:00
Matthew Noto da04d08426 [docs] small fixes (#947) 2025-12-22 15:23:55 -06:00
Loay Rashid e53730f324 [docs] Minor Fixes (#942) 2025-12-19 16:48:16 -06:00