Views
No views yet
| Chips | input size | image num | image encoder | ttft(344 tokens) | w8a16 | CMM | Flash |
|---|---|---|---|---|---|---|---|
| AX650 | 512*512 | 1 | 537 ms | 510 ms | 35.23 tokens/sec | 773 MB | 813MB |
| Chips | input size | image num | image encoder | ttft(656 tokens) | w8a16 | CMM | Flash |
|---|---|---|---|---|---|---|---|
| AX650 | 512*512 | 8 | 832 ms | 1523 ms | 35.32 tokens/sec | 773 MB | 813MB |
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/SmolVLM2-500M-Video-Instruct
2cd AXERA-TECH/SmolVLM2-500M-Video-Instruct
3hf download AXERA-TECH/SmolVLM2-500M-Video-Instruct --local-dir .
4
5# structure of the downloaded files
6tree -L 3
7.
8└── AXERA-TECH
9 └── SmolVLM2-500M-Video-Instruct
10 ├── config.json
11 ├── image.png
12 ├── llama_p128_l0_together.axmodel
13 ...
14 ├── llama_p128_l9_together.axmodel
15 ├── llama_post.axmodel
16 ├── model.embed_tokens.weight.bfloat16.bin
17 ├── post_config.json
18 ├── README.md
19 ├── smolvlm2_tokenizer.txt
20 ├── vision_cache
21 └── vision_model_1x3x512x512_NHwC_U8.axmodel
22
234 directories, 40 files1root@ax650:~# axllm run AXERA-TECH/SmolVLM2-500M-Video-Instruct/
2[I][ Init][ 138]: LLM init start
3tokenizer_type = 1
4 97% | ████████████████████████████████ | 34 / 35 [3.08s<3.17s, 11.03 count/s] init post axmodel ok,remain_cmm(11158 MB)
5[I][ Init][ 199]: max_token_len : 1023
6[I][ Init][ 202]: kv_cache_size : 320, kv_cache_num: 1023
7[I][ Init][ 205]: prefill_token_num : 128
8[I][ Init][ 209]: grp: 1, prefill_max_kv_cache_num : 1
9[I][ Init][ 209]: grp: 2, prefill_max_kv_cache_num : 128
10[I][ Init][ 209]: grp: 3, prefill_max_kv_cache_num : 256
11[I][ Init][ 209]: grp: 4, prefill_max_kv_cache_num : 384
12[I][ Init][ 209]: grp: 5, prefill_max_kv_cache_num : 512
13[I][ Init][ 209]: grp: 6, prefill_max_kv_cache_num : 640
14[I][ Init][ 209]: grp: 7, prefill_max_kv_cache_num : 768
15[I][ Init][ 214]: prefill_max_token_num : 768
16[I][ Init][ 27]: LLaMaEmbedSelector use mmap
17100% | ████████████████████████████████ | 35 / 35 [3.08s<3.08s, 11.35 count/s] embed_selector init ok
18[W][ Init][ 526]: SmolVLM2 vision size override: cfg=448x448 -> model=512x512
19[I][ Init][ 666]: VisionModule init ok: type=SmolVLM2, tokens_per_block=64, embed_size=960, out_dtype=fp32
20[I][ load_config][ 282]: load config:
21{
22 "enable_repetition_penalty": false,
23 "enable_temperature": false,
24 "enable_top_k_sampling": false,
25 "enable_top_p_sampling": false,
26 "penalty_window": 20,
27 "repetition_penalty": 1.2,
28 "temperature": 0.9,
29 "top_k": 10,
30 "top_p": 0.8
31}
32
33[I][ Init][ 272]: LLM init ok
34Type "q" to exit
35Ctrl+c to stop current running
36"reset" to reset kvcache
37"dd" to remove last conversation.
38"pp" to print history.
39VLM enabled: after each prompt, input image path (empty = text-only). Use "video:<frames_dir>" for video.
40----------------------------------------
41prompt >> who are you
42image >>
43[W][ apply_chat_template][ 80]: system content is not supported
44[I][ SetKVCache][ 406]: prefill_grpid:2 kv_cache_num:128 precompute_len:0 input_num_token:11
45[I][ SetKVCache][ 408]: current prefill_max_token_num:768
46[I][ SetKVCache][ 409]: first run
47[I][ Run][ 457]: input token num : 11, prefill_split_num : 1
48[I][ Run][ 497]: prefill chunk p=0 history_len=0 grpid=1 kv_cache_num=0 input_tokens=11
49[I][ Run][ 519]: prefill indices shape: p=0 idx_elems=128 idx_rows=1 pos_rows=0
50[I][ Run][ 627]: ttft: 119.38 ms
51 I'm an AI assistant, I don't have personal experiences or emotions, but I can provide information and answer questions based on my programming and knowledge base.
52
53I was trained on a vast amount of text data, including books, articles, and websites, which enables me to understand and respond to a wide range of questions.
54
55If you have a question or need help with a task, feel free to ask!
56
57[N][ Run][ 709]: hit eos,avg 29.32 token/s
58
59[I][ GetKVCache][ 380]: precompute_len:96, remaining:672
60[W][ apply_chat_template][ 80]: system content is not supported
61prompt >> how many people in the image?
62image >> ./AXERA-TECH/SmolVLM2-500M-Video-Instruct/image.png
63[I][ EncodeForContent][ 994]: vision cache store: ./AXERA-TECH/SmolVLM2-500M-Video-Instruct/image.png
64[W][ apply_chat_template][ 80]: system content is not supported
65[I][ SetKVCache][ 406]: prefill_grpid:5 kv_cache_num:512 precompute_len:96 input_num_token:350
66[I][ SetKVCache][ 408]: current prefill_max_token_num:640
67[I][ Run][ 457]: input token num : 350, prefill_split_num : 3
68[I][ Run][ 497]: prefill chunk p=0 history_len=96 grpid=2 kv_cache_num=128 input_tokens=128
69[I][ Run][ 519]: prefill indices shape: p=0 idx_elems=128 idx_rows=1 pos_rows=0
70[I][ Run][ 497]: prefill chunk p=1 history_len=224 grpid=3 kv_cache_num=256 input_tokens=128
71[I][ Run][ 519]: prefill indices shape: p=1 idx_elems=128 idx_rows=1 pos_rows=0
72[I][ Run][ 497]: prefill chunk p=2 history_len=352 grpid=4 kv_cache_num=384 input_tokens=94
73[I][ Run][ 519]: prefill indices shape: p=2 idx_elems=128 idx_rows=1 pos_rows=0
74[I][ Run][ 627]: ttft: 681.38 ms
75 There are three people in the image.
76
77[N][ Run][ 709]: hit eos,avg 30.19 token/s
78
79[I][ GetKVCache][ 380]: precompute_len:454, remaining:314
80[W][ apply_chat_template][ 80]: system content is not supported
81prompt >> q1root@ax650:~# axllm serve AXERA-TECH/SmolVLM2-500M-Video-Instruct/
2[I][ Init][ 138]: LLM init start
3tokenizer_type = 1
4 97% | ████████████████████████████████ | 34 / 35 [1.91s<1.97s, 17.77 count/s] init post axmodel ok,remain_cmm(11158 MB)
5[I][ Init][ 199]: max_token_len : 1023
6[I][ Init][ 202]: kv_cache_size : 320, kv_cache_num: 1023
7[I][ Init][ 205]: prefill_token_num : 128
8[I][ Init][ 209]: grp: 1, prefill_max_kv_cache_num : 1
9[I][ Init][ 209]: grp: 2, prefill_max_kv_cache_num : 128
10[I][ Init][ 209]: grp: 3, prefill_max_kv_cache_num : 256
11[I][ Init][ 209]: grp: 4, prefill_max_kv_cache_num : 384
12[I][ Init][ 209]: grp: 5, prefill_max_kv_cache_num : 512
13[I][ Init][ 209]: grp: 6, prefill_max_kv_cache_num : 640
14[I][ Init][ 209]: grp: 7, prefill_max_kv_cache_num : 768
15[I][ Init][ 214]: prefill_max_token_num : 768
16[I][ Init][ 27]: LLaMaEmbedSelector use mmap
17100% | ████████████████████████████████ | 35 / 35 [1.91s<1.91s, 18.29 count/s] embed_selector init ok
18[W][ Init][ 526]: SmolVLM2 vision size override: cfg=448x448 -> model=512x512
19[I][ Init][ 666]: VisionModule init ok: type=SmolVLM2, tokens_per_block=64, embed_size=960, out_dtype=fp32
20[I][ load_config][ 282]: load config:
21{
22 "enable_repetition_penalty": false,
23 "enable_temperature": false,
24 "enable_top_k_sampling": false,
25 "enable_top_p_sampling": false,
26 "penalty_window": 20,
27 "repetition_penalty": 1.2,
28 "temperature": 0.9,
29 "top_k": 10,
30 "top_p": 0.8
31}
32
33[I][ Init][ 272]: LLM init ok
34Starting server on port 8000 with model 'AXERA-TECH/SmolVLM2-500M-Video-Instruct'...
35OpenAI API Server starting on http://0.0.0.0:8000
36Max concurrency: 1
37Models: AXERA-TECH/SmolVLM2-500M-Video-Instruct1from openai import OpenAI
2
3API_URL = "http://127.0.0.1:8000/v1"
4MODEL = "AXERA-TECH/SmolVLM2-500M-Video-Instruct"
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/SmolVLM2-500M-Video-Instruct"
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("
24")