Views
No views yet
1export FLOAT_MATMUL_USE_CONV_EU=1 # only support AX650, for better performance, please set this env var before running the conversion command.
2
3# context window size 2048, prefill length 1024
4pulsar2 llm_build --input_path Qwen3-1.7B --output_path <your path> \
5--hidden_state_type bf16 --kv_cache_len 2048 --prefill_len 128 --chip AX650 -c 1 --parallel 32 \
6--last_kv_cache_len 128 --last_kv_cache_len 256 --last_kv_cache_len 384 --last_kv_cache_len 512 \
7--last_kv_cache_len 640 --last_kv_cache_len 768 --last_kv_cache_len 896 --last_kv_cache_len 1024 -w s8| Chips | w8a16 | CMM | Flash |
|---|---|---|---|
| AX650 | 8.6 tokens/sec | 2.4 GiB | 2.6GiB |
1git clone -b axllm https://github.com/AXERA-TECH/ax-llm.git
2cd ax-llm
3./install.shaxllm):curl -fsSL https://raw.githubusercontent.com/AXERA-TECH/ax-llm/axllm/install.sh | bashhttps://github.com/AXERA-TECH/ax-llm/actions?query=branch%3Aaxllm
下载 最新 CI 导出的可执行程序(axllm),然后:1chmod +x axllm
2sudo mv axllm /usr/bin/axllm1mkdir -p AXERA-TECH/Qwen3-1.7B
2cd AXERA-TECH/Qwen3-1.7B
3hf download AXERA-TECH/Qwen3-1.7B --local-dir .
4
5# structure of the downloaded files
6tree -L 3
7.
8└── AXERA-TECH
9 └── Qwen3-1.7B
10 ├── README.md
11 ├── config.json
12 ├── model.embed_tokens.weight.bfloat16.bin
13 ├── post_config.json
14 ├── qwen3_p128_l0_together.axmodel
15...
16 ├── qwen3_p128_l9_together.axmodel
17 ├── qwen3_post.axmodel
18 └── qwen3_tokenizer.txt
19
202 directories, 34 files1(base) root@ax650:~# axllm run AXERA-TECH/Qwen3-1.7B/
214:56:46.670 INF Init:890 | LLM init start
3tokenizer_type = 1
4 96% | ############################## | 30 / 31 [3.84s<3.97s, 7.81 count/s] init post axmodel ok,remain_cmm(7523 MB)
514:56:50.510 INF Init:1045 | max_token_len : 2048
614:56:50.510 INF Init:1048 | kv_cache_size : 1024, kv_cache_num: 2048
714:56:50.510 INF init_groups_from_model:606 | prefill_token_num : 128
814:56:50.510 INF init_groups_from_model:820 | decode grp: 0, gid: 0, max_token_len : 2048
914:56:50.510 INF init_groups_from_model:824 | prefill grp: 0, gid: 1, history_cap: 0, total_cap: 128, symbolic_cap: 1
1014:56:50.510 INF init_groups_from_model:824 | prefill grp: 1, gid: 2, history_cap: 128, total_cap: 256, symbolic_cap: 128
1114:56:50.510 INF init_groups_from_model:824 | prefill grp: 2, gid: 3, history_cap: 256, total_cap: 384, symbolic_cap: 256
1214:56:50.510 INF init_groups_from_model:824 | prefill grp: 3, gid: 4, history_cap: 384, total_cap: 512, symbolic_cap: 384
1314:56:50.510 INF init_groups_from_model:824 | prefill grp: 4, gid: 5, history_cap: 512, total_cap: 640, symbolic_cap: 512
1414:56:50.510 INF init_groups_from_model:824 | prefill grp: 5, gid: 6, history_cap: 640, total_cap: 768, symbolic_cap: 640
1514:56:50.510 INF init_groups_from_model:824 | prefill grp: 6, gid: 7, history_cap: 768, total_cap: 896, symbolic_cap: 768
1614:56:50.510 INF init_groups_from_model:824 | prefill grp: 7, gid: 8, history_cap: 896, total_cap: 1024, symbolic_cap: 896
1714:56:50.510 INF init_groups_from_model:824 | prefill grp: 8, gid: 9, history_cap: 1024, total_cap: 1152, symbolic_cap: 1024
1814:56:50.510 INF init_groups_from_model:831 | prefill_max_token_num : 1152
1914:56:50.510 INF Init:27 | LLaMaEmbedSelector use mmap
20100% | ################################ | 31 / 31 [3.84s<3.84s, 8.07 count/s] embed_selector init ok
2114:56:50.511 INF load_config:282 | load config:
2214:56:50.511 INF load_config:282 | {
2314:56:50.511 INF load_config:282 | "enable_repetition_penalty": false,
2414:56:50.511 INF load_config:282 | "enable_temperature": false,
2514:56:50.511 INF load_config:282 | "enable_top_k_sampling": false,
2614:56:50.511 INF load_config:282 | "enable_top_p_sampling": false,
2714:56:50.511 INF load_config:282 | "penalty_window": 20,
2814:56:50.511 INF load_config:282 | "repetition_penalty": 1.2,
2914:56:50.511 INF load_config:282 | "temperature": 0.9,
3014:56:50.511 INF load_config:282 | "top_k": 10,
3114:56:50.511 INF load_config:282 | "top_p": 0.8
3214:56:50.511 INF load_config:282 | }
3314:56:50.511 INF Init:1139 | LLM init ok
34Commands:
35 /q, /exit 退出
36 /reset 重置 kvcache
37 /dd 删除一轮对话
38 /pp 打印历史对话
39Ctrl+C: 停止当前生成
40----------------------------------------
41prompt >> who are you
4214:56:53.365 INF SetKVCache:1437 | decode_grpid:0 prefill_grpid:1 history_cap:0 total_cap:128 symbolic_cap:1 precompute_len:0 input_num_token:22 prefer_symbolic_group:0
4314:56:53.365 INF SetKVCache:1458 | current prefill_max_token_num:1152
4414:56:53.462 INF SetKVCache:1462 | first run
4514:56:53.464 INF Run:1553 | input token num : 22, prefill_split_num : 1
4614:56:53.464 INF Run:1640 | prefill chunk p=0 history_len=0 grpid=1 kv_cache_num=0 input_tokens=22
4714:56:53.465 INF Run:1665 | prefill indices shape: p=0 idx_elems=128 idx_rows=1 pos_rows=0
4814:56:53.656 INF Run:1837 | ttft: 191.80 ms
49<think>
50Okay, the user asked, "Who are you?" I need to respond appropriately. Let me think.
51
52First, I should introduce myself clearly. My name is Assistant, but I should mention that I'm an AI developed by Alibaba Group. That's important to set the context.
53
54Next, I should explain my purpose. I'm here to help with questions, provide information, and assist with tasks. It's important to highlight that I can't perform actions like accessing external data or making decisions, but I can offer help based on the information I have.
55
56I should also mention that I'm designed to be helpful and friendly, but I can't replace real people. It's good to remind the user that if they have specific questions, they should ask directly.
57
58I need to keep the tone friendly and approachable. Avoid technical jargon. Make sure the response is concise but covers all the key points. Let me check if I missed anything. Oh, maybe mention that I can help with various topics, but I can't provide personal advice. That's a good point to include.
59
60Alright, putting it all together in a natural, conversational way.
61</think>
62
63Hello! I'm Assistant, an AI developed by Alibaba Group. I'm here to help with questions, provide information, and assist with tasks. I can't perform actions like accessing external data or making decisions, but I can offer help based on the information I have. I'm designed to be helpful and friendly, but I can't replace real people. If you have specific questions or need assistance, feel free to ask! 😊
64
6514:57:31.019 NTC Run:2102 | hit eos,decode avg 8.59 token/s
6614:57:31.019 INF GetKVCache:1408 | precompute_len:344, remaining:808
67prompt >> /q1(base) root@ax650:~# axllm serve AXERA-TECH/Qwen3-1.7B/
215:00:30.500 INF Init:890 | LLM init start
3tokenizer_type = 1
4 96% | ############################## | 30 / 31 [3.19s<3.29s, 9.42 count/s] init post axmodel ok,remain_cmm(7523 MB)
515:00:33.685 INF Init:1045 | max_token_len : 2048
615:00:33.685 INF Init:1048 | kv_cache_size : 1024, kv_cache_num: 2048
715:00:33.685 INF init_groups_from_model:606 | prefill_token_num : 128
815:00:33.685 INF init_groups_from_model:820 | decode grp: 0, gid: 0, max_token_len : 2048
915:00:33.685 INF init_groups_from_model:824 | prefill grp: 0, gid: 1, history_cap: 0, total_cap: 128, symbolic_cap: 1
1015:00:33.685 INF init_groups_from_model:824 | prefill grp: 1, gid: 2, history_cap: 128, total_cap: 256, symbolic_cap: 128
1115:00:33.685 INF init_groups_from_model:824 | prefill grp: 2, gid: 3, history_cap: 256, total_cap: 384, symbolic_cap: 256
1215:00:33.685 INF init_groups_from_model:824 | prefill grp: 3, gid: 4, history_cap: 384, total_cap: 512, symbolic_cap: 384
1315:00:33.685 INF init_groups_from_model:824 | prefill grp: 4, gid: 5, history_cap: 512, total_cap: 640, symbolic_cap: 512
1415:00:33.685 INF init_groups_from_model:824 | prefill grp: 5, gid: 6, history_cap: 640, total_cap: 768, symbolic_cap: 640
1515:00:33.685 INF init_groups_from_model:824 | prefill grp: 6, gid: 7, history_cap: 768, total_cap: 896, symbolic_cap: 768
1615:00:33.685 INF init_groups_from_model:824 | prefill grp: 7, gid: 8, history_cap: 896, total_cap: 1024, symbolic_cap: 896
1715:00:33.685 INF init_groups_from_model:824 | prefill grp: 8, gid: 9, history_cap: 1024, total_cap: 1152, symbolic_cap: 1024
1815:00:33.686 INF init_groups_from_model:831 | prefill_max_token_num : 1152
1915:00:33.686 INF Init:27 | LLaMaEmbedSelector use mmap
20100% | ################################ | 31 / 31 [3.19s<3.19s, 9.73 count/s] embed_selector init ok
2115:00:33.686 INF load_config:282 | load config:
2215:00:33.686 INF load_config:282 | {
2315:00:33.686 INF load_config:282 | "enable_repetition_penalty": false,
2415:00:33.686 INF load_config:282 | "enable_temperature": false,
2515:00:33.686 INF load_config:282 | "enable_top_k_sampling": false,
2615:00:33.686 INF load_config:282 | "enable_top_p_sampling": false,
2715:00:33.686 INF load_config:282 | "penalty_window": 20,
2815:00:33.686 INF load_config:282 | "repetition_penalty": 1.2,
2915:00:33.686 INF load_config:282 | "temperature": 0.9,
3015:00:33.686 INF load_config:282 | "top_k": 10,
3115:00:33.686 INF load_config:282 | "top_p": 0.8
3215:00:33.686 INF load_config:282 | }
3315:00:33.686 INF Init:1139 | LLM init ok
34Starting server on port 8000 with model 'AXERA-TECH/Qwen3-1.7B'...
35API URLs:
36 GET http://127.0.0.1:8000/health
37 GET http://127.0.0.1:8000/v1/models
38 POST http://127.0.0.1:8000/v1/chat/completions
39 GET http://10.126.29.54:8000/health
40 GET http://10.126.29.54:8000/v1/models
41 POST http://10.126.29.54:8000/v1/chat/completions
42 GET http://172.17.0.1:8000/health
43 GET http://172.17.0.1:8000/v1/models
44 POST http://172.17.0.1:8000/v1/chat/completions
45Aliases:
46 GET http://127.0.0.1:8000/models
47 POST http://127.0.0.1:8000/chat/completions
48 GET http://10.126.29.54:8000/models
49 POST http://10.126.29.54:8000/chat/completions
50 GET http://172.17.0.1:8000/models
51 POST http://172.17.0.1:8000/chat/completions
52OpenAI API Server starting on http://0.0.0.0:8000
53Max concurrency: 1
54Models: AXERA-TECH/Qwen3-1.7B1from openai import OpenAI
2
3API_URL = "http://127.0.0.1:8000/v1"
4MODEL = "AXERA-TECH/Qwen3-1.7B"
5
6messages = [
7 {"role": "system", "content": [{"type": "text", "text": "you are a helpful assistant."}]},
8 {"role": "user", "content": "hello"},
9]
10
11client = OpenAI(api_key="not-needed", base_url=API_URL)
12completion = client.chat.completions.create(
13 model=MODEL,
14 messages=messages,
15)
16
17print(completion.choices[0].message.content)1from openai import OpenAI
2
3API_URL = "http://127.0.0.1:8000/v1"
4MODEL = "AXERA-TECH/Qwen3-1.7B"
5
6messages = [
7 {"role": "system", "content": [{"type": "text", "text": "you are a helpful assistant."}]},
8 {"role": "user", "content": "hello"},
9]
10
11client = OpenAI(api_key="not-needed", base_url=API_URL)
12stream = client.chat.completions.create(
13 model=MODEL,
14 messages=messages,
15 stream=True,
16)
17
18print("assistant:")
19for ev in stream:
20 delta = getattr(ev.choices[0], "delta", None)
21 if delta and getattr(delta, "content", None):
22 print(delta.content, end="", flush=True)
23print("")