Commit 4584403
committed
[feat] QAD 5090: Wire the Attn-QAT training attention backend (10/12)
Make AttnQatTrainBackend (deadcode from #1358) selectable for
quantization-aware finetuning, mirroring the inference wiring in #1457. The
fake-quant-in-backward attention path becomes reachable via
FASTVIDEO_ATTENTION_BACKEND=ATTN_QAT_TRAIN.
- platforms/interface.py: add ATTN_QAT_TRAIN to AttentionBackendEnum.
- platforms/cuda.py: dispatch ATTN_QAT_TRAIN -> AttnQatTrainBackend, guarded by
is_attn_qat_train_available().
- attention/backends/attn_qat_train.py: add is_attn_qat_train_available()
helper (mirrors is_attn_qat_infer_available()).
- configs/models/dits/base.py: add ATTN_QAT_TRAIN to the default supported set.
Config-driven, no monkey-patch module swapping. The training Triton kernel
(fastvideo_kernel.triton_kernels.attn_qat_train) is not upstreamed yet, so for
now selecting ATTN_QAT_TRAIN logs a warning and falls back to Flash Attention
until a follow-up lands the kernel.
Depends on #1457 (overlaps the enum / dispatch / supported-list files).1 parent 633d393 commit 4584403
4 files changed
Lines changed: 15 additions & 1 deletion
File tree
- fastvideo
- attention/backends
- configs/models/dits
- platforms
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
143 | 151 | | |
144 | 152 | | |
145 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
0 commit comments