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

[Error] error: ‘CHECK_EQ’ was not declared in this scope; did you mean ‘CHECK_OK’? #367

Open
Looong01 opened this issue Jan 10, 2023 · 17 comments

Comments

@Looong01
Copy link

Looong01 commented Jan 10, 2023

When I try to run this command "AMDGFX=gfx1031 BACKEND=c-rocm_win64 Antares torch-setup" to Setup Plugin for Pytorch, it returned an error: error: ‘CHECK_EQ’ was not declared in this scope; did you mean ‘CHECK_OK’?

And there are also many other errors when compile this.

My gcc version is 9.4.0 and Ubuntu is 20.04.1

These are some screenshots of the errors:
image

image

image

@Looong01
Copy link
Author

Should I upgrade my gcc version up to gcc-11 or gcc-12?

@ghostplant
Copy link
Contributor

Hi, antares is a compiler that can make your custom DNN computation (e.g. matmul/..) runnable on Windows ROCm. You can follow examples below to see how antares work for Windows ROCm:

# Save Runnable Source code as file
BACKEND=c-rocm_win64 antares save ./kernel_example.cpp

# Reproduce kernel evaluation based on an early saved source code:
BACKEND=c-rocm_win64 antares eval ./kernel_example.cpp

# Freeze kernels and compiled into edge-side binaries:
BACKEND=c-rocm_win64 antares compile ./kernel_example.cpp ./output-dest/
# Build solution in destination directory:
cd ./output-dest && make

@Looong01
Copy link
Author

Looong01 commented Jan 10, 2023

Hi, Antares is a compiler that can make your custom DNN computation (e.g. matmul/..) runnable on Windows ROCm. You can follow examples below to see how antares work for Windows ROCm:

# Save Runnable Source code as file
BACKEND=c-rocm_win64 antares save ./kernel_example.cpp

# Reproduce kernel evaluation based on an early saved source code:
BACKEND=c-rocm_win64 antares eval ./kernel_example.cpp

# Freeze kernels and compiled into edge-side binaries:
BACKEND=c-rocm_win64 antares compile ./kernel_example.cpp ./output-dest/
# Build solution in destination directory:
cd ./output-dest && make

Hi, how can I solve this error: "error: ‘CHECK_EQ’ was not declared in this scope; did you mean ‘CHECK_OK’?", when I use "AMDGFX=gfx1031 BACKEND=c-rocm_win64 Antares torch-setup"?

@Looong01
Copy link
Author

Besides, your command returned this error:
image

@ghostplant
Copy link
Contributor

Oh, you need export AMDGFX=gfx1031 for your GPU model.

@Looong01
Copy link
Author

Looong01 commented Jan 11, 2023

Oh, you need export AMDGFX=gfx1031 for your GPU model.

And how can I solve this error: "error: ‘CHECK_EQ’ was not declared in this scope; did you mean ‘CHECK_OK’?", when I use "AMDGFX=gfx1031 BACKEND=c-rocm_win64 Antares torch-setup"?

I have upgrade my gcc and g++ and g++-mingw-w64-x86-64 to version 11 that supports C++17.
But it still gave many errors when I setup Antares plugin for pytorch.

(All the errors came from the backend.hpp of Antares.)

I'll be happy to hear from you!
Thanks a lot!

@ghostplant
Copy link
Contributor

antares torch-setup is only for "Pytorch CPU/CUDA/ROCm for Linux", since no such Pytorch ROCm build for Windows exists for Antares to be as its plugin, even though Antares itself can produce user-defined standalone Windows ROCm kernels & executable that is runnable on Windows without depending on Pytorch.

@Looong01
Copy link
Author

antares torch-setup is only for "Pytorch CPU/CUDA/ROCm for Linux", since no such Pytorch ROCm build for Windows exists for Antares to be as its plugin, even though Antares itself can produce user-defined standalone Windows ROCm kernels & executable that is runnable on Windows without depending on Pytorch.

So, I still cannot run PyTorch ROCm version in WSL2 with Antares?

@ghostplant
Copy link
Contributor

You can run custom computation with ROCm, but cannot run Linux-based Pytorch ROCm,

@ghostplant
Copy link
Contributor

ghostplant commented Jan 11, 2023

Public Pytorch ROCm for Linux doesn't contain GPU codes for gfx1031, so it is impossible for you to use it in this way.
We're going to publish "Antares plugin for Pytorch CPU for Windows to extend ROCm ops", as this is possible to make native Windows Pytorch to utilize ROCm gfx1031 without WSL needed. But every operator computation has to be customized and generated by you according to standard Antares usage.

@Looong01
Copy link
Author

Public Pytorch ROCm for Linux doesn't contain GPU codes for gfx1031, so it is impossible for you to use it in this way. We're going to publish "Antares plugin for Pytorch CPU for Windows to extend ROCm ops", as this is possible to make native Windows Pytorch to utilize ROCm gfx1031 without WSL needed. But every operator computation has to be customized and generated by you according to standard Antares usage.

I noticed another program of Microsoft, PyTorch-DirectML, which can allow me to run PyTorch on AMD GPU. But it does not support many operators. For example, it does not support "aten::index_select" when I run a seq2seq model for the first time. And after 6 months I submitted an issue to them, they upgraded their version and support it now. As I ran seq2seq again, it returned it does not support another one, "aten::scatter_add.out". It really exhausts me.

