transformers
62dd93e1 - Build Idefics-style vision position ids with torch.where (#49917)

Commit
2 days ago
Build Idefics-style vision position ids with torch.where (#49917) The vision embeddings of Idefics2, Idefics3, SmolVLM and Phi-4 multimodal fill position ids with a boolean-mask assignment. Its size depends on the mask values, so torch.export records an unbacked size and emits index/index_put ops, which runtimes without data-dependent kernels cannot run. torch.where gives the same values element by element, because position_ids starts as zeros, and keeps every shape static.
Author
Parents
Loading