murilonwt commited on
Commit
ca7eb84
·
verified ·
1 Parent(s): 65c0bce

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Qwen/Qwen2.5-3B-Instruct
4
+ library_name: vllm
5
+ pipeline_tag: text-generation
6
+ tags:
7
+ - qwen
8
+ - qwen2.5
9
+ - nvfp4
10
+ - nvfp4a16
11
+ - compressed-tensors
12
+ - vllm
13
+ - blackwell
14
+ - rtx-50-series
15
+ - flashattention
16
+ ---
17
+
18
+ # Qwen2.5-3B-Instruct NVFP4A16 — vLLM / RTX 5060 Ti
19
+
20
+ This repository contains a locally quantized **Qwen2.5-3B-Instruct** model using **NVFP4A16 / compressed-tensors** for vLLM inference on NVIDIA Blackwell GPUs.
21
+
22
+ All Linear layers (except `lm_head`) were quantized to NVFP4A16 using `llmcompressor` + `compressed-tensors`.
23
+
24
+ > This model card documents the local quantization and test performed on RTX 5060 Ti 16GB.
25
+
26
+ ## Quantization Summary
27
+
28
+ | Item | Value |
29
+ |---|---|
30
+ | Base model | Qwen/Qwen2.5-3B-Instruct |
31
+ | Architecture | `Qwen2ForCausalLM` |
32
+ | Hidden size | 2048 |
33
+ | Layers | 36 |
34
+ | Attention heads | 16 (KV: 2) |
35
+ | Context length | 32,768 |
36
+ | Vocab size | 151,936 |
37
+ | Quantization format | NVFP4A16 |
38
+ | Compressed size | ~2.7 GB |
39
+ | Quantization config | `compressed-tensors` |
40
+
41
+ ## Tested Hardware
42
+
43
+ | Component | Configuration |
44
+ |---|---|
45
+ | GPU | NVIDIA GeForce RTX 5060 Ti 16 GB |
46
+ | CPU | Intel Xeon E5-2680 v4 |
47
+ | System RAM | 64 GB |
48
+ | Runtime | Docker + NVIDIA Container Runtime |
49
+ | Container image | `vllm/vllm-openai:v0.22.0-ubuntu2404` |
50
+
51
+ ## Suggested vLLM Command
52
+
53
+ ```bash
54
+ vllm serve /models/Qwen2.5-3B-Instruct-NVFP4 \
55
+ --trust-remote-code \
56
+ --served-model-name Qwen2.5-3B \
57
+ --max-model-len 32768 \
58
+ --gpu-memory-utilization 0.93 \
59
+ --max-num-batched-tokens 8192 \
60
+ --max-num-seqs 4 \
61
+ --tensor-parallel-size 1 \
62
+ --enforce-eager \
63
+ --port 8000
64
+ ```
65
+
66
+ ## Status
67
+
68
+ - [x] Quantized to NVFP4A16 (compressed-tensors)
69
+ - [x] Tested on RTX 5060 Ti 16 GB
70
+ - [x] Tested with vLLM v0.22.0 Docker image
71
+ - [x] Loads successfully in vLLM
chat_template.jinja ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0]['role'] == 'system' %}
4
+ {{- messages[0]['content'] }}
5
+ {%- else %}
6
+ {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}
7
+ {%- endif %}
8
+ {{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
9
+ {%- for tool in tools %}
10
+ {{- "\n" }}
11
+ {{- tool | tojson }}
12
+ {%- endfor %}
13
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
14
+ {%- else %}
15
+ {%- if messages[0]['role'] == 'system' %}
16
+ {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
17
+ {%- else %}
18
+ {{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }}
19
+ {%- endif %}
20
+ {%- endif %}
21
+ {%- for message in messages %}
22
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
23
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
24
+ {%- elif message.role == "assistant" %}
25
+ {{- '<|im_start|>' + message.role }}
26
+ {%- if message.content %}
27
+ {{- '\n' + message.content }}
28
+ {%- endif %}
29
+ {%- for tool_call in message.tool_calls %}
30
+ {%- if tool_call.function is defined %}
31
+ {%- set tool_call = tool_call.function %}
32
+ {%- endif %}
33
+ {{- '\n<tool_call>\n{"name": "' }}
34
+ {{- tool_call.name }}
35
+ {{- '", "arguments": ' }}
36
+ {{- tool_call.arguments | tojson }}
37
+ {{- '}\n</tool_call>' }}
38
+ {%- endfor %}
39
+ {{- '<|im_end|>\n' }}
40
+ {%- elif message.role == "tool" %}
41
+ {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
42
+ {{- '<|im_start|>user' }}
43
+ {%- endif %}
44
+ {{- '\n<tool_response>\n' }}
45
+ {{- message.content }}
46
+ {{- '\n</tool_response>' }}
47
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
48
+ {{- '<|im_end|>\n' }}
49
+ {%- endif %}
50
+ {%- endif %}
51
+ {%- endfor %}
52
+ {%- if add_generation_prompt %}
53
+ {{- '<|im_start|>assistant\n' }}
54
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen2ForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 151643,
7
+ "dtype": "bfloat16",
8
+ "eos_token_id": 151645,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 2048,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 11008,
13
+ "layer_types": [
14
+ "full_attention",
15
+ "full_attention",
16
+ "full_attention",
17
+ "full_attention",
18
+ "full_attention",
19
+ "full_attention",
20
+ "full_attention",
21
+ "full_attention",
22
+ "full_attention",
23
+ "full_attention",
24
+ "full_attention",
25
+ "full_attention",
26
+ "full_attention",
27
+ "full_attention",
28
+ "full_attention",
29
+ "full_attention",
30
+ "full_attention",
31
+ "full_attention",
32
+ "full_attention",
33
+ "full_attention",
34
+ "full_attention",
35
+ "full_attention",
36
+ "full_attention",
37
+ "full_attention",
38
+ "full_attention",
39
+ "full_attention",
40
+ "full_attention",
41
+ "full_attention",
42
+ "full_attention",
43
+ "full_attention",
44
+ "full_attention",
45
+ "full_attention",
46
+ "full_attention",
47
+ "full_attention",
48
+ "full_attention",
49
+ "full_attention"
50
+ ],
51
+ "max_position_embeddings": 32768,
52
+ "max_window_layers": 70,
53
+ "model_type": "qwen2",
54
+ "num_attention_heads": 16,
55
+ "num_hidden_layers": 36,
56
+ "num_key_value_heads": 2,
57
+ "pad_token_id": null,
58
+ "quantization_config": {
59
+ "config_groups": {
60
+ "group_0": {
61
+ "format": "nvfp4-pack-quantized",
62
+ "input_activations": null,
63
+ "output_activations": null,
64
+ "targets": [
65
+ "Linear"
66
+ ],
67
+ "weights": {
68
+ "actorder": null,
69
+ "block_structure": null,
70
+ "dynamic": false,
71
+ "group_size": 16,
72
+ "num_bits": 4,
73
+ "observer": "memoryless_minmax",
74
+ "observer_kwargs": {},
75
+ "scale_dtype": "torch.float8_e4m3fn",
76
+ "strategy": "tensor_group",
77
+ "symmetric": true,
78
+ "type": "float",
79
+ "zp_dtype": null
80
+ }
81
+ }
82
+ },
83
+ "format": "nvfp4-pack-quantized",
84
+ "global_compression_ratio": null,
85
+ "ignore": [
86
+ "lm_head"
87
+ ],
88
+ "kv_cache_scheme": null,
89
+ "quant_method": "compressed-tensors",
90
+ "quantization_status": "compressed",
91
+ "sparsity_config": {},
92
+ "transform_config": {},
93
+ "version": "0.14.0.1"
94
+ },
95
+ "rms_norm_eps": 1e-06,
96
+ "rope_parameters": {
97
+ "rope_theta": 1000000.0,
98
+ "rope_type": "default"
99
+ },
100
+ "sliding_window": null,
101
+ "tie_word_embeddings": true,
102
+ "transformers_version": "5.9.0",
103
+ "use_cache": true,
104
+ "use_sliding_window": false,
105
+ "vocab_size": 151936
106
+ }
generation_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 151643,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 151645,
6
+ 151643
7
+ ],
8
+ "pad_token_id": 151643,
9
+ "repetition_penalty": 1.05,
10
+ "temperature": 0.7,
11
+ "top_k": 20,
12
+ "top_p": 0.8,
13
+ "transformers_version": "5.9.0"
14
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c648fdbae22b41d42fc98909a822fa8ffe51d196252a025781c1d694bb3ae965
3
+ size 2805927416
recipe.yaml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ default_stage:
2
+ default_modifiers:
3
+ QuantizationModifier:
4
+ targets: [Linear]
5
+ ignore: [lm_head]
6
+ scheme: NVFP4A16
7
+ bypass_divisibility_checks: false
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e0069c5cc46024587fffe11fda990002d5e28b9e20a762ff1bb4f2480ce17aa
3
+ size 11422172
tokenizer_config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|im_start|>",
10
+ "<|im_end|>",
11
+ "<|object_ref_start|>",
12
+ "<|object_ref_end|>",
13
+ "<|box_start|>",
14
+ "<|box_end|>",
15
+ "<|quad_start|>",
16
+ "<|quad_end|>",
17
+ "<|vision_start|>",
18
+ "<|vision_end|>",
19
+ "<|vision_pad|>",
20
+ "<|image_pad|>",
21
+ "<|video_pad|>"
22
+ ],
23
+ "is_local": true,
24
+ "local_files_only": false,
25
+ "model_max_length": 131072,
26
+ "pad_token": "<|endoftext|>",
27
+ "split_special_tokens": false,
28
+ "tokenizer_class": "Qwen2Tokenizer",
29
+ "unk_token": null
30
+ }