You said, "every operator computation has to be customized and generated by you according to standard Antares usage.".
Do you mean that I had to override all the operators of PyTorch when I want to use it?

Will "Antares plugin for Pytorch CPU for Windows" support all the native and original PyTorch operators?

@Looong01
Copy link
Author

Public Pytorch ROCm for Linux doesn't contain GPU codes for gfx1031, so it is impossible for you to use it in this way. We're going to publish "Antares plugin for Pytorch CPU for Windows to extend ROCm ops", as this is possible to make native Windows Pytorch to utilize ROCm gfx1031 without WSL needed. But every operator computation has to be customized and generated by you according to standard Antares usage.

Besides, you said that "Public Pytorch ROCm for Linux doesn't contain GPU codes for gfx1031".
So, if gfx1030 GPU (RX 6800) substitutes for my gfx1031 GPU (RX 6700XT), will it work? I know ROCm supports gfx1030 natively.

@ghostplant
Copy link
Contributor

Public Pytorch ROCm for Linux doesn't contain GPU codes for gfx1031, so it is impossible for you to use it in this way. We're going to publish "Antares plugin for Pytorch CPU for Windows to extend ROCm ops", as this is possible to make native Windows Pytorch to utilize ROCm gfx1031 without WSL needed. But every operator computation has to be customized and generated by you according to standard Antares usage.

Besides, you said that "Public Pytorch ROCm for Linux doesn't contain GPU codes for gfx1031". So, if gfx1030 GPU (RX 6800) substitutes for my gfx1031 GPU (RX 6700XT), will it work? I know ROCm supports gfx1030 natively.

If you install a prebuilt Pytorch ROCm with gfx1030 bincode included, it should be possible by a virtual stack between WSL and Windows ROCm driver, but it is not relevant to Antares.

@ghostplant
Copy link
Contributor

ghostplant commented Jan 11, 2023

Public Pytorch ROCm for Linux doesn't contain GPU codes for gfx1031, so it is impossible for you to use it in this way. We're going to publish "Antares plugin for Pytorch CPU for Windows to extend ROCm ops", as this is possible to make native Windows Pytorch to utilize ROCm gfx1031 without WSL needed. But every operator computation has to be customized and generated by you according to standard Antares usage.

I noticed another program of Microsoft, PyTorch-DirectML, which can allow me to run PyTorch on AMD GPU. But it does not support many operators. For example, it does not support "aten::index_select" when I run a seq2seq model for the first time. And after 6 months I submitted an issue to them, they upgraded their version and support it now. As I ran seq2seq again, it returned it does not support another one, "aten::scatter_add.out". It really exhausts me.

You said, "every operator computation has to be customized and generated by you according to standard Antares usage.". Do you mean that I had to override all the operators of PyTorch when I want to use it?

Will "Antares plugin for Pytorch CPU for Windows" support all the native and original PyTorch operators?

Yes, DirectML lacks many ops, and it should be the same for Antares, but Antares allows yourself to extend those missing ops, instead of waiting for DirectML developers to do this extension.

@Looong01
Copy link
Author

Looong01 commented Jan 11, 2023

Public Pytorch ROCm for Linux doesn't contain GPU codes for gfx1031, so it is impossible for you to use it in this way. We're going to publish "Antares plugin for Pytorch CPU for Windows to extend ROCm ops", as this is possible to make native Windows Pytorch to utilize ROCm gfx1031 without WSL needed. But every operator computation has to be customized and generated by you according to standard Antares usage.

Besides, you said that "Public Pytorch ROCm for Linux doesn't contain GPU codes for gfx1031". So, if gfx1030 GPU (RX 6800) substitutes for my gfx1031 GPU (RX 6700XT), will it work? I know ROCm supports gfx1030 natively.

If you install a prebuilt Pytorch ROCm with gfx1030 bincode included, it should be possible by a virtual stack between WSL and Windows ROCm driver, but it is not relevant to Antares.

So, you mean ROCm or PyTorch ROCm natively supports WSL with gfx1030?

And the last question: What is antares torch-setup used for? What can I do with it?

@ghostplant
Copy link
Contributor

ghostplant commented Jan 11, 2023

So, you mean ROCm or PyTorch ROCm natively supports WSL with gfx1030?

  • Nop, you still a virtual stack, and I think no one has time to develop this currently.

And the last question: What is antares torch-setup used for? What can I do with it?

  • Previous antares torch-setup is for Pytorch Linux only. In WSL environment, you Pytorch usually enable CPU device only, so antares torch-setup can extend CPU ops for that Pytorch.

@Looong01
Copy link
Author

So, you mean ROCm or PyTorch ROCm natively supports WSL with gfx1030?

  • Nop, you still a virtual stack, and I think no one has time to develop this currently.

And the last question: What is antares torch-setup used for? What can I do with it?

  • antares torch-setup is for Pytorch Linux only. In WSL environment, you Pytorch usually enable CPU device only, so antares torch-setup can extend CPU ops for that Pytorch.

Virtual stack? Like GPU-PV on Hyper-V that the virtual machine can use GPU directly? I have tried it, but it failed. It seems that Cross-OS GPU-PV does not exist (physical machine is Windows, and virtual machine is Ubuntu)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants