Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[easy] Invalid call to aoti_torch_tensor_copy_ #123039

Closed
Tracked by #117363
desertfire opened this issue Mar 30, 2024 · 0 comments · May be fixed by #124037
Closed
Tracked by #117363

[easy] Invalid call to aoti_torch_tensor_copy_ #123039

desertfire opened this issue Mar 30, 2024 · 0 comments · May be fixed by #124037
Assignees
Labels
module: aotinductor aot inductor triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@desertfire
Copy link
Contributor

desertfire commented Mar 30, 2024

Repro:
Comment out

"test_multi_device_cuda",
, and then run

TORCHINDUCTOR_ABI_COMPATIBLE=1 python test/inductor/test_cuda_cpp_wrapper.py -k test_multi_device_cuda

Error:

Output:
In file included from /data/users/binbao/pytorch/torch/include/torch/csrc/inductor/aoti_runtime/arrayref_tensor.h:3,
                 from /tmp/torchinductor_binbao/iw/ciwj3ypfsejr725rlcittslsy7aeekpezl7xqdln6yx6emhjd4ym.cpp:4:
/tmp/torchinductor_binbao/iw/ciwj3ypfsejr725rlcittslsy7aeekpezl7xqdln6yx6emhjd4ym.cpp: In function ‘void inductor_entry_impl(AtenTensorOpaque**, AtenTensorOpaque**)’:
/tmp/torchinductor_binbao/iw/ciwj3ypfsejr725rlcittslsy7aeekpezl7xqdln6yx6emhjd4ym.cpp:202:99: error: cannot convert ‘torch::aot_inductor::ArrayRefTensor<float>’ to ‘AtenTensorHandle’ {aka ‘AtenTensorOpaque*’}
  202 |     AOTI_TORCH_ERROR_CODE_CHECK(aoti_torch_tensor_copy_(expensive_copy_to_tensor_if_needed(buf0), buf1));
      |                                                                                                   ^~~~
      |                                                                                                   |
      |                                                                                                   torch::aot_inductor::ArrayRefTensor<float>
