Add Neuron-optimized files for microsoft/Phi-3-mini-128k-instruct
Browse files🤖 Neuron Export Bot: Adding AWS Neuron-optimized model files.
Original model: [microsoft/Phi-3-mini-128k-instruct](https://huggingface.co/microsoft/Phi-3-mini-128k-instruct)
Task: text-generation
Generated by: [badaoui](https://huggingface.co/badaoui)
Generated using: [Optimum Neuron Compiler Space](https://huggingface.co/spaces/optimum/neuron-export)
These files have been pre-compiled for AWS Neuron devices (Inferentia/Trainium) and should provide improved inference performance.
- README.md +38 -0
- config.json +138 -0
- model.pt +3 -0
- neuron_config.json +43 -0
README.md
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- neuron
|
4 |
+
- optimized
|
5 |
+
- aws-neuron
|
6 |
+
- text-generation
|
7 |
+
base_model: microsoft/Phi-3-mini-128k-instruct
|
8 |
+
---
|
9 |
+
|
10 |
+
# Neuron-Optimized microsoft/Phi-3-mini-128k-instruct
|
11 |
+
|
12 |
+
This repository contains AWS Neuron-optimized files for [microsoft/Phi-3-mini-128k-instruct](https://huggingface.co/microsoft/Phi-3-mini-128k-instruct).
|
13 |
+
|
14 |
+
## Model Details
|
15 |
+
|
16 |
+
- **Base Model**: [microsoft/Phi-3-mini-128k-instruct](https://huggingface.co/microsoft/Phi-3-mini-128k-instruct)
|
17 |
+
- **Task**: text-generation
|
18 |
+
- **Optimization**: AWS Neuron compilation
|
19 |
+
- **Generated by**: [badaoui](https://huggingface.co/badaoui)
|
20 |
+
- **Generated using**: [Optimum Neuron Compiler Space](https://huggingface.co/spaces/optimum/neuron-export)
|
21 |
+
|
22 |
+
## Usage
|
23 |
+
|
24 |
+
This model has been optimized for AWS Neuron devices (Inferentia/Trainium). To use it:
|
25 |
+
|
26 |
+
```python
|
27 |
+
from optimum.neuron import NeuronModelForCausalLM
|
28 |
+
|
29 |
+
model = NeuronModelForCausalLM.from_pretrained("badaoui/microsoft-Phi-3-mini-128k-instruct-neuron")
|
30 |
+
```
|
31 |
+
|
32 |
+
## Performance
|
33 |
+
|
34 |
+
These files are pre-compiled for AWS Neuron devices and should provide improved inference performance compared to the original model when deployed on Inferentia or Trainium instances.
|
35 |
+
|
36 |
+
## Original Model
|
37 |
+
|
38 |
+
For the original model, training details, and more information, please visit: [microsoft/Phi-3-mini-128k-instruct](https://huggingface.co/microsoft/Phi-3-mini-128k-instruct)
|
config.json
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"Phi3ForCausalLM"
|
4 |
+
],
|
5 |
+
"attention_bias": false,
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"auto_map": {
|
8 |
+
"AutoConfig": "microsoft/Phi-3-mini-128k-instruct--configuration_phi3.Phi3Config",
|
9 |
+
"AutoModelForCausalLM": "microsoft/Phi-3-mini-128k-instruct--modeling_phi3.Phi3ForCausalLM"
|
10 |
+
},
|
11 |
+
"bos_token_id": 1,
|
12 |
+
"embd_pdrop": 0.0,
|
13 |
+
"eos_token_id": 32000,
|
14 |
+
"hidden_act": "silu",
|
15 |
+
"hidden_size": 3072,
|
16 |
+
"initializer_range": 0.02,
|
17 |
+
"intermediate_size": 8192,
|
18 |
+
"max_position_embeddings": 131072,
|
19 |
+
"model_type": "phi3",
|
20 |
+
"num_attention_heads": 32,
|
21 |
+
"num_hidden_layers": 32,
|
22 |
+
"num_key_value_heads": 32,
|
23 |
+
"original_max_position_embeddings": 4096,
|
24 |
+
"pad_token_id": 32000,
|
25 |
+
"partial_rotary_factor": 1.0,
|
26 |
+
"resid_pdrop": 0.0,
|
27 |
+
"rms_norm_eps": 1e-05,
|
28 |
+
"rope_scaling": {
|
29 |
+
"long_factor": [
|
30 |
+
1.0700000524520874,
|
31 |
+
1.1200000047683716,
|
32 |
+
1.149999976158142,
|
33 |
+
1.4199999570846558,
|
34 |
+
1.5699999332427979,
|
35 |
+
1.7999999523162842,
|
36 |
+
2.129999876022339,
|
37 |
+
2.129999876022339,
|
38 |
+
3.009999990463257,
|
39 |
+
5.910000324249268,
|
40 |
+
6.950000286102295,
|
41 |
+
9.070000648498535,
|
42 |
+
9.930000305175781,
|
43 |
+
10.710000038146973,
|
44 |
+
11.130000114440918,
|
45 |
+
14.609999656677246,
|
46 |
+
15.409998893737793,
|
47 |
+
19.809999465942383,
|
48 |
+
37.279998779296875,
|
49 |
+
38.279998779296875,
|
50 |
+
38.599998474121094,
|
51 |
+
40.12000274658203,
|
52 |
+
46.20000457763672,
|
53 |
+
50.940006256103516,
|
54 |
+
53.66000747680664,
|
55 |
+
54.9373893737793,
|
56 |
+
56.89738845825195,
|
57 |
+
57.28738784790039,
|
58 |
+
59.98738479614258,
|
59 |
+
60.86738586425781,
|
60 |
+
60.887386322021484,
|
61 |
+
61.71739196777344,
|
62 |
+
62.91739273071289,
|
63 |
+
62.957393646240234,
|
64 |
+
63.41739273071289,
|
65 |
+
63.8173942565918,
|
66 |
+
63.83739471435547,
|
67 |
+
63.897396087646484,
|
68 |
+
63.93739700317383,
|
69 |
+
64.06739807128906,
|
70 |
+
64.11434936523438,
|
71 |
+
64.12435150146484,
|
72 |
+
64.15435028076172,
|
73 |
+
64.19435119628906,
|
74 |
+
64.24435424804688,
|
75 |
+
64.57435607910156,
|
76 |
+
64.69000244140625,
|
77 |
+
64.76000213623047
|
78 |
+
],
|
79 |
+
"short_factor": [
|
80 |
+
1.1,
|
81 |
+
1.1,
|
82 |
+
1.1,
|
83 |
+
1.3000000000000003,
|
84 |
+
1.3500000000000003,
|
85 |
+
1.3500000000000003,
|
86 |
+
1.4000000000000004,
|
87 |
+
1.5500000000000005,
|
88 |
+
2.000000000000001,
|
89 |
+
2.000000000000001,
|
90 |
+
2.000000000000001,
|
91 |
+
2.000000000000001,
|
92 |
+
2.000000000000001,
|
93 |
+
2.000000000000001,
|
94 |
+
2.000000000000001,
|
95 |
+
2.000000000000001,
|
96 |
+
2.000000000000001,
|
97 |
+
2.000000000000001,
|
98 |
+
2.000000000000001,
|
99 |
+
2.000000000000001,
|
100 |
+
2.000000000000001,
|
101 |
+
2.000000000000001,
|
102 |
+
2.000000000000001,
|
103 |
+
2.000000000000001,
|
104 |
+
2.000000000000001,
|
105 |
+
2.0500000000000007,
|
106 |
+
2.0500000000000007,
|
107 |
+
2.0500000000000007,
|
108 |
+
2.0500000000000007,
|
109 |
+
2.0500000000000007,
|
110 |
+
2.0500000000000007,
|
111 |
+
2.1000000000000005,
|
112 |
+
2.1000000000000005,
|
113 |
+
2.1500000000000004,
|
114 |
+
2.25,
|
115 |
+
2.25,
|
116 |
+
2.25,
|
117 |
+
2.25,
|
118 |
+
2.25,
|
119 |
+
2.3999999999999995,
|
120 |
+
2.4499999999999993,
|
121 |
+
2.499999999999999,
|
122 |
+
2.6999999999999984,
|
123 |
+
2.6999999999999984,
|
124 |
+
2.7499999999999982,
|
125 |
+
2.799999999999998,
|
126 |
+
2.8999999999999977,
|
127 |
+
3.049999999999997
|
128 |
+
],
|
129 |
+
"type": "longrope"
|
130 |
+
},
|
131 |
+
"rope_theta": 10000.0,
|
132 |
+
"sliding_window": 262144,
|
133 |
+
"tie_word_embeddings": false,
|
134 |
+
"torch_dtype": "bfloat16",
|
135 |
+
"transformers_version": "4.51.3",
|
136 |
+
"use_cache": true,
|
137 |
+
"vocab_size": 32064
|
138 |
+
}
|
model.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d441dca8eb2103b57a5b71b057143c66da6026bdea0f371724c06769d07b3cdc
|
3 |
+
size 8013157559
|
neuron_config.json
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_serialized_key": "NxDNeuronConfig",
|
3 |
+
"async_mode": false,
|
4 |
+
"attn_kernel_enabled": false,
|
5 |
+
"batch_size": 1,
|
6 |
+
"capacity_factor": null,
|
7 |
+
"cc_pipeline_tiling_factor": 2,
|
8 |
+
"checkpoint_id": "microsoft/Phi-3-mini-128k-instruct",
|
9 |
+
"checkpoint_revision": "072cb7562cb8c4adf682a8e186aaafa49469eb5d",
|
10 |
+
"continuous_batching": false,
|
11 |
+
"enable_bucketing": false,
|
12 |
+
"ep_degree": 1,
|
13 |
+
"flash_decoding_enabled": false,
|
14 |
+
"fused_qkv": true,
|
15 |
+
"glu_mlp": true,
|
16 |
+
"is_chunked_prefill": false,
|
17 |
+
"local_ranks_size": 12,
|
18 |
+
"logical_nc_config": 1,
|
19 |
+
"max_batch_size": 1,
|
20 |
+
"max_context_length": 128,
|
21 |
+
"max_topk": 256,
|
22 |
+
"mlp_kernel_enabled": false,
|
23 |
+
"mlp_kernel_fuse_residual_add": false,
|
24 |
+
"n_active_tokens": 128,
|
25 |
+
"neuronxcc_version": "2.19.8089.0+8ab9f450",
|
26 |
+
"num_cores_per_group": 1,
|
27 |
+
"on_device_sampling": true,
|
28 |
+
"optimum_neuron_version": "0.3.0",
|
29 |
+
"output_logits": false,
|
30 |
+
"padding_side": "right",
|
31 |
+
"pp_degree": 1,
|
32 |
+
"qk_layernorm": false,
|
33 |
+
"qkv_kernel_enabled": false,
|
34 |
+
"rpl_reduce_dtype": "bfloat16",
|
35 |
+
"sequence_length": 128,
|
36 |
+
"sequence_parallel_enabled": false,
|
37 |
+
"speculation_length": 0,
|
38 |
+
"start_rank_id": 0,
|
39 |
+
"target": null,
|
40 |
+
"torch_dtype": "bfloat16",
|
41 |
+
"tp_degree": 12,
|
42 |
+
"vocab_parallel": false
|
43 |
+
}
|