Upload New File
This commit is contained in:
55
README.md
Normal file
55
README.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# 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]"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user