torch-mlir icon indicating copy to clipboard operation
torch-mlir copied to clipboard

Add ConstantArgument support to fx_import

Open alaa-ali opened this issue 6 months ago • 1 comments

This PR will fix the following issue: fx_importer NotImplementedError: MultiheadAttention layer with NeedWeight = false

The following error was raised before this fix: Python Error: NotImplementedError: OutputKind.USER_OUTPUT for <class 'torch.export.graph_signature.ConstantArgument'>: ConstantArgument(name='', value=None)

This occurs for an exported MultiheadAttention layer with "NeedWeight = false" which means weights are not going to be returned by the layer. So, the second output attn_output_weights will be None in this case.

alaa-ali avatar Jun 27 '25 16:06 alaa-ali

@stellaraccident plz review this

penguin-wwy avatar Jun 30 '25 06:06 penguin-wwy

Looks like test are failing. Let's talk about this if it is due to a too old version of pt in the CI.

stellaraccident avatar Jun 30 '25 19:06 stellaraccident