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

Not implemented for type Half #49

Open
Stonesjtu opened this issue Nov 14, 2019 · 4 comments
Open

Not implemented for type Half #49

Stonesjtu opened this issue Nov 14, 2019 · 4 comments

Comments

@Stonesjtu
Copy link

I followed the tutorial to create my cpp_extension. But the module failed to do half-precision computation.

It gives:

RuntimeError: "op" not implemented for 'Half' (operator() at /op_cuda_kernel.cu:146)
frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x47 (0x7fa561676687 in /miniconda3/lib/python3.7/site-packages/torch/lib/libc10.so)

When submitting a bug report, please include the following information (where relevant):

  • OS: Centos
  • PyTorch version: 1.3.0
  • How you installed PyTorch (conda, pip, source): conda
  • Python version: 3.7
  • CUDA/cuDNN version: 10/7
  • GPU models and configuration: 1080
  • GCC version (if compiling from source):7.4.0
@soumith
Copy link
Member

soumith commented Nov 15, 2019

cc: @smessmer @ezyang

@ezyang
Copy link

ezyang commented Nov 15, 2019

Can you post your code? EDIT: Oh are you doing the tutorial directly?

@Stonesjtu
Copy link
Author

Yes, I was following the tutorial.
I found that using AT_DISPATCH_FLOATING_TYPES_AND_HALF MACRO should do the magic to support half scalar type, but it is not documented in the tutorial.
Should we add some notes about the different dispatch macros?

@ezyang
Copy link

ezyang commented Nov 19, 2019

cc @gchanan but our dispatch macros are kind of a mess and not really equipped to handle user code (also, it's not always right to use the _AND_HALF macro, so there's some subtlety on when to use things too.)

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

3 participants