<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63714>63714</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Unknown MLIR error "training is not supported for now"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          clw5710
      </td>
    </tr>
</table>

<pre>
    I am using a tool called [ScaleHLS ](https://github.com/hanchenye/scalehls) which translates PyTorch models to HLS C++ code for later FPGA implementation. I am posting here because it uses MLIR. I've been particularly interested in using this tool for trained models, however each time a trained model is used I get an "operand does not dominate this use" error (occurs for my models and models provided in ScaleHLS samples). Interestingly, untrained models run fine. 

Most likely this is a ScaleHLS bug, however I am looking for some clarity on the following error from the MLIR output:
`%75 = linalg.conv_2d_nchw_fchw {dilations = dense<1> : vector<2xi64>, strides = cf.assert %3, "training is not supported for now"`

This came from trying to run the following pretrained resnet18 model:
```
import sys 
import torch 
import torchvision.models as models 

import os 
import torch_mlir 

resnet18 = models.resnet18(weights=models.ResNet18_Weights.DEFAULT)
resnet18.train(False)

module = torch_mlir.compile(resnet18, torch.ones(1,3,32,32), output_type=torch_mlir.OutputType.LINALG_ON_TENSORS)

print(module)
```

Does this mean that the linalg dialect does not currently support trained PyTorch model lowering?

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVVGP4jgM_jXmxdqKppSWBx4YGPaQZmdXO7O6RxQSQ3OTJlWS0uu_P6WFAe5Op5NQgdixP3_-7HLv1ckQLSF_gnwz4W2orFsK3eVFOp0crOyXO-Q1tl6ZE3IM1moUXGuSCPnTm-Cafnt5Q8g3wMoqhMZDtgK2BbY9qVC1h0TYGti24kZUZHoCtvXxVqU9sAV2lRIVBseN1zyQxx_9u3WiwtpK0h6DxRh_DewJ2BMKKwmP1mF0drj98XWFqm401WQCD8qaBAfAj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