README.md 969 Bytes
Newer Older
PanZezhong's avatar
PanZezhong committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# InfiniCore-Infer

本项目是基于 [`InfiniCore`](https://github.com/InfiniTensor/InfiniCore) 的推理引擎。

## 使用方式

- 编译并安装 `InfiniCore` 。注意根据提示设置好 `INFINI_ROOT` 环境变量(默认为 `$HOME/.infini`)。

- 编译并安装 `InfiniCore-Infer`

```bash
xmake && xmake install
```

- 运行模型推理测试

```bash
PanZezhong's avatar
PanZezhong committed
18
python scripts/jiuge.py [--cpu | --nvidia | --cambricon | --ascend | --metax | --moore] path/to/model_dir [n_device]
PanZezhong's avatar
PanZezhong committed
19
20
21
22
23
```

- 部署模型推理服务

```bash
PanZezhong's avatar
PanZezhong committed
24
25
26
27
28
29
30
31
32
33
34
35
36
python scripts/launch_server.py --model-path MODEL_PATH [-h] [--dev {cpu,nvidia,cambricon,ascend,metax,moore}] [--ndev NDEV] [--max-batch MAX_BATCH] [--max-tokens MAX_TOKENS]
```

- 测试模型推理服务性能

```bash
python scripts/test_perf.py 
```

- 使用推理服务测试模型困惑度(Perplexity)

```bash
python scripts/test_ppl.py --model-path MODEL_PATH [--ndev NDEV] [--max-batch MAX_BATCH] [--max-tokens MAX_TOKENS]
PanZezhong's avatar
PanZezhong committed
37
```