Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions torchtitan/distributed/deepep/hybridep.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@

import torch
import torch.distributed as dist
from torch._library.opaque_object import OpaqueBase, register_opaque_type
from torch._custom_class_base import CustomClassBase
from torch._library.opaque_object import register_custom_class

from torchtitan.tools.logging import logger

_buffer: Any = None # Global buffer instance


class DispatchHandle(OpaqueBase):
class DispatchHandle(CustomClassBase):
"""Opaque wrapper for HybridEP dispatch handle.
Wraps the deep_ep dispatch handle as an opaque type so it can be returned
Expand Down Expand Up @@ -58,7 +59,7 @@ def __fx_repr__(self):
return "DispatchHandle()", {"DispatchHandle": DispatchHandle}


register_opaque_type(DispatchHandle, typ="reference")
register_custom_class(DispatchHandle, typ="reference")


@dataclass
Expand Down
Loading