README.md 1.53 KB
Newer Older
gaoqiong's avatar
gaoqiong committed
1
2
3
4
5
6
7
8
9
10
11
# <div align="center"><strong>AutoAWQ_kernel</strong></div>
## 简介
AutoAWQ_kernel是一个从AutoAWQ分离出来的一个组件,以减少编译时间
## 安装

### 使用源码编译方式安装

#### 编译环境准备
下载光源的镜像,起dcoker

```
gaoqiong's avatar
gaoqiong committed
12
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-ubuntu20.04-dtk24.04.1-py3.10   
gaoqiong's avatar
gaoqiong committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26

# <Image ID>用上面拉取docker镜像的ID替换
# <Host Path>主机端路径
# <Container Path>容器映射路径
docker run -it --name baichuan --shm-size=1024G -v /opt/hyhal:/opt/hyhal:ro --device=/dev/kfd --device=/dev/dri/ --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --ulimit memlock=-1:-1 --ipc=host --network host --group-add video -v <Host Path>:<Container Path> <Image ID> /bin/bash
```
注:
1、docker启动  -v /opt/hyhal:/opt/hyhal  这个变量不能少             

#### 源码编译安装
- 代码下载
根据不同的需求下载不同的分支
- 提供2种源码编译方式(进入AutoAWQ目录):
```
gaoqiong's avatar
gaoqiong committed
27
export LD_LIBRARY_PATH=/usr/local/lib/python3.10/site-packages/torch/lib:$LD_LIBRARY_PATH
yangql's avatar
yangql committed
28
pip install -r requirements.txt
gaoqiong's avatar
gaoqiong committed
29
#源码编译安装
gaoqiong's avatar
gaoqiong committed
30
pip3 install e .
gaoqiong's avatar
gaoqiong committed
31

gaoqiong's avatar
gaoqiong committed
32
#编译成whl包安装
gaoqiong's avatar
gaoqiong committed
33
34
35
36
37
# 安装wheel 
python3 setup.py bdist_wheel
cd dist && pip3 install autoawq*
```

gaoqiong's avatar
gaoqiong committed
38
39
40
## 验证
- python -c "import awq_ext; print(awq_ext.__version__)",版本号与官方版本同步,查询该软件的版本号,例如0.0.6;

gaoqiong's avatar
gaoqiong committed
41
42
43
## 参考资料
- [README](README.md)
- [https://github.com/casper-hansen/AutoAWQ_kernels](https://github.com/casper-hansen/AutoAWQ_kernels.git)
gaoqiong's avatar
gaoqiong committed
44