Co-authored-by: Zhangheng <hzh0425@apache.org> Co-authored-by: yzshi <163985193+Yunzshi310@users.noreply.github.com>
30 lines
1021 B
Python
30 lines
1021 B
Python
"""SAIL device operations for the SRT platform layer.
|
|
|
|
T-HEAD SAIL exposes a CUDA-compatible API through its torch backend, so
|
|
``SailDeviceMixin`` inherits all device ops from ``CudaDeviceMixin`` and
|
|
only overrides identity (``_enum``, ``device_name``).
|
|
"""
|
|
|
|
from sglang.srt.platforms.cuda import CudaDeviceMixin
|
|
from sglang.srt.platforms.device_mixin import PlatformEnum
|
|
from sglang.srt.platforms.interface import PlatformCapabilities, SRTPlatform
|
|
|
|
|
|
class SailDeviceMixin(CudaDeviceMixin):
|
|
"""SAIL device ops — identical surface to CUDA via T-HEAD's torch backend."""
|
|
|
|
_enum: PlatformEnum = PlatformEnum.SAIL
|
|
device_name: str = "sail"
|
|
# device_type stays "cuda" — torch.device("cuda") is the only valid
|
|
# device-type string for SAIL devices in PyTorch.
|
|
|
|
|
|
class SailSRTPlatform(SailDeviceMixin, SRTPlatform):
|
|
"""Default in-tree T-HEAD SAIL SRT platform."""
|
|
|
|
capabilities = PlatformCapabilities(
|
|
supports_triton=True,
|
|
graph_capture=True,
|
|
piecewise_graph=True,
|
|
)
|