Skip to content
Closed
Changes from 4 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
5 changes: 5 additions & 0 deletions python/sglang/multimodal_gen/runtime/layers/custom_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ def forward_npu(self, *args, **kwargs) -> Any:
# PyTorch-native implementation.
return self.forward_native(*args, **kwargs)

def forward_xpu(self, *args, **kwargs) -> Any:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should not add forward_xpu in the CustomeOp base class. The design is the feature owner will inherit this class and implement the missing APIs. If XPU wants to support, it will be added in the inherited class. Better to add in respective failed instance. Thanks!

# By default, we assume that XPU ops are compatible with the
# PyTorch-native implementation.
return self.forward_native(*args, **kwargs)

def dispatch_forward(self) -> Callable:
if _is_cuda:
return self.forward_cuda
Expand Down
Loading