初始化项目,由ModelHub XC社区提供模型
Model: dystrio/gemma-2-2b-it-sculpt-experimental Source: Original Platform
This commit is contained in:
36
.gitattributes
vendored
Normal file
36
.gitattributes
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
*.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
|
||||
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
||||
150
README.md
Normal file
150
README.md
Normal file
@@ -0,0 +1,150 @@
|
||||
---
|
||||
license: apache-2.0
|
||||
library_name: transformers
|
||||
pipeline_tag: text-generation
|
||||
language:
|
||||
- en
|
||||
base_model: google/gemma-2-2b-it
|
||||
tags:
|
||||
- dystrio
|
||||
- sculpt
|
||||
- pruned
|
||||
- compressed
|
||||
- efficient
|
||||
- dense
|
||||
- runtime-agnostic
|
||||
- no-custom-kernels
|
||||
- hf-drop-in
|
||||
- drop-in-replacement
|
||||
- smaller
|
||||
- faster
|
||||
- gemma
|
||||
datasets:
|
||||
- wikitext
|
||||
model-index:
|
||||
- name: Dystrio Sculpt (gemma-2-2b-it Experimental)
|
||||
results:
|
||||
- task:
|
||||
type: text-generation
|
||||
dataset:
|
||||
name: WikiText-103 (validation)
|
||||
type: wikitext
|
||||
metrics:
|
||||
- name: perplexity
|
||||
type: perplexity
|
||||
value: 48.9699
|
||||
- name: ppl_ratio
|
||||
type: ppl_ratio
|
||||
value: 1.8995
|
||||
---
|
||||
|
||||
# dystrio/gemma-2-2b-it-sculpt-experimental
|
||||
|
||||
> **30% smaller, +23% faster prefill, drop-in replacement. No custom kernels. No runtime changes.**
|
||||
|
||||
Dystrio Sculpt structurally compresses transformer models, producing dense models that load with standard `transformers` — no custom code, no new ops, no deployment friction.
|
||||
|
||||
This is the **Experimental** tier of [gemma 2 2b it](https://huggingface.co/google/gemma-2-2b-it).
|
||||
|
||||
## Quick Start
|
||||
|
||||
```python
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
model = AutoModelForCausalLM.from_pretrained("dystrio/gemma-2-2b-it-sculpt-experimental", torch_dtype="bfloat16", device_map="auto")
|
||||
tokenizer = AutoTokenizer.from_pretrained("dystrio/gemma-2-2b-it-sculpt-experimental")
|
||||
|
||||
inputs = tokenizer("The future of AI inference is", return_tensors="pt").to(model.device)
|
||||
outputs = model.generate(**inputs, max_new_tokens=100)
|
||||
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
||||
```
|
||||
|
||||
## Benchmark Results
|
||||
|
||||
All tiers compiled from [gemma 2 2b it](https://huggingface.co/google/gemma-2-2b-it) on A100 80GB, bf16:
|
||||
|
||||
| Model | PPL | PPL Ratio | Weights (GB) | Chat Prefill TPS | RAG TTFT p95 (ms) | Decode TPS |
|
||||
|-------|-----|-----------|-------------|------------------|-------------------|------------|
|
||||
| **Baseline** | 25.7807 | 1.0 | 4.869591 | 21611.9 | 70.251 | 59.6 |
|
||||
| **sculpt-default** | 20.5854 | 0.7985 | 4.441124 | 23065.3 | 69.007 | 60.0 |
|
||||
| **sculpt-production** | 22.4118 | 0.8693 | 4.226891 | 23404.0 | 66.554 | 60.7 |
|
||||
| **sculpt-throughput** | 29.8372 | 1.1573 | 3.969811 | 24330.1 | 64.529 | 59.3 |
|
||||
| **sculpt-experimental** | 48.9699 | 1.8995 | 3.412804 | 26496.2 | 60.97 | 59.5 |
|
||||
|
||||
### Key Metrics (this model)
|
||||
|
||||
| Metric | Value |
|
||||
|--------|-------|
|
||||
| **Weights memory** | 3.412804 GB (30% smaller) |
|
||||
| **PPL ratio** | 1.8995 |
|
||||
| **Chat prefill TPS** | 26496.2 (+23%) |
|
||||
| **RAG TTFT p95** | 60.97 ms (-13%) |
|
||||
| **Decode TPS** | 59.5 (flat) |
|
||||
| **Parameters** | 1.83B |
|
||||
|
||||
## All Sculpt Tiers
|
||||
|
||||
| Tier | HuggingFace | Size | PPL Ratio | Use Case |
|
||||
|------|-------------|------|-----------|----------|
|
||||
| default | [dystrio/gemma-2-2b-it-sculpt-default](https://huggingface.co/dystrio/gemma-2-2b-it-sculpt-default) | 4.441124 GB | 0.7985 | Zero-regret: quality preserved, smaller footprint |
|
||||
| production | [dystrio/gemma-2-2b-it-sculpt-production](https://huggingface.co/dystrio/gemma-2-2b-it-sculpt-production) | 4.226891 GB | 0.8693 | Practical savings with modest quality tradeoff |
|
||||
| throughput | [dystrio/gemma-2-2b-it-sculpt-throughput](https://huggingface.co/dystrio/gemma-2-2b-it-sculpt-throughput) | 3.969811 GB | 1.1573 | Maximum usable compression for speed/edge |
|
||||
| experimental | [dystrio/gemma-2-2b-it-sculpt-experimental](https://huggingface.co/dystrio/gemma-2-2b-it-sculpt-experimental) 👈 **this model** | 3.412804 GB | 1.8995 | Boundary exploration, maximum structural compression |
|
||||
|
||||
## What is Dystrio Sculpt?
|
||||
|
||||
Dystrio Sculpt compiles transformer models into smaller, faster variants. Output models:
|
||||
|
||||
- Are **dense** (not sparse) — standard architecture, fewer parameters
|
||||
- Load with **standard HuggingFace Transformers** — no custom code needed
|
||||
- Require **no custom kernels** and **no runtime changes**
|
||||
- Work as a one-step compile before deployment
|
||||
- Stack with quantization (AWQ, GPTQ, GGUF) for compound savings
|
||||
|
||||
## Compatibility
|
||||
|
||||
- ✅ HuggingFace Transformers
|
||||
- ✅ vLLM
|
||||
- ✅ TGI (Text Generation Inference)
|
||||
- ✅ llama.cpp / GGUF conversion
|
||||
- ✅ AWQ / GPTQ quantization
|
||||
- ✅ Any framework that loads standard safetensors
|
||||
|
||||
## Benchmark Environment
|
||||
|
||||
- **GPU**: NVIDIA A100-SXM4-80GB
|
||||
- **dtype**: bf16
|
||||
- **Torch**: 2.10.0+cu128
|
||||
- **Transformers**: 5.3.0
|
||||
- **Deterministic**: True
|
||||
- Single-GPU, standard HuggingFace Transformers, no custom kernels.
|
||||
|
||||
## Metric Definitions
|
||||
|
||||
- **PPL ratio**: WikiText-103 perplexity relative to baseline. <1.0 = quality improved.
|
||||
- **Prefill TPS**: Tokens per second during prompt encoding (higher = faster).
|
||||
- **TTFT p95**: Time to first token at 95th percentile (lower = faster).
|
||||
- **Decode TPS**: Tokens per second during generation (higher = faster).
|
||||
- **Weights (GB)**: Model parameter memory (deterministic, runtime-independent).
|
||||
|
||||
## Citation
|
||||
|
||||
```bibtex
|
||||
@misc{dystrio_sculpt_2026,
|
||||
title={Dystrio Sculpt: Structural Compilation for Transformer LLMs},
|
||||
author={Dystrio},
|
||||
year={2026},
|
||||
url={https://huggingface.co/dystrio}
|
||||
}
|
||||
```
|
||||
|
||||
## Downstream Benchmarks (lm-eval)
|
||||
|
||||
Evaluated with [lm-eval-harness](https://github.com/EleutherAI/lm-evaluation-harness) on A100-80GB, bf16, zero-shot.
|
||||
|
||||
| Benchmark | Baseline | This Model | Delta |
|
||||
|-----------|:--------:|:----------:|:-----:|
|
||||
| ARC-Challenge | 0.5094 | 0.2645 | -0.2449 |
|
||||
| HellaSwag | 0.5375 | 0.3577 | -0.1798 |
|
||||
| MMLU | 0.5691 | 0.2304 | -0.3387 |
|
||||
| TruthfulQA MC2 | 0.5322 | 0.5040 | -0.0282 |
|
||||
4
chat_template.jinja
Normal file
4
chat_template.jinja
Normal file
@@ -0,0 +1,4 @@
|
||||
{{ bos_token }}{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '
|
||||
' + message['content'] | trim + '<end_of_turn>
|
||||
' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model
|
||||
'}}{% endif %}
|
||||
68
config.json
Normal file
68
config.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"architectures": [
|
||||
"Gemma2ForCausalLM"
|
||||
],
|
||||
"attention_bias": false,
|
||||
"attention_dropout": 0.0,
|
||||
"attn_logit_softcapping": 50.0,
|
||||
"bos_token_id": 2,
|
||||
"cache_implementation": "hybrid",
|
||||
"dtype": "bfloat16",
|
||||
"eos_token_id": [
|
||||
1,
|
||||
107
|
||||
],
|
||||
"final_logit_softcapping": 30.0,
|
||||
"head_dim": 256,
|
||||
"hidden_act": "gelu_pytorch_tanh",
|
||||
"hidden_activation": "gelu_pytorch_tanh",
|
||||
"hidden_size": 2304,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 4864,
|
||||
"layer_types": [
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"full_attention"
|
||||
],
|
||||
"max_position_embeddings": 8192,
|
||||
"model_type": "gemma2",
|
||||
"num_attention_heads": 8,
|
||||
"num_hidden_layers": 26,
|
||||
"num_key_value_heads": 4,
|
||||
"pad_token_id": 0,
|
||||
"query_pre_attn_scalar": 256,
|
||||
"rms_norm_eps": 1e-06,
|
||||
"rope_parameters": {
|
||||
"rope_theta": 10000.0,
|
||||
"rope_type": "default"
|
||||
},
|
||||
"sliding_window": 4096,
|
||||
"tie_word_embeddings": true,
|
||||
"transformers_version": "5.3.0",
|
||||
"use_bidirectional_attention": null,
|
||||
"use_cache": true,
|
||||
"vocab_size": 256000
|
||||
}
|
||||
11
generation_config.json
Normal file
11
generation_config.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"bos_token_id": 2,
|
||||
"cache_implementation": "hybrid",
|
||||
"eos_token_id": [
|
||||
1,
|
||||
107
|
||||
],
|
||||
"pad_token_id": 0,
|
||||
"transformers_version": "5.3.0"
|
||||
}
|
||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:dbe6949d0f3375fb35666a17e03de8b30e7dd9252458962c2a32d10f4707c5c5
|
||||
size 3664504264
|
||||
3
tokenizer.json
Normal file
3
tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6994501c3d2c96eda15f5cb4d75ffd2cb41fa8e53e9cafc73db6adae158bf147
|
||||
size 34362970
|
||||
19
tokenizer_config.json
Normal file
19
tokenizer_config.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"backend": "tokenizers",
|
||||
"bos_token": "<bos>",
|
||||
"clean_up_tokenization_spaces": false,
|
||||
"eos_token": "<eos>",
|
||||
"extra_special_tokens": [
|
||||
"<start_of_turn>",
|
||||
"<end_of_turn>"
|
||||
],
|
||||
"is_local": false,
|
||||
"mask_token": "<mask>",
|
||||
"model_max_length": 1000000000000000019884624838656,
|
||||
"pad_token": "<pad>",
|
||||
"sp_model_kwargs": {},
|
||||
"spaces_between_special_tokens": false,
|
||||
"tokenizer_class": "GemmaTokenizer",
|
||||
"unk_token": "<unk>",
|
||||
"use_default_system_prompt": false
|
||||
}
|
||||
Reference in New Issue
Block a user