Commit 7929ddd
fix(hf_ptq): use sequential device_map for DiffusionGemma
DiffusionGemma ties weights between its encoder and decoder. Loading it
with device_map="auto" (balanced) can place the two sides of a tied pair
on different GPUs; the tie cannot then be honored and one side is left on
the meta device, so the pre-quantization preview fails with:
RuntimeError: Tensor.item() cannot be called on meta tensors
Detect DiffusionGemma configs in get_model and select
device_map="sequential", which keeps tied modules together. This mirrors
the existing per-model handling for bart and t5, where device_map="auto"
similarly mis-shards tied encoder/decoder weights.
Multi-GPU only; single-GPU runs were unaffected. Previously this required
passing --use_seq_device_map manually.
Fixes NVBug 6524370
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Juhi Mittal <juhim@nvidia.com>1 parent a23390d commit 7929ddd
1 file changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
307 | 318 | | |
308 | 319 | | |
309 | 320 | | |
| |||
696 | 707 | | |
697 | 708 | | |
698 | 709 | | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
699 | 722 | | |
700 | 723 | | |
701 | 724 | | |
| |||
0 commit comments