/data/users/binbao/pytorch/torch/include/torch/csrc/inductor/aoti_runtime/utils.h:34:8: note: in definition of macro ‘AOTI_TORCH_ERROR_CODE_CHECK’
   34 |   if ((call) != AOTI_TORCH_SUCCESS) {           \
      |        ^~~~
In file included from /data/users/binbao/pytorch/torch/include/torch/csrc/inductor/aoti_torch/generated/c_shim_cuda.h:4,
                 from /tmp/torchinductor_binbao/iw/ciwj3ypfsejr725rlcittslsy7aeekpezl7xqdln6yx6emhjd4ym.cpp:2:
/data/users/binbao/pytorch/torch/include/torch/csrc/inductor/aoti_torch/c/shim.h:382:64: note:   initializing argument 2 of ‘AOTITorchError aoti_torch_tensor_copy_(AtenTensorHandle, AtenTensorHandle)’
  382 | aoti_torch_tensor_copy_(AtenTensorHandle src, AtenTensorHandle dst);
      |                                               ~~~~~~~~~~~~~~~~~^~~
In file included from /data/users/binbao/pytorch/torch/include/torch/csrc/inductor/aoti_runtime/arrayref_tensor.h:3,
                 from /tmp/torchinductor_binbao/iw/ciwj3ypfsejr725rlcittslsy7aeekpezl7xqdln6yx6emhjd4ym.cpp:4:
/tmp/torchinductor_binbao/iw/ciwj3ypfsejr725rlcittslsy7aeekpezl7xqdln6yx6emhjd4ym.cpp:222:99: error: cannot convert ‘torch::aot_inductor::ArrayRefTensor<float>’ to ‘AtenTensorHandle’ {aka ‘AtenTensorOpaque*’}
  222 |     AOTI_TORCH_ERROR_CODE_CHECK(aoti_torch_tensor_copy_(expensive_copy_to_tensor_if_needed(buf4), buf5));
      |                                                                                                   ^~~~
      |                                                                                                   |
      |                                                                                                   torch::aot_inductor::ArrayRefTensor<float>
/data/users/binbao/pytorch/torch/include/torch/csrc/inductor/aoti_runtime/utils.h:34:8: note: in definition of macro ‘AOTI_TORCH_ERROR_CODE_CHECK’
   34 |   if ((call) != AOTI_TORCH_SUCCESS) {           \
      |        ^~~~
In file included from /data/users/binbao/pytorch/torch/include/torch/csrc/inductor/aoti_torch/generated/c_shim_cuda.h:4,
                 from /tmp/torchinductor_binbao/iw/ciwj3ypfsejr725rlcittslsy7aeekpezl7xqdln6yx6emhjd4ym.cpp:2:
/data/users/binbao/pytorch/torch/include/torch/csrc/inductor/aoti_torch/c/shim.h:382:64: note:   initializing argument 2 of ‘AOTITorchError aoti_torch_tensor_copy_(AtenTensorHandle, AtenTensorHandle)’
  382 | aoti_torch_tensor_copy_(AtenTensorHandle src, AtenTensorHandle dst);
      |                                               ~~~~~~~~~~~~~~~~~^~~
@desertfire desertfire added module: aotinductor aot inductor triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Mar 30, 2024
@desertfire desertfire self-assigned this Mar 30, 2024
@desertfire desertfire changed the title test_multi_device_cuda [easy] test_multi_device_cuda Mar 30, 2024
@desertfire desertfire removed their assignment Apr 3, 2024
@desertfire desertfire changed the title [easy] test_multi_device_cuda [easy] Invalid call to aoti_torch_tensor_copy_ Apr 3, 2024
@trieuat trieuat assigned trieuat and unassigned trieuat Apr 3, 2024
@trieuat trieuat self-assigned this Apr 14, 2024
trieuat added a commit to trieuat/pytorch that referenced this issue Apr 15, 2024
trieuat added a commit to trieuat/pytorch that referenced this issue Apr 15, 2024
trieuat added a commit to trieuat/pytorch that referenced this issue Apr 15, 2024
pytorchmergebot added a commit that referenced this issue Apr 22, 2024
This reverts commit 6e24cc0.

Reverted #124037 on behalf of https://github.com/jeanschmidt due to seems to have introduced a regression in pull / linux-focal-cuda12.1-py3.10-gcc9 / test (default, 3, 5, linux.4xlarge.nvidia.gpu) ([comment](#124037 (comment)))
pytorchmergebot pushed a commit that referenced this issue Apr 26, 2024
fixes #123039

In abi mode, ExternKernelSchedulerNode generates code using `aoti_torch_tensor_copy_` which requires `AtenTensorHandle`, but the allocation generates ArrayRefTensor to allocate mem in stack. To fix this issue, this PR prevents ExternKernelSchedulerNode from using stack-mem-allocation in abi, and creates AtenTensorHandle instead.

Pull Request resolved: #124037
Approved by: https://github.com/desertfire
pytorchmergebot added a commit that referenced this issue Apr 26, 2024
This reverts commit f9379eb.

Reverted #124037 on behalf of https://github.com/jeanschmidt due to introducing regressions in benchmark, see D56623194 for more details ([comment](#124037 (comment)))
carmocca pushed a commit to carmocca/pytorch that referenced this issue Apr 29, 2024
…24037)

fixes pytorch#123039

In abi mode, ExternKernelSchedulerNode generates code using `aoti_torch_tensor_copy_` which requires `AtenTensorHandle`, but the allocation generates ArrayRefTensor to allocate mem in stack. To fix this issue, this PR prevents ExternKernelSchedulerNode from using stack-mem-allocation in abi, and creates AtenTensorHandle instead.

Pull Request resolved: pytorch#124037
Approved by: https://github.com/desertfire
carmocca pushed a commit to carmocca/pytorch that referenced this issue Apr 29, 2024
…ytorch#124037)"

This reverts commit f9379eb.

Reverted pytorch#124037 on behalf of https://github.com/jeanschmidt due to introducing regressions in benchmark, see D56623194 for more details ([comment](pytorch#124037 (comment)))
andoorve pushed a commit to andoorve/pytorch that referenced this issue May 1, 2024
…24037)

