diff --git a/python/sglang/srt/layers/activation.py b/python/sglang/srt/layers/activation.py index d1f277319c..42c1143213 100644 --- a/python/sglang/srt/layers/activation.py +++ b/python/sglang/srt/layers/activation.py @@ -290,6 +290,10 @@ class ReLU2(BaseFusedOp): def forward_cuda(self, x: torch.Tensor) -> torch.Tensor: return relu2(x) + def forward_hip(self, x: torch.Tensor) -> torch.Tensor: + # The JIT relu2 kernel is CUDA-only and not imported on ROCm. + return self.forward_native(x) + class QuickGELU(BaseFusedOp): def forward_native(self, x: torch.Tensor) -> torch.Tensor: