Kernel Library for SGLang
Project description
SGL Kernel
Kernel Library for SGLang
Installation
For CUDA 11.8:
pip3 install sgl-kernel -i https://docs.sglang.ai/whl/cu118
For CUDA 12.1 or CUDA 12.4:
pip3 install sgl-kernel
Developer Guide
Development Environment Setup
Use Docker to set up the development environment. See Docker setup guide.
Create and enter development container:
docker run -itd --shm-size 32g --gpus all -v $HOME/.cache:/root/.cache --ipc=host --name sglang_zhyncs lmsysorg/sglang:dev /bin/zsh
docker exec -it sglang_zhyncs /bin/zsh
Project Structure
Dependencies
Third-party libraries:
Kernel Development
Steps to add a new kernel:
- Implement the kernel in csrc
- Expose the interface in include/sgl_kernel_ops.h
- Create torch extension in csrc/torch_extension.cc
- Update setup.py to include new CUDA source
- Expose Python interface in python
Build & Install
Development build:
make build
Note:
The sgl-kernel
is rapidly evolving. If you experience a compilation failure, try using make rebuild
.
Testing & Benchmarking
- Add pytest tests in tests/
- Add benchmarks using triton benchmark in benchmark/
- Run test suite
Release new version
Update version in pyproject.toml and version.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file sgl_kernel-0.0.5.post3-cp39-abi3-manylinux2014_x86_64.whl
.
File metadata
- Download URL: sgl_kernel-0.0.5.post3-cp39-abi3-manylinux2014_x86_64.whl
- Upload date:
- Size: 13.0 MB
- Tags: CPython 3.9+
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a4e741505fe3b3979ed17ad7fa2fcd04bf04aa52e2c71966eb620d1e69c8238 |
|
MD5 | 5cf52241d64be5d1e1a4430112de107d |
|
BLAKE2b-256 | f4d778a24d78cc9ed3b0e30a2e551c943ba3328880fd3150010427e97e2de743 |