{"record":{"id":"b8c463dd6bd157a0","repo":"sgl-project/sglang","slug":"multiplatformop-is-deprecated-subclass-sglang-ker","errorCode":null,"errorMessage":"MultiPlatformOp is deprecated; subclass sglang.kernels.fused_op.BaseFusedOp instead (RFC #29630).","messagePattern":"MultiPlatformOp is deprecated; subclass sglang\\.kernels\\.fused_op\\.BaseFusedOp instead \\(RFC #29630\\)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"python/sglang/srt/layers/utils/multi_platform.py","lineNumber":32,"sourceCode":"\nimport warnings\n\nfrom sglang.kernels.fused_op import BaseFusedOp\n\n\nclass MultiPlatformOp(BaseFusedOp):\n    \"\"\"Deprecated alias of :class:`sglang.kernels.fused_op.BaseFusedOp`.\n\n    Kept attribute-compatible with the original class: ``forward_native`` is\n    concrete here (raising ``NotImplementedError``) so existing plugin\n    subclasses that only define platform forwards keep instantiating, and the\n    old per-platform default methods (``forward_hip`` -> ``forward_cuda``,\n    ``forward_cpu`` -> ``forward_native``, ...) remain callable for plugin\n    code that invokes them directly.\n    \"\"\"\n\n    def __init_subclass__(cls, **kwargs):\n        warnings.warn(\n            \"MultiPlatformOp is deprecated; subclass \"\n            \"sglang.kernels.fused_op.BaseFusedOp instead (RFC #29630).\",\n            DeprecationWarning,\n            stacklevel=2,\n        )\n        super().__init_subclass__(**kwargs)\n\n    def forward_native(self, *args, **kwargs):\n        raise NotImplementedError\n\n    def forward_cuda(self, *args, **kwargs):\n        raise NotImplementedError\n\n    def forward_hip(self, *args, **kwargs):\n        return self.forward_cuda(*args, **kwargs)\n\n    def forward_musa(self, *args, **kwargs):\n        return self.forward_cuda(*args, **kwargs)","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/utils/multi_platform.py#L14-L50","documentation":"DeprecationWarning raised whenever a class subclasses MultiPlatformOp: the multi-platform operator base is being replaced by sglang.kernels.fused_op.BaseFusedOp (RFC #29630). Old per-platform methods (forward_hip→forward_cuda, forward_cpu→forward_native, etc.) remain callable for plugin compatibility.","triggerScenarios":"Defining any `class MyOp(MultiPlatformOp)` — __init_subclass__ fires at class-definition (import) time and warns for every subclass.","commonSituations":"Plugin or downstream operator code subclassing MultiPlatformOp; SGLang's own internal ops until migration completes; upgrading SGLang where the base class was deprecated.","solutions":["Rebase the subclass on sglang.kernels.fused_op.BaseFusedOp and rename platform forward methods to the new scheme","If you invoke forward_hip/forward_cpu directly on other classes, keep callers but plan migration","Check RFC #29630 for the full migration mapping"],"exampleFix":"# before\nclass MyFusedOp(MultiPlatformOp):\n    def forward_hip(self, *args): ...\n# after\nfrom sglang.kernels.fused_op import BaseFusedOp\nclass MyFusedOp(BaseFusedOp):\n    def forward_cuda(self, *args): ...","handlingStrategy":"validation","validationCode":"from sglang.kernels.fused_op import BaseFusedOp  # fails fast if new API absent before subclassing","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Subclass BaseFusedOp for new fused ops","Follow RFC #29630 naming (forward_cuda/forward_native) when porting"],"tags":["deprecation","sglang","operators","subclassing"],"backgroundTag":"deprecated-base-class","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}