jikechao opened a new issue, #15006:
URL: https://github.com/apache/tvm/issues/15006

   For the following script, it produced different inference results between 
PyTorch and TVM. 
   
   ### Actual behavior
   
   
![image](https://github.com/apache/tvm/assets/29506758/c7250d9d-1b58-460d-879e-525918fa13af)
   
   
   ### Steps to reproduce
   
   ```
   import torch
   from tvm import relay
   import tvm
   import numpy as np
   from torch.nn import Module
   
   input_data = torch.randn([1, 3, 7], dtype=torch.float64)
   class lp_pool1d(Module):
           def forward(self, *args):
               return torch.nn.functional.lp_pool1d(args[0], 1.5, 2)
   
   m = lp_pool1d().float().eval()
   
   torch_outputs = m(input_data)
   
   trace = torch.jit.trace(m, input_data)
   input_shapes = [('input0', torch.Size([1, 3, 7]))]
   
   mod, params = relay.frontend.from_pytorch(trace, input_shapes)
   print(mod)
   with tvm.transform.PassContext(opt_level=3):
       exe = relay.create_executor('graph', mod=mod, params=params, 
device=tvm.device('llvm', 0), target='llvm').evaluate()
   
   input_tvm = {'input0': np.array(input_data, dtype='float64')}
   tvm_outputs = exe(**input_tvm).asnumpy()
   
   np.testing.assert_allclose(torch_outputs, tvm_outputs, rtol=1e-3, atol=1e-3)
   ```
   
   ### Triage
   
   * needs-triage
   * frontend:pytorch
   
   
   ### Analysis
   
   This inconsistency was triggered only we use `lpool1d` and with 
input_shape=[1, 3, 7]. other input_shape will not produce any inconsistency.
   
   
   Wish your further analyzing and fixing.
   
   


-- 
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]

Reply via email to