-
Notifications
You must be signed in to change notification settings - Fork 646
Description
In export the Alpamayo-R1 model (which internally uses Qwen3-VL) using torch.export and then lower it to torch-mlir (ATen dialect).
The export fails due to torch.linspace being called with a data-dependent length, which becomes symbolic during export.
Error message :
During torch.export.export(...), the following error is raised:
torch.fx.experimental.symbolic_shapes.GuardOnDataDependentSymNode: Could not extract specialized integer from data-dependent expression u0
The error originates from a call to torch.linspace.
Problematic code:
`def fast_pos_embed_interpolate(self, grid_thw):
grid_ts, grid_hs, grid_ws = grid_thw[:, 0], grid_thw[:, 1], grid_thw[:, 2]
for t, h, w in zip(grid_ts, grid_hs, grid_ws):
h_idxs = torch.linspace(0, self.num_grid_per_side - 1, h)
w_idxs = torch.linspace(0, self.num_grid_per_side - 1, w)`
Here, h and w are derived from grid_thw and become symbolic integers during export, which causes torch.linspace(..., steps=h) to fail
Related issue:
This appears similar to the following PyTorch issue:
@zjgarvey , @penguin-wwy , @angelayi , @agunapal
Any guidance on how to resolve this would be very helpful and is the suggestable to modify the code in model