Uploaded image for project: 'AI Platform Core Components'
  1. AI Platform Core Components
  2. AIPCC-11118

[Inconsistency] TorchInductor produce differnt results with eager about the copysign operator

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • PyTorch
    • None
    • PyTorch Sprint 27

          1. 🐛 Describe the bug

      ```python
      import torch

      def model_func(self, other):
      out = torch.ops.aten.copysign(self, other=other,)
      return out

      input_config =

      {'self':torch.randn([6],dtype=torch.float32, device='cuda'),'other':-0.0,}

      compiled_eager = torch.compile(model_func, backend="eager")
      out1 = compiled_eager(**input_config)
      compiled_inductor = torch.compile(model_func, backend="inductor", )
      out_inductor = compiled_inductor(**input_config)
      torch.testing.assert_close(out1, out_inductor)
      ```

          1. Error logs

      ```
      Traceback (most recent call last):
      File "/data/bug.py", line 26, in <module>
      torch.testing.assert_close(out1, out_inductor)
      File "/data/software/pytorch/torch/testing/_comparison.py", line 1600, in assert_close
      raise error_metas[0].to_error(msg)
      AssertionError: Tensor-likes are not close!

      Mismatched elements: 6 / 6 (100.0%)
      Greatest absolute difference: 3.495041608810425 at index (5,) (up to 1e-05 allowed)
      Greatest relative difference: 2.0 at index (0,) (up to 1.3e-06 allowed)
      ```

          1. Versions

      ```
      Versions of relevant libraries:
      [pip3] intel-cmplr-lib-ur==2025.3.1
      [pip3] intel-openmp==2025.3.1
      [pip3] mkl-include==2025.3.0
      [pip3] mkl-static==2025.3.0
      [pip3] numpy==2.4.0
      [pip3] onemkl-license==2025.3.0
      [pip3] optree==0.18.0
      [pip3] tbb==2022.3.0
      [pip3] tbb-devel==2022.3.0
      [pip3] tcmlib==1.4.1
      [pip3] torch==2.11.0a0+gitdac4f45
      [pip3] triton==3.6.0+git9844da95
      [pip3] umf==1.0.2
      [conda] intel-cmplr-lib-ur 2025.3.1 pypi_0 pypi
      [conda] intel-openmp 2025.3.1 pypi_0 pypi
      [conda] mkl-include 2025.3.0 pypi_0 pypi
      [conda] mkl-static 2025.3.0 pypi_0 pypi
      [conda] numpy 2.4.0 pypi_0 pypi
      [conda] onemkl-license 2025.3.0 pypi_0 pypi
      [conda] optree 0.18.0 pypi_0 pypi
      [conda] tbb 2022.3.0 pypi_0 pypi
      [conda] tbb-devel 2022.3.0 pypi_0 pypi
      [conda] tcmlib 1.4.1 pypi_0 pypi
      [conda] torch 2.11.0a0+gitdac4f45 pypi_0 pypi
      [conda] triton 3.6.0+git9844da95 pypi_0 pypi
      [conda] umf 1.0.2 pypi_0 pypi
      ```

      cc @ezyang @gchanan @kadeng @msaroufim @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @muchulee8 @amjames @aakhundov @coconutruben @jataylo

              rh-ee-krastogi Kushagra Rastogi
              rh-ee-krastogi Kushagra Rastogi
              PyTorch Compile
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: