Add Neuron-optimized files for HuggingFaceTB/SmolLM2-135M-Instruct
Browse files🤖 Neuron Export Bot: Adding AWS Neuron-optimized model files.
Original model: [HuggingFaceTB/SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-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 +38 -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: HuggingFaceTB/SmolLM2-135M-Instruct
|
8 |
+
---
|
9 |
+
|
10 |
+
# Neuron-Optimized HuggingFaceTB/SmolLM2-135M-Instruct
|
11 |
+
|
12 |
+
This repository contains AWS Neuron-optimized files for [HuggingFaceTB/SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct).
|
13 |
+
|
14 |
+
## Model Details
|
15 |
+
|
16 |
+
- **Base Model**: [HuggingFaceTB/SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-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/HuggingFaceTB-SmolLM2-135M-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: [HuggingFaceTB/SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct)
|
config.json
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"LlamaForCausalLM"
|
4 |
+
],
|
5 |
+
"attention_bias": false,
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"bos_token_id": 1,
|
8 |
+
"eos_token_id": 2,
|
9 |
+
"head_dim": 64,
|
10 |
+
"hidden_act": "silu",
|
11 |
+
"hidden_size": 576,
|
12 |
+
"initializer_range": 0.041666666666666664,
|
13 |
+
"intermediate_size": 1536,
|
14 |
+
"is_llama_config": true,
|
15 |
+
"max_position_embeddings": 8192,
|
16 |
+
"mlp_bias": false,
|
17 |
+
"model_type": "llama",
|
18 |
+
"num_attention_heads": 9,
|
19 |
+
"num_hidden_layers": 30,
|
20 |
+
"num_key_value_heads": 3,
|
21 |
+
"pad_token_id": 2,
|
22 |
+
"pretraining_tp": 1,
|
23 |
+
"rms_norm_eps": 1e-05,
|
24 |
+
"rope_interleaved": false,
|
25 |
+
"rope_scaling": null,
|
26 |
+
"rope_theta": 100000,
|
27 |
+
"tie_word_embeddings": true,
|
28 |
+
"torch_dtype": "bfloat16",
|
29 |
+
"transformers.js_config": {
|
30 |
+
"kv_cache_dtype": {
|
31 |
+
"fp16": "float16",
|
32 |
+
"q4f16": "float16"
|
33 |
+
}
|
34 |
+
},
|
35 |
+
"transformers_version": "4.51.3",
|
36 |
+
"use_cache": true,
|
37 |
+
"vocab_size": 49152
|
38 |
+
}
|
model.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8f5b37356a4446f01c1a67934c484eda83141a55f13c8e1e2bc1b109606cc606
|
3 |
+
size 394670779
|
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": "HuggingFaceTB/SmolLM2-135M-Instruct",
|
9 |
+
"checkpoint_revision": "a91318be21aeaf0879874faa161dcb40c68847e9",
|
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 |
+
}
|