初始化项目,由ModelHub XC社区提供模型
Model: dystrio/Mistral-7B-Instruct-v0.3-sculpt-throughput Source: Original Platform
This commit is contained in:
35
.gitattributes
vendored
Normal file
35
.gitattributes
vendored
Normal 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
|
||||
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: mistralai/Mistral-7B-Instruct-v0.3
|
||||
tags:
|
||||
- dystrio
|
||||
- sculpt
|
||||
- pruned
|
||||
- compressed
|
||||
- efficient
|
||||
- dense
|
||||
- runtime-agnostic
|
||||
- no-custom-kernels
|
||||
- hf-drop-in
|
||||
- drop-in-replacement
|
||||
- smaller
|
||||
- faster
|
||||
- mistral
|
||||
datasets:
|
||||
- wikitext
|
||||
model-index:
|
||||
- name: Dystrio Sculpt (Mistral-7B-Instruct-v0.3 Throughput)
|
||||
results:
|
||||
- task:
|
||||
type: text-generation
|
||||
dataset:
|
||||
name: WikiText-103 (validation)
|
||||
type: wikitext
|
||||
metrics:
|
||||
- name: perplexity
|
||||
type: perplexity
|
||||
value: 16.3355
|
||||
- name: ppl_ratio
|
||||
type: ppl_ratio
|
||||
value: 1.2966
|
||||
---
|
||||
|
||||
# dystrio/Mistral-7B-Instruct-v0.3-sculpt-throughput
|
||||
|
||||
> **23% smaller, +20% 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 **Throughput** tier of [Mistral 7B Instruct v0.3](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3).
|
||||
|
||||
## Quick Start
|
||||
|
||||
```python
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
model = AutoModelForCausalLM.from_pretrained("dystrio/Mistral-7B-Instruct-v0.3-sculpt-throughput", torch_dtype="bfloat16", device_map="auto")
|
||||
tokenizer = AutoTokenizer.from_pretrained("dystrio/Mistral-7B-Instruct-v0.3-sculpt-throughput")
|
||||
|
||||
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 [Mistral 7B Instruct v0.3](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3) on A100 80GB, bf16:
|
||||
|
||||
| Model | PPL | PPL Ratio | Weights (GB) | Chat Prefill TPS | RAG TTFT p95 (ms) | Decode TPS |
|
||||
|-------|-----|-----------|-------------|------------------|-------------------|------------|
|
||||
| **Baseline** | 12.5983 | 1.0 | 13.500496 | 10557.3 | 133.325 | 66.8 |
|
||||
| **sculpt-default** | 11.6283 | 0.923 | 12.000496 | 11594.3 | 123.069 | 65.3 |
|
||||
| **sculpt-production** | 14.2859 | 1.134 | 11.250496 | 12093.9 | 120.842 | 66.0 |
|
||||
| **sculpt-throughput** | 16.3355 | 1.2966 | 10.406746 | 12667.0 | 112.683 | 65.8 |
|
||||
| **sculpt-experimental** | 25.1515 | 1.9964 | 9.562996 | 13595.9 | 110.293 | 66.5 |
|
||||
|
||||
### Key Metrics (this model)
|
||||
|
||||
| Metric | Value |
|
||||
|--------|-------|
|
||||
| **Weights memory** | 10.406746 GB (23% smaller) |
|
||||
| **PPL ratio** | 1.2966 |
|
||||
| **Chat prefill TPS** | 12667.0 (+20%) |
|
||||
| **RAG TTFT p95** | 112.683 ms (-15%) |
|
||||
| **Decode TPS** | 65.8 (flat) |
|
||||
| **Parameters** | 5.59B |
|
||||
|
||||
## All Sculpt Tiers
|
||||
|
||||
| Tier | HuggingFace | Size | PPL Ratio | Use Case |
|
||||
|------|-------------|------|-----------|----------|
|
||||
| default | [dystrio/Mistral-7B-Instruct-v0.3-sculpt-default](https://huggingface.co/dystrio/Mistral-7B-Instruct-v0.3-sculpt-default) | 12.000496 GB | 0.923 | Zero-regret: quality preserved, smaller footprint |
|
||||
| production | [dystrio/Mistral-7B-Instruct-v0.3-sculpt-production](https://huggingface.co/dystrio/Mistral-7B-Instruct-v0.3-sculpt-production) | 11.250496 GB | 1.134 | Practical savings with modest quality tradeoff |
|
||||
| throughput | [dystrio/Mistral-7B-Instruct-v0.3-sculpt-throughput](https://huggingface.co/dystrio/Mistral-7B-Instruct-v0.3-sculpt-throughput) 👈 **this model** | 10.406746 GB | 1.2966 | Maximum usable compression for speed/edge |
|
||||
| experimental | [dystrio/Mistral-7B-Instruct-v0.3-sculpt-experimental](https://huggingface.co/dystrio/Mistral-7B-Instruct-v0.3-sculpt-experimental) | 9.562996 GB | 1.9964 | 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.5794 | 0.3797 | -0.1997 |
|
||||
| HellaSwag | 0.6573 | 0.5075 | -0.1498 |
|
||||
| MMLU | 0.5975 | 0.3982 | -0.1993 |
|
||||
| TruthfulQA MC2 | 0.5939 | 0.4860 | -0.1079 |
|
||||
87
chat_template.jinja
Normal file
87
chat_template.jinja
Normal file
@@ -0,0 +1,87 @@
|
||||
{%- if messages[0]["role"] == "system" %}
|
||||
{%- set system_message = messages[0]["content"] %}
|
||||
{%- set loop_messages = messages[1:] %}
|
||||
{%- else %}
|
||||
{%- set loop_messages = messages %}
|
||||
{%- endif %}
|
||||
{%- if not tools is defined %}
|
||||
{%- set tools = none %}
|
||||
{%- endif %}
|
||||
{%- set user_messages = loop_messages | selectattr("role", "equalto", "user") | list %}
|
||||
|
||||
{#- This block checks for alternating user/assistant messages, skipping tool calling messages #}
|
||||
{%- set ns = namespace() %}
|
||||
{%- set ns.index = 0 %}
|
||||
{%- for message in loop_messages %}
|
||||
{%- if not (message.role == "tool" or message.role == "tool_results" or (message.tool_calls is defined and message.tool_calls is not none)) %}
|
||||
{%- if (message["role"] == "user") != (ns.index % 2 == 0) %}
|
||||
{{- raise_exception("After the optional system message, conversation roles must alternate user/assistant/user/assistant/...") }}
|
||||
{%- endif %}
|
||||
{%- set ns.index = ns.index + 1 %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
|
||||
{{- bos_token }}
|
||||
{%- for message in loop_messages %}
|
||||
{%- if message["role"] == "user" %}
|
||||
{%- if tools is not none and (message == user_messages[-1]) %}
|
||||
{{- "[AVAILABLE_TOOLS] [" }}
|
||||
{%- for tool in tools %}
|
||||
{%- set tool = tool.function %}
|
||||
{{- '{"type": "function", "function": {' }}
|
||||
{%- for key, val in tool.items() if key != "return" %}
|
||||
{%- if val is string %}
|
||||
{{- '"' + key + '": "' + val + '"' }}
|
||||
{%- else %}
|
||||
{{- '"' + key + '": ' + val|tojson }}
|
||||
{%- endif %}
|
||||
{%- if not loop.last %}
|
||||
{{- ", " }}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{{- "}}" }}
|
||||
{%- if not loop.last %}
|
||||
{{- ", " }}
|
||||
{%- else %}
|
||||
{{- "]" }}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{{- "[/AVAILABLE_TOOLS]" }}
|
||||
{%- endif %}
|
||||
{%- if loop.last and system_message is defined %}
|
||||
{{- "[INST] " + system_message + "\n\n" + message["content"] + "[/INST]" }}
|
||||
{%- else %}
|
||||
{{- "[INST] " + message["content"] + "[/INST]" }}
|
||||
{%- endif %}
|
||||
{%- elif message.tool_calls is defined and message.tool_calls is not none %}
|
||||
{{- "[TOOL_CALLS] [" }}
|
||||
{%- for tool_call in message.tool_calls %}
|
||||
{%- set out = tool_call.function|tojson %}
|
||||
{{- out[:-1] }}
|
||||
{%- if not tool_call.id is defined or tool_call.id|length != 9 %}
|
||||
{{- raise_exception("Tool call IDs should be alphanumeric strings with length 9!") }}
|
||||
{%- endif %}
|
||||
{{- ', "id": "' + tool_call.id + '"}' }}
|
||||
{%- if not loop.last %}
|
||||
{{- ", " }}
|
||||
{%- else %}
|
||||
{{- "]" + eos_token }}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{%- elif message["role"] == "assistant" %}
|
||||
{{- " " + message["content"]|trim + eos_token}}
|
||||
{%- elif message["role"] == "tool_results" or message["role"] == "tool" %}
|
||||
{%- if message.content is defined and message.content.content is defined %}
|
||||
{%- set content = message.content.content %}
|
||||
{%- else %}
|
||||
{%- set content = message.content %}
|
||||
{%- endif %}
|
||||
{{- '[TOOL_RESULTS] {"content": ' + content|string + ", " }}
|
||||
{%- if not message.tool_call_id is defined or message.tool_call_id|length != 9 %}
|
||||
{{- raise_exception("Tool call IDs should be alphanumeric strings with length 9!") }}
|
||||
{%- endif %}
|
||||
{{- '"call_id": "' + message.tool_call_id + '"}[/TOOL_RESULTS]' }}
|
||||
{%- else %}
|
||||
{{- raise_exception("Only user and assistant roles are supported, with the exception of an initial optional system message!") }}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
30
config.json
Normal file
30
config.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"architectures": [
|
||||
"MistralForCausalLM"
|
||||
],
|
||||
"attention_dropout": 0.0,
|
||||
"bos_token_id": 1,
|
||||
"dtype": "bfloat16",
|
||||
"eos_token_id": 2,
|
||||
"head_dim": 128,
|
||||
"hidden_act": "silu",
|
||||
"hidden_size": 4096,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 10112,
|
||||
"max_position_embeddings": 32768,
|
||||
"model_type": "mistral",
|
||||
"num_attention_heads": 32,
|
||||
"num_hidden_layers": 32,
|
||||
"num_key_value_heads": 8,
|
||||
"pad_token_id": null,
|
||||
"rms_norm_eps": 1e-05,
|
||||
"rope_parameters": {
|
||||
"rope_theta": 1000000.0,
|
||||
"rope_type": "default"
|
||||
},
|
||||
"sliding_window": null,
|
||||
"tie_word_embeddings": false,
|
||||
"transformers_version": "5.3.0",
|
||||
"use_cache": true,
|
||||
"vocab_size": 32768
|
||||
}
|
||||
6
generation_config.json
Normal file
6
generation_config.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"bos_token_id": 1,
|
||||
"eos_token_id": 2,
|
||||
"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:b4ffd7a1b8192650609417532c8a6645f10739d91eb38423bcdf6433de2f13b0
|
||||
size 11174192248
|
||||
275738
tokenizer.json
Normal file
275738
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
16
tokenizer_config.json
Normal file
16
tokenizer_config.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"add_prefix_space": true,
|
||||
"backend": "tokenizers",
|
||||
"bos_token": "<s>",
|
||||
"clean_up_tokenization_spaces": false,
|
||||
"eos_token": "</s>",
|
||||
"is_local": false,
|
||||
"legacy": false,
|
||||
"model_max_length": 1000000000000000019884624838656,
|
||||
"pad_token": "</s>",
|
||||
"sp_model_kwargs": {},
|
||||
"spaces_between_special_tokens": false,
|
||||
"tokenizer_class": "TokenizersBackend",
|
||||
"unk_token": "<unk>",
|
||||
"use_default_system_prompt": false
|
||||
}
|
||||
Reference in New Issue
Block a user