Files
sglang/README.md
2025-09-04 08:34:12 +00:00

56 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# sglang 使用说明
## 简介
SGLang 是一个用于大语言模型LLM和多模态视觉语言模型VLM的快速推理与服务框架。它通过后端运行时与前端语言的协同设计与模型的交互更加高效、可控。
---
## 编译/运行环境准备
## 编译环境准备
下载光源的镜像,启动 docker
```bash
docker pull image.sourcefind.cn:5000/dcu/admin/base/vllm:0.9.2-ubuntu22.04-dtk25.04.1-rc5-rocblas101839-0811-das1.6-py3.10-20250812-beta
# <Image ID> 用上面拉取的 docker 镜像 ID 替换
# <Host Path> 主机端路径
# <Container Path> 容器映射路径
docker run -it --name mydocker --shm-size=1024G -v /opt/hyhal:/opt/hyhal:ro --device=/dev/kfd --device=/dev/dri/ --cap-add=SYS_PTRACE <Image ID> /bin/bash
```
> **注意:**
> 1. `docker run -v /opt/hyhal:/opt/hyhal` 这个参数不能少。
> 2. 若使用 `pip install` 下载较慢,可添加国内源,例如:
> `-i https://pypi.tuna.tsinghua.edu.cn/simple/`
---
## 源码准备GitLab拉取
```bash
git clone https://developer.sourcefind.cn/codes/OpenDAS/sglang
```
---
## 安装步骤
进入sglang目录
### 1. 编译安装sgl-kernel包
```bash
cd sgl-kernel
python setup_hip.py install
```
### 2. 安装sglang Python依赖
```bash
cd ..
pip install -e "python[all_hip]"
```
---