Skip to content

[Bug] sgl-kernel needs to be pinned to the PyTorch version used to build it #5247

@zou3519

Description

@zou3519

Checklist

  • 1. I have searched related issues but cannot get the expected help.
  • 2. The bug has not been fixed in the latest version.
  • 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.
  • 4. If the issue you raised is not a bug but a question, please raise a discussion at https://github.com/sgl-project/sglang/discussions/new/choose Otherwise, it will be closed.
  • 5. Please use English, otherwise it will be closed.

Describe the bug

I mentioned this to @zhyncs, but sgl-kernel builds against libtorch. This means that it is only guaranteed to work with the version of PyTorch it is built with (I'm told that the pypi sgl-kernel wheel was built with PyTorch 2.5.1).

I verified locally that the pypi sgl-kernel wheel does not work with PyTorch 2.7 (there are ABI issues), but it seems to work with PyTorch 2.6. In general, sgl-kernel should be pinned against the version of PyTorch it is built with (and if you support multiple versions of PyTorch, then you'll need multiple binaries).

We are working on making this experience more pleasant on the PyTorch side, e.g. allow people to build one single binary that works against all future PyTorch versions (cc @janeyx99).

Reproduction

n/a

Environment

n/a

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions