Add Neuron-optimized files for microsoft/Phi-3-mini-4k-instruct
Browse files🤖 Neuron Export Bot: Adding AWS Neuron-optimized model files.
Original model: [microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-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 +36 -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-4k-instruct
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Neuron-Optimized microsoft/Phi-3-mini-4k-instruct
|
| 11 |
+
|
| 12 |
+
This repository contains AWS Neuron-optimized files for [microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct).
|
| 13 |
+
|
| 14 |
+
## Model Details
|
| 15 |
+
|
| 16 |
+
- **Base Model**: [microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-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-4k-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-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct)
|
config.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Phi3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "microsoft/Phi-3-mini-4k-instruct--configuration_phi3.Phi3Config",
|
| 9 |
+
"AutoModelForCausalLM": "microsoft/Phi-3-mini-4k-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": 4096,
|
| 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": null,
|
| 29 |
+
"rope_theta": 10000.0,
|
| 30 |
+
"sliding_window": 2047,
|
| 31 |
+
"tie_word_embeddings": false,
|
| 32 |
+
"torch_dtype": "bfloat16",
|
| 33 |
+
"transformers_version": "4.51.3",
|
| 34 |
+
"use_cache": true,
|
| 35 |
+
"vocab_size": 32064
|
| 36 |
+
}
|
model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2ea05eef0e85c15cb2a58b01c816b63ad3cb2517647442d9cf45e65014af850a
|
| 3 |
+
size 8013148023
|
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-4k-instruct",
|
| 9 |
+
"checkpoint_revision": "0a67737cc96d2554230f90338b163bc6380a2a85",
|
| 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 |
+
}
|