Skip to content

Update PyTorch example to skip using a custom stream adaptor #1083

Description

@leofang

The upstream has implemented __cuda_stream__ support 🎉
pytorch/pytorch#163614
Once a new release of PyTorch is out, we can update our example and check if the custom adapter is still needed, or if we can use the built-in support:

# Create a wrapper class that implements __cuda_stream__
class PyTorchStreamWrapper:
def __init__(self, pt_stream):
self.pt_stream = pt_stream
def __cuda_stream__(self):
stream_id = self.pt_stream.cuda_stream
return (0, stream_id) # Return format required by CUDA Python
s = dev.create_stream(PyTorchStreamWrapper(pt_stream))

Activity

  1. added this to the cuda.core parking lot milestone on Oct 3, 2025
  2. added
    cuda.coreEverything related to the cuda.core module
    blockedThis task is currently blocked by other tasks
    exampleImprovements or additions to code examples
    P1Medium priority - Should do
    and removed
    P0High priority - Must do!
    on Oct 3, 2025
  3. added
    cuda.coreEverything related to the cuda.core module
    and removed
    cuda.coreEverything related to the cuda.core module
    on Apr 2, 2026
  4. removed this from the cuda.core backlog milestone on Apr 2, 2026
  5. added this to the cuda.core next milestone on Jul 6, 2026
  6. self-assigned this
    on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1Medium priority - Should doblockedThis task is currently blocked by other taskscuda.coreEverything related to the cuda.core moduleexampleImprovements or additions to code examples

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions