diffusers
52110fbb - Fix LoRA hot-swapping recompilation with `different_shapes_for_compilation` (#14297)

Commit
31 days ago
Fix LoRA hot-swapping recompilation with `different_shapes_for_compilation` (#14297) [tests] fix hot-swapping recompilation with different_shapes_for_compilation `test_hotswapping_compiled_model_linear` and `test_hotswapping_compiled_model_both_linear_and_other` failed for every model setting `different_shapes_for_compilation`, e.g.: RecompileError: tensor 'hidden_states' size mismatch at index 1. expected 16, actual 32 The dummy inputs are `(batch, height * width, channels)` with `channels = 16` and the first traced shape is `(4, 4)`, so the image sequence length equals the channel count. Duck shaping assigns both dims the same symbol, which `img_in` (an `nn.Linear` with constant `in_features`) then specializes to 16, forcing a recompile on the next shape. `use_duck_shape = False` was already set in `test_compile_on_different_shapes` and `test_hotswapping_compile_on_different_shapes` (#11327) but the other two multi-shape hot-swapping tests were missed. Move it into `_check_model_hotswap` so all of them are covered, and drop the now-redundant duplicate. Also drop the two `xfail(strict=True)` markers on `TestQwenImageTransformerLoRAHotSwap` that were masking this bug. Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Author
Parents
Loading