executorch icon indicating copy to clipboard operation
executorch copied to clipboard

[Request help] Failed running call_function <built-in function getitem>

Open liye0626 opened this issue 1 year ago • 3 comments

I encountered the following issues when converting to PTE: ”RuntimeError: Failed running call_function (*(FakeTensor(..., size=(1, 7), dtype=torch.int64), (FakeTensor(..., size=(), dtype=torch.int64), slice(None, u34 + 1, None))), **{}): Could not guard on data-dependent expression Eq(7, u34 + 1) (unhinted: Eq(7, u34 + 1)).  (Size-like symbols: u34)“

Related code

accept_length_item = accept_length.item() #  accept_length is a dynamic value
torch.int64 torch._check_is_size(accept_length_item)
torch._check(accept_length_item <= 6) 
torch._check(accept_length_item >= 0)
retrieve_indices[0, :accept_length_item + 1]

If "torch._check(accept_length_item <= 5) ",  there will be no issue here. But if "torch._check(accept_length_item <= 6) ", the above issue will occur. I think accept_length_item = 6 is legal for "retrieve_indices[0, :accept_length_item + 1]". Here the shape of retrieve_indices is [1, 7]. 

cc @mergennachin @byjlw

liye0626 avatar Mar 25 '25 01:03 liye0626

@angelayi @tugsbayasgalan can you take a look?

JacobSzwejbka avatar Mar 25 '25 16:03 JacobSzwejbka

Given that this error is related to export you might get a faster response if you file an issue in pytorch/pytorch @liye0626

JacobSzwejbka avatar Mar 25 '25 16:03 JacobSzwejbka

Hi @liye0626, were you able to get a response on pytorch/pytorch?

nil-is-all avatar Dec 18 '25 21:12 nil-is-all