Skip to content

cpp extension tutorial: not device agnostic? #431

Open
@c-hofer

Description

@c-hofer

Would the kerne calll in lltm_cuda_forward in the tutorial tutorials/advanced_source/cpp_extension.rst fail on multi gpu systems if the inputs are not on the default device, i.e., device:0?

To my understanding, some "magic" takes care of setting the right context if we add functionality do pytorch via custom kernels, see here.
However, it seems like in the tutorial this machinery is not used.
Explicit usage of at::OptionalDeviceGuard should resolve the issue (?) in the tutorial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C++Issues relating to C++ tutorials

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions