diff --git a/python/sglang/jit_kernel/csrc/elementwise/clamp_position.cuh b/python/sglang/jit_kernel/csrc/elementwise/clamp_position.cuh index 963dcba25..0be8d5741 100644 --- a/python/sglang/jit_kernel/csrc/elementwise/clamp_position.cuh +++ b/python/sglang/jit_kernel/csrc/elementwise/clamp_position.cuh @@ -29,7 +29,7 @@ struct ClampPosition { SymbolicSize N = {"num_elements"}; SymbolicDevice device_; - device_.set_options(); + device_.set_options(); TensorMatcher({N}) // .with_dtype() diff --git a/python/sglang/jit_kernel/csrc/elementwise/resolve_future_token_ids.cuh b/python/sglang/jit_kernel/csrc/elementwise/resolve_future_token_ids.cuh index 0ec5d60d7..ef178ba63 100644 --- a/python/sglang/jit_kernel/csrc/elementwise/resolve_future_token_ids.cuh +++ b/python/sglang/jit_kernel/csrc/elementwise/resolve_future_token_ids.cuh @@ -34,7 +34,7 @@ struct ResolveFutureTokenIds { SymbolicSize N = {"num_tokens"}; SymbolicSize M = {"map_size"}; SymbolicDevice device_; - device_.set_options(); + device_.set_options(); TensorMatcher({N}).with_dtype().with_device(device_).verify(input_ids); diff --git a/python/sglang/srt/managers/overlap_utils.py b/python/sglang/srt/managers/overlap_utils.py index ee3886616..fe63502cd 100644 --- a/python/sglang/srt/managers/overlap_utils.py +++ b/python/sglang/srt/managers/overlap_utils.py @@ -6,7 +6,7 @@ from typing import TYPE_CHECKING, Optional import torch from sglang.srt.speculative.spec_utils import spec_need_hidden_states -from sglang.srt.utils import get_compiler_backend, is_cuda, is_hip +from sglang.srt.utils import is_cuda, is_hip if TYPE_CHECKING: from sglang.srt.managers.schedule_batch import ModelWorkerBatch @@ -26,18 +26,12 @@ def _resolve_future_token_ids_native(input_ids, future_token_ids_map): ) -if _is_cuda: +if _is_cuda or _is_hip: from sglang.jit_kernel.resolve_future_token_ids import ( resolve_future_token_ids_cuda, ) _resolve_future_token_ids = resolve_future_token_ids_cuda -elif _is_hip: - _resolve_future_token_ids = torch.compile( - _resolve_future_token_ids_native, - dynamic=True, - backend=get_compiler_backend(), - ) else: _resolve_future_token_ids = _resolve_future_token_ids_native diff --git a/python/sglang/srt/model_executor/forward_batch_info.py b/python/sglang/srt/model_executor/forward_batch_info.py index 027ab6e91..54211238f 100644 --- a/python/sglang/srt/model_executor/forward_batch_info.py +++ b/python/sglang/srt/model_executor/forward_batch_info.py @@ -58,7 +58,6 @@ from sglang.srt.model_executor.forward_batch_deepseek_mha_mixin import ( ) from sglang.srt.server_args import get_global_server_args from sglang.srt.utils import ( - get_compiler_backend, is_cuda, is_hip, is_npu, @@ -1187,13 +1186,9 @@ def _clamp_position_native(seq_lens): return torch.clamp((seq_lens - 1), min=0).to(torch.int64) -if is_cuda(): +if is_cuda() or is_hip(): from sglang.jit_kernel.clamp_position import clamp_position_cuda clamp_position = clamp_position_cuda -elif is_hip(): - clamp_position = torch.compile( - _clamp_position_native, dynamic=True, backend=get_compiler_backend() - ) else: clamp_position = _clamp_position_native