初始化项目,由ModelHub XC社区提供模型

Model: sasa2000/granite-3.1-1b-a400m-instruct-reap-pruned-010
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-10-04 04:33:18 +08:00
commit f62aea7931
13 changed files with 294356 additions and 0 deletions

35
.gitattributes vendored Normal file
View File

@@ -0,0 +1,35 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text

45
README.md Normal file
View File

@@ -0,0 +1,45 @@
---
base_model: ibm-granite/granite-3.1-1b-a400m-instruct
pipeline_tag: text-generation
tags:
- granite
- reap
- pruning
- multilingual
license: apache-2.0
---
# Granite 3.1 1B A400M Instruct REAP Pruned Checkpoint
This repository contains a REAP layerwise-pruned checkpoint of
`ibm-granite/granite-3.1-1b-a400m-instruct`.
## Base Model
- Model: `ibm-granite/granite-3.1-1b-a400m-instruct`
- Architecture: `GraniteMoeForCausalLM`
- `num_local_experts=32`
- `num_experts_per_tok=8`
## Pruning Setup
- Dataset: `theblackcat102/evol-codealpaca-v1`
- `model_max_length=2048`
- `batches_per_category=128`
- `batch_size=1`
- `batch_group_size=8`
- `renormalize_router_weights=true`
- `truncate=false`
## Checkpoint
- Requested ratio: `0.10`
- Experts pruned: `3`
- Experts retained: `29`
- Actual ratio: `9.38%`
- Local output dir: `layerwise_reap-renorm_true-seed_42-0.09`
## Provenance
- Created with Codex using GPT-5.5.
- Generated for the REAP pruning experiment log and multilingual evaluation.

5
added_tokens.json Normal file
View File

@@ -0,0 +1,5 @@
{
"<|end_of_role|>": 49153,
"<|start_of_role|>": 49152,
"<|tool_call|>": 49154
}

64
chat_template.jinja Normal file
View File

