nvfp4_qat_train_config ¶
NVFP4 quantization-aware training linear method (straight-through estimator).
The inference nvfp4_qat config quantizes each weight to FP4 once at load time (convert_model_to_fp4) and has no gradient path — it is inference only. For QAT finetuning the weight must stay a trainable bf16/fp32 master that is fake-quantized to FP4 on every forward, with a full-precision backward (a straight-through estimator), so the model learns to absorb FP4 linear error.
That STE already exists in fastvideo.layers.fp4linear._LinearFWD4BWD16Fn (FP4 forward, full-precision backward) but is otherwise unwired. This method bridges it into the standard quant_config path, so it activates via transformer_quant="nvfp4_qat_train" on the same Wan-2.1 layers as nvfp4_qat (to_q/k/v/out + ffn). No convert_model_to_fp4 is needed: the weight is kept in full precision and quantized on the fly each step.