Files
hao-ai-lab-FastVideo/fastvideo/api
aca68d9452 test(nvfp4): lock LTX-2 wiring + typed transformer_quant flow
Two new contract test files plus a few stale-name doc fixups so the
LTX-2 NVFP4 path can't silently regress.

* ``test_nvfp4_ltx2_wiring.py`` (6 tests): asserts that
  - ``LTXSelfAttention``'s ``to_q/to_k/to_v/to_out`` are
    ``ReplicatedLinear`` (not plain ``nn.Linear``);
  - ``NVFP4Config()`` attaches ``NVFP4QuantizeMethod`` to the
    quantized subset and the ``layer_prefix`` matches the
    ``ltx2.blocks.<i>.<sub>.<proj>`` paths in
    ``NVFP4Config.fp4_layers``;
  - non-tagged projections (cross-attn K/V, audio attn, audio FFN)
    fall back to ``UnquantizedLinearMethod`` instead of crashing on
    the quant_method assert;
  - ``BasicAVTransformerBlock`` propagates ``quant_config`` and
    ``prefix`` correctly to all 4 attention modules + FFN at once.
  These are CPU-only and don't need flashinfer.

* ``test_typed_quant_flow.py`` (4 tests): asserts that
  - typed ``engine.quantization.transformer_quant: "NVFP4"`` resolves
    through ``compat.py`` to a concrete ``NVFP4Config()`` instance;
  - omitting the typed surface leaves the ``transformer_quant``
    carrier ``None`` so legacy callers that mutate
    ``pipeline_config.dit_config.quant_config`` directly keep working;
  - ``__post_init__._apply_transformer_quant`` pins the carrier onto
    ``dit_config.quant_config``;
  - explicit ``dit_config.quant_config = …`` is preserved (the
    explicit setter wins over the typed carrier).

Plus stale ``FP4Config`` → ``NVFP4Config`` doc updates in
``api/compat.py``, ``fastvideo_args.py``, and ``layers/linear.py``
that the previous rename commit missed (comments and docstrings only,
no behavior change).

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
..