fixes pytorch#123039

In abi mode, ExternKernelSchedulerNode generates code using `aoti_torch_tensor_copy_` which requires `AtenTensorHandle`, but the allocation generates ArrayRefTensor to allocate mem in stack. To fix this issue, this PR prevents ExternKernelSchedulerNode from using stack-mem-allocation in abi, and creates AtenTensorHandle instead.

Pull Request resolved: pytorch#124037
Approved by: https://github.com/desertfire
andoorve pushed a commit to andoorve/pytorch that referenced this issue May 1, 2024
…ytorch#124037)"

This reverts commit 6e24cc0.

Reverted pytorch#124037 on behalf of https://github.com/jeanschmidt due to seems to have introduced a regression in pull / linux-focal-cuda12.1-py3.10-gcc9 / test (default, 3, 5, linux.4xlarge.nvidia.gpu) ([comment](pytorch#124037 (comment)))
andoorve pushed a commit to andoorve/pytorch that referenced this issue May 1, 2024
…24037)

fixes pytorch#123039

In abi mode, ExternKernelSchedulerNode generates code using `aoti_torch_tensor_copy_` which requires `AtenTensorHandle`, but the allocation generates ArrayRefTensor to allocate mem in stack. To fix this issue, this PR prevents ExternKernelSchedulerNode from using stack-mem-allocation in abi, and creates AtenTensorHandle instead.

Pull Request resolved: pytorch#124037
Approved by: https://github.com/desertfire
andoorve pushed a commit to andoorve/pytorch that referenced this issue May 1, 2024
…ytorch#124037)"

This reverts commit f9379eb.

Reverted pytorch#124037 on behalf of https://github.com/jeanschmidt due to introducing regressions in benchmark, see D56623194 for more details ([comment](pytorch#124037 (comment)))
petrex pushed a commit to petrex/pytorch that referenced this issue May 3, 2024
…24037)

fixes pytorch#123039

In abi mode, ExternKernelSchedulerNode generates code using `aoti_torch_tensor_copy_` which requires `AtenTensorHandle`, but the allocation generates ArrayRefTensor to allocate mem in stack. To fix this issue, this PR prevents ExternKernelSchedulerNode from using stack-mem-allocation in abi, and creates AtenTensorHandle instead.

Pull Request resolved: pytorch#124037
Approved by: https://github.com/desertfire
petrex pushed a commit to petrex/pytorch that referenced this issue May 3, 2024
…ytorch#124037)"

This reverts commit 6e24cc0.

Reverted pytorch#124037 on behalf of https://github.com/jeanschmidt due to seems to have introduced a regression in pull / linux-focal-cuda12.1-py3.10-gcc9 / test (default, 3, 5, linux.4xlarge.nvidia.gpu) ([comment](pytorch#124037 (comment)))
pytorch-bot bot pushed a commit that referenced this issue May 3, 2024
fixes #123039

In abi mode, ExternKernelSchedulerNode generates code using `aoti_torch_tensor_copy_` which requires `AtenTensorHandle`, but the allocation generates ArrayRefTensor to allocate mem in stack. To fix this issue, this PR prevents ExternKernelSchedulerNode from using stack-mem-allocation in abi, and creates AtenTensorHandle instead.

Pull Request resolved: #124037
Approved by: https://github.com/desertfire
petrex pushed a commit to petrex/pytorch that referenced this issue May 3, 2024
…ytorch#124037)"

This reverts commit f9379eb.

Reverted pytorch#124037 on behalf of https://github.com/jeanschmidt due to introducing regressions in benchmark, see D56623194 for more details ([comment](pytorch#124037 (comment)))
@desertfire desertfire reopened this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: aotinductor aot inductor triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
2 participants