Dayuxiaoshui opened a new pull request, #18540: URL: https://github.com/apache/tvm/pull/18540
Fix Issue #18407: from_exported_program segfault with exported MHA using eq(0)/expand mask + in-place masked_fill_. Problem: When importing torch.export models with lifted tensors (e.g., from masked_fill_ operations), the conversion fails because these tensors are FakeTensor or tensor subclasses that don't support .numpy() or DLPack conversion. Solution: - Add FakeTensor detection before conversion - Create zero tensors as placeholders for FakeTensor/lifted tensors - Add fallback exception handling for tensor subclasses - Use torch.zeros instead of torch.randn to support all dtypes This fix allows models with MHA and masked_fill_ operations to be successfully imported without crashes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
