dystrio commited on
Commit
cb22dce
·
verified ·
1 Parent(s): c1f0258

Dystrio Sculpt default tier of Mistral 7B Instruct v0.3

Browse files
README.md ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: transformers
4
+ pipeline_tag: text-generation
5
+ language:
6
+ - en
7
+ base_model: mistralai/Mistral-7B-Instruct-v0.3
8
+ tags:
9
+ - dystrio
10
+ - sculpt
11
+ - pruned
12
+ - compressed
13
+ - efficient
14
+ - structural-pruning
15
+ - dense
16
+ - runtime-agnostic
17
+ - no-custom-kernels
18
+ - hf-drop-in
19
+ - drop-in-replacement
20
+ - smaller
21
+ - faster
22
+ - mistral
23
+ datasets:
24
+ - wikitext
25
+ model-index:
26
+ - name: Dystrio Sculpt (Mistral-7B-Instruct-v0.3 Default)
27
+ results:
28
+ - task:
29
+ type: text-generation
30
+ dataset:
31
+ name: WikiText-103 (validation)
32
+ type: wikitext
33
+ metrics:
34
+ - name: perplexity
35
+ type: perplexity
36
+ value: 11.6283
37
+ - name: ppl_ratio
38
+ type: ppl_ratio
39
+ value: 0.923
40
+ ---
41
+
42
+ # dystrio/Mistral-7B-Instruct-v0.3-sculpt-default
43
+
44
+ > **11% smaller, quality improved (0.923x PPL), drop-in replacement. No custom kernels. No runtime changes.**
45
+
46
+ Dystrio Sculpt structurally compresses transformer FFN blocks, producing dense models that load with standard `transformers` — no custom code, no new ops, no deployment friction.
47
+
48
+ This is the **Default** tier of [Mistral 7B Instruct v0.3](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3).
49
+
50
+ ## Quick Start
51
+
52
+ ```python
53
+ from transformers import AutoModelForCausalLM, AutoTokenizer
54
+
55
+ model = AutoModelForCausalLM.from_pretrained("dystrio/Mistral-7B-Instruct-v0.3-sculpt-default", torch_dtype="bfloat16", device_map="auto")
56
+ tokenizer = AutoTokenizer.from_pretrained("dystrio/Mistral-7B-Instruct-v0.3-sculpt-default")
57
+
58
+ inputs = tokenizer("The future of AI inference is", return_tensors="pt").to(model.device)
59
+ outputs = model.generate(**inputs, max_new_tokens=100)
60
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
61
+ ```
62
+
63
+ ## Benchmark Results
64
+
65
+ All tiers compiled from [Mistral 7B Instruct v0.3](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3) on A100 80GB, bf16:
66
+
67
+ | Model | PPL | PPL Ratio | Weights (GB) | Chat Prefill TPS | RAG TTFT p95 (ms) | Decode TPS |
68
+ |-------|-----|-----------|-------------|------------------|-------------------|------------|
69
+ | **Baseline** | 12.5983 | 1.0 | 13.500496 | 10557.3 | 133.325 | 66.8 |
70
+ | **sculpt-default** | 11.6283 | 0.923 | 12.000496 | 11594.3 | 123.069 | 65.3 |
71
+ | **sculpt-production** | 14.2859 | 1.134 | 11.250496 | 12093.9 | 120.842 | 66.0 |
72
+ | **sculpt-throughput** | 16.3355 | 1.2966 | 10.406746 | 12667.0 | 112.683 | 65.8 |
73
+ | **sculpt-experimental** | 25.1515 | 1.9964 | 9.562996 | 13595.9 | 110.293 | 66.5 |
74
+
75
+ ### Key Metrics (this model)
76
+
77
+ | Metric | Value |
78
+ |--------|-------|
79
+ | **Weights memory** | 12.000496 GB (11% smaller) |
80
+ | **PPL ratio** | 0.923 |
81
+ | **Chat prefill TPS** | 11594.3 (+10%) |
82
+ | **RAG TTFT p95** | 123.069 ms (-8%) |
83
+ | **Decode TPS** | 65.3 (flat) |
84
+ | **Parameters** | 6.44B |
85
+
86
+ ## All Sculpt Tiers
87
+
88
+ | Tier | HuggingFace | Size | PPL Ratio | Use Case |
89
+ |------|-------------|------|-----------|----------|
90
+ | default | [dystrio/Mistral-7B-Instruct-v0.3-sculpt-default](https://huggingface.co/dystrio/Mistral-7B-Instruct-v0.3-sculpt-default) 👈 **this model** | 12.000496 GB | 0.923 | Zero-regret: quality preserved, smaller footprint |
91
+ | 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 |
92
+ | throughput | [dystrio/Mistral-7B-Instruct-v0.3-sculpt-throughput](https://huggingface.co/dystrio/Mistral-7B-Instruct-v0.3-sculpt-throughput) | 10.406746 GB | 1.2966 | Maximum usable compression for speed/edge |
93
+ | 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 |
94
+
95
+ ## What is Dystrio Sculpt?
96
+
97
+ Dystrio Sculpt is a structural FFN compiler for transformer LLMs. It:
98
+
99
+ - Removes redundant neurons from SwiGLU feed-forward blocks
100
+ - Uses conductance-aware scoring and adaptive repair
101
+ - Produces standard HuggingFace safetensors output
102
+ - Requires **no custom kernels** and **no runtime changes**
103
+ - Works as a compile step before deployment
104
+ - Stacks with quantization (AWQ, GPTQ, GGUF) for compound savings
105
+
106
+ ## Compatibility
107
+
108
+ - ✅ HuggingFace Transformers
109
+ - ✅ vLLM
110
+ - ✅ TGI (Text Generation Inference)
111
+ - ✅ llama.cpp / GGUF conversion
112
+ - ✅ AWQ / GPTQ quantization
113
+ - ✅ Any framework that loads standard safetensors
114
+
115
+ ## Benchmark Environment
116
+
117
+ - **GPU**: NVIDIA A100-SXM4-80GB
118
+ - **dtype**: bf16
119
+ - **Torch**: 2.10.0+cu128
120
+ - **Transformers**: 5.3.0
121
+ - **Deterministic**: True
122
+ - Single-GPU, standard HuggingFace Transformers, no custom kernels.
123
+
124
+ ## Metric Definitions
125
+
126
+ - **PPL ratio**: WikiText-103 perplexity relative to baseline. <1.0 = quality improved.
127
+ - **Prefill TPS**: Tokens per second during prompt encoding (higher = faster).
128
+ - **TTFT p95**: Time to first token at 95th percentile (lower = faster).
129
+ - **Decode TPS**: Tokens per second during generation (higher = faster).
130
+ - **Weights (GB)**: Model parameter memory (deterministic, runtime-independent).
131
+
132
+ ## Citation
133
+
134
+ ```bibtex
135
+ @misc{dystrio_sculpt_2026,
136
+ title={Dystrio Sculpt: Structural FFN Compilation for Transformer LLMs},
137
+ author={Dystrio},
138
+ year={2026},
139
+ url={https://huggingface.co/dystrio}
140
+ }
141
+ ```
chat_template.jinja ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if messages[0]["role"] == "system" %}
2
+ {%- set system_message = messages[0]["content"] %}
3
+ {%- set loop_messages = messages[1:] %}
4
+ {%- else %}
5
+ {%- set loop_messages = messages %}
6
+ {%- endif %}
7
+ {%- if not tools is defined %}
8
+ {%- set tools = none %}
9
+ {%- endif %}
10
+ {%- set user_messages = loop_messages | selectattr("role", "equalto", "user") | list %}
11
+
12
+ {#- This block checks for alternating user/assistant messages, skipping tool calling messages #}
13
+ {%- set ns = namespace() %}
14
+ {%- set ns.index = 0 %}
15
+ {%- for message in loop_messages %}
16
+ {%- if not (message.role == "tool" or message.role == "tool_results" or (message.tool_calls is defined and message.tool_calls is not none)) %}
17
+ {%- if (message["role"] == "user") != (ns.index % 2 == 0) %}
18
+ {{- raise_exception("After the optional system message, conversation roles must alternate user/assistant/user/assistant/...") }}
19
+ {%- endif %}
20
+ {%- set ns.index = ns.index + 1 %}
21
+ {%- endif %}
22
+ {%- endfor %}
23
+
24
+ {{- bos_token }}
25
+ {%- for message in loop_messages %}
26
+ {%- if message["role"] == "user" %}
27
+ {%- if tools is not none and (message == user_messages[-1]) %}
28
+ {{- "[AVAILABLE_TOOLS] [" }}
29
+ {%- for tool in tools %}
30
+ {%- set tool = tool.function %}
31
+ {{- '{"type": "function", "function": {' }}
32
+ {%- for key, val in tool.items() if key != "return" %}
33
+ {%- if val is string %}
34
+ {{- '"' + key + '": "' + val + '"' }}
35
+ {%- else %}
36
+ {{- '"' + key + '": ' + val|tojson }}
37
+ {%- endif %}
38
+ {%- if not loop.last %}
39
+ {{- ", " }}
40
+ {%- endif %}
41
+ {%- endfor %}
42
+ {{- "}}" }}
43
+ {%- if not loop.last %}
44
+ {{- ", " }}
45
+ {%- else %}
46
+ {{- "]" }}
47
+ {%- endif %}
48
+ {%- endfor %}
49
+ {{- "[/AVAILABLE_TOOLS]" }}
50
+ {%- endif %}
51
+ {%- if loop.last and system_message is defined %}
52
+ {{- "[INST] " + system_message + "\n\n" + message["content"] + "[/INST]" }}
53
+ {%- else %}
54
+ {{- "[INST] " + message["content"] + "[/INST]" }}
55
+ {%- endif %}
56
+ {%- elif message.tool_calls is defined and message.tool_calls is not none %}
57
+ {{- "[TOOL_CALLS] [" }}
58
+ {%- for tool_call in message.tool_calls %}
59
+ {%- set out = tool_call.function|tojson %}
60
+ {{- out[:-1] }}
61
+ {%- if not tool_call.id is defined or tool_call.id|length != 9 %}
62
+ {{- raise_exception("Tool call IDs should be alphanumeric strings with length 9!") }}
63
+ {%- endif %}
64
+ {{- ', "id": "' + tool_call.id + '"}' }}
65
+ {%- if not loop.last %}
66
+ {{- ", " }}
67
+ {%- else %}
68
+ {{- "]" + eos_token }}
69
+ {%- endif %}
70
+ {%- endfor %}
71
+ {%- elif message["role"] == "assistant" %}
72
+ {{- " " + message["content"]|trim + eos_token}}
73
+ {%- elif message["role"] == "tool_results" or message["role"] == "tool" %}
74
+ {%- if message.content is defined and message.content.content is defined %}
75
+ {%- set content = message.content.content %}
76
+ {%- else %}
77
+ {%- set content = message.content %}
78
+ {%- endif %}
79
+ {{- '[TOOL_RESULTS] {"content": ' + content|string + ", " }}
80
+ {%- if not message.tool_call_id is defined or message.tool_call_id|length != 9 %}
81
+ {{- raise_exception("Tool call IDs should be alphanumeric strings with length 9!") }}
82
+ {%- endif %}
83
+ {{- '"call_id": "' + message.tool_call_id + '"}[/TOOL_RESULTS]' }}
84
+ {%- else %}
85
+ {{- raise_exception("Only user and assistant roles are supported, with the exception of an initial optional system message!") }}
86
+ {%- endif %}
87
+ {%- endfor %}
config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "MistralForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 1,
7
+ "dtype": "bfloat16",
8
+ "eos_token_id": 2,
9
+ "head_dim": 128,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 4096,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 12288,
14
+ "max_position_embeddings": 32768,
15
+ "model_type": "mistral",
16
+ "num_attention_heads": 32,
17
+ "num_hidden_layers": 32,
18
+ "num_key_value_heads": 8,
19
+ "pad_token_id": null,
20
+ "rms_norm_eps": 1e-05,
21
+ "rope_parameters": {
22
+ "rope_theta": 1000000.0,
23
+ "rope_type": "default"
24
+ },
25
+ "sliding_window": null,
26
+ "tie_word_embeddings": false,
27
+ "transformers_version": "5.3.0",
28
+ "use_cache": true,
29
+ "vocab_size": 32768
30
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "transformers_version": "5.3.0"
6
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:202f48221cd5e93df34e454bfd684427478e28a1596943a8efc98ac9b105b44d
3
+ size 12885468352
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": true,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<s>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "</s>",
7
+ "is_local": false,
8
+ "legacy": false,
9
+ "model_max_length": 1000000000000000019884624838656,
10
+ "pad_token": "</s>",
11
+ "sp_model_kwargs": {},
12
+ "spaces_between_special_tokens": false,
13
+ "tokenizer_class": "TokenizersBackend",
14
+ "unk_token": "<unk>",
15
+ "use_default_system_prompt": false
16
+ }