@@ -0,0 +1,64 @@
{%- if messages[0]['role'] == 'system' %}
{%- set system_message = messages[0]['content'] %}
{%- set loop_messages = messages[1:] %}
{%- else %}
{%- set system_message = "Knowledge Cutoff Date: April 2024.
Today's Date: " + strftime_now('%B %d, %Y') + ".
You are Granite, developed by IBM." %}
{%- if tools and documents %}
{%- set system_message = system_message + " You are a helpful AI assistant with access to the following tools. When a tool is required to answer the user's query, respond with <|tool_call|> followed by a JSON list of tools used. If a tool does not exist in the provided list of tools, notify the user that you do not have the ability to fulfill the request.
Write the response to the user's input by strictly aligning with the facts in the provided documents. If the information needed to answer the question is not available in the documents, inform the user that the question cannot be answered based on the available data." %}
{%- elif tools %}
{%- set system_message = system_message + " You are a helpful AI assistant with access to the following tools. When a tool is required to answer the user's query, respond with <|tool_call|> followed by a JSON list of tools used. If a tool does not exist in the provided list of tools, notify the user that you do not have the ability to fulfill the request." %}
{%- elif documents %}
{%- set system_message = system_message + " Write the response to the user's input by strictly aligning with the facts in the provided documents. If the information needed to answer the question is not available in the documents, inform the user that the question cannot be answered based on the available data." %}
{%- else %}
{%- set system_message = system_message + " You are a helpful AI assistant." %}
{%- endif %}
{%- if 'citations' in controls and documents %}
{%- set system_message = system_message + '
In your response, use the symbols <co> and </co> to indicate when a fact comes from a document in the search result, e.g <co>0</co> for a fact from document 0. Afterwards, list all the citations with their corresponding documents in an ordered list.' %}
{%- endif %}
{%- if 'hallucinations' in controls and documents %}
{%- set system_message = system_message + '
Finally, after the response is written, include a numbered list of sentences from the response that are potentially hallucinated and not based in the documents.' %}
{%- endif %}
{%- set loop_messages = messages %}
{%- endif %}
{{- '<|start_of_role|>system<|end_of_role|>' + system_message + '<|end_of_text|>
' }}
{%- if tools %}
{{- '<|start_of_role|>tools<|end_of_role|>' }}
{{- tools | tojson(indent=4) }}
{{- '<|end_of_text|>
' }}
{%- endif %}
{%- if documents %}
{{- '<|start_of_role|>documents<|end_of_role|>' }}
{%- for document in documents %}
{{- 'Document ' + loop.index0 | string + '
' }}
{{- document['text'] }}
{%- if not loop.last %}
{{- '
'}}
{%- endif%}
{%- endfor %}
{{- '<|end_of_text|>
' }}
{%- endif %}
{%- for message in loop_messages %}
{{- '<|start_of_role|>' + message['role'] + '<|end_of_role|>' + message['content'] + '<|end_of_text|>
' }}
{%- if loop.last and add_generation_prompt %}
{{- '<|start_of_role|>assistant' }}
{%- if controls %}
{{- ' ' + controls | tojson()}}
{%- endif %}
{{- '<|end_of_role|>' }}
{%- endif %}
{%- endfor %}

36
config.json Normal file
View File

@@ -0,0 +1,36 @@
{
"architectures": [
"GraniteMoeForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"attention_multiplier": 0.015625,
"bos_token_id": 0,
"embedding_multiplier": 12.0,
"eos_token_id": 0,
"hidden_act": "silu",
"hidden_size": 1024,
"initializer_range": 0.02,
"intermediate_size": 512,
"logits_scaling": 6.0,
"max_position_embeddings": 131072,
"model_type": "granitemoe",
"num_attention_heads": 16,
"num_experts_per_tok": 8,
"num_hidden_layers": 24,
"num_key_value_heads": 8,
"num_local_experts": 29,
"output_router_logits": false,
"pad_token_id": 0,
"position_embedding_type": "rope",
"residual_multiplier": 0.22,
"rms_norm_eps": 1e-06,
"rope_scaling": null,
"rope_theta": 1500000.0,
"router_aux_loss_coef": 0.0,
"tie_word_embeddings": true,
"torch_dtype": "bfloat16",
"transformers_version": "4.55.0",
"use_cache": true,
"vocab_size": 49155
}

7
generation_config.json Normal file
View File

@@ -0,0 +1,7 @@
{
"_from_model_config": true,
"bos_token_id": 0,
"eos_token_id": 0,
"pad_token_id": 0,
"transformers_version": "4.55.0"
}

48892
merges.txt Normal file

File diff suppressed because it is too large Load Diff

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4360268e6506298981a62f20f8fd5c9004980b90da937544cae9f0929ecc8e57
size 2442643208

81
reap_args.yaml Normal file
View File

@@ -0,0 +1,81 @@
cluster_args:
cluster_description: null
cluster_method: agglomerative
compression_ratio: 0.1
expert_sim: ttm
frequency_penalty: true
linkage_method: average
max_cluster_size: null
multi_layer: null
num_clusters: null
singleton_outlier_experts: false
singleton_super_experts: false
softmax_temperature: null
ds_args:
dataset_config_name: null
dataset_name: theblackcat102/evol-codealpaca-v1
dataset_test_split: test
shuffle: true
split: train
eval_args:
evalplus_tasks:
- mbpp
- humaneval
greedy: true
lm_eval_tasks:
- winogrande
- arc_challenge
- arc_easy
- boolq
- hellaswag
- mmlu
- openbookqa
- rte
min_p: 0.0
parallel_tasks: 32
results_dir: null
run_evalplus: true
run_livecodebench: true
run_lm_eval: true
run_math: false
run_wildbench: false
server_log_file_name: server.log
temperature: 0.7
top_k: 20
top_p: 0.8
use_server: true
vllm_port: 8000
layerwise_args:
batch_group_size: 8
low_cpu_mem_usage: true
save_intermediate: false
model_args:
model_name: ibm-granite/granite-3.1-1b-a400m-instruct
num_experts_per_tok_override: null
obs_args:
batch_size: 1
batches_per_category: 128
distance_measure: angular
model_max_length: 2048
output_file_name: observations_granite_1b_128x2048_reap.pt
overwrite_observations: false
record_pruning_metrics_only: true
renormalize_router_weights: true
return_vllm_tokens_prompt: false
select_only_categories: null
split_by_category: false
truncate: false
prune_args:
n_experts_to_prune: null
overwrite_pruned_model: false
perserve_outliers: false
perserve_super_experts: false
prune_method: reap
reap_args:
debug: false
do_eval: false
plot_clusters: false
profile: true
run_observer_only: false
seed: 42
smoke_test: false

35
special_tokens_map.json Normal file
View File

@@ -0,0 +1,35 @@
{
"additional_special_tokens": [
"<|start_of_role|>",
"<|end_of_role|>",
"<|tool_call|>"
],
"bos_token": {
"content": "<|end_of_text|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "<|end_of_text|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|end_of_text|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"unk_token": {
"content": "<|end_of_text|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

244954
tokenizer.json Normal file

File diff suppressed because it is too large Load Diff

198
tokenizer_config.json Normal file
View File

@@ -0,0 +1,198 @@
{
"add_bos_token": false,
"add_prefix_space": false,
"added_tokens_decoder": {
"0": {
"content": "<|end_of_text|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"1": {
"content": "<fim_prefix>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"2": {
"content": "<fim_middle>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"3": {
"content": "<fim_suffix>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"4": {
"content": "<fim_pad>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"5": {
"content": "<filename>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"6": {
"content": "<gh_stars>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"7": {
"content": "<issue_start>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"8": {
"content": "<issue_comment>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"9": {
"content": "<issue_closed>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"10": {
"content": "<jupyter_start>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"11": {
"content": "<jupyter_text>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"12": {
"content": "<jupyter_code>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"13": {
"content": "<jupyter_output>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"14": {
"content": "<empty_output>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"15": {
"content": "<commit_before>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"16": {
"content": "<commit_msg>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"17": {
"content": "<commit_after>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"18": {
"content": "<reponame>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"49152": {
"content": "<|start_of_role|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"49153": {
"content": "<|end_of_role|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"49154": {
"content": "<|tool_call|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
}
},
"additional_special_tokens": [
"<|start_of_role|>",
"<|end_of_role|>",
"<|tool_call|>"
],
"bos_token": "<|end_of_text|>",
"clean_up_tokenization_spaces": true,
"eos_token": "<|end_of_text|>",
"errors": "replace",
"extra_special_tokens": {},
"model_max_length": 9223372036854775807,
"pad_token": "<|end_of_text|>",
"padding_side": "left",
"tokenizer_class": "GPT2Tokenizer",
"unk_token": "<|end_of_text|>",
"vocab_size": 49152
}

1
vocab.json Normal file

File diff suppressed because one or more lines are too long