Abdullahu5mani commited on
Commit
77d19a8
·
verified ·
1 Parent(s): e666ed4

Upload Taurscribe Granite portable INT4 DirectML and CPU artifact

Browse files
.gitattributes CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ editor.onnx.data filter=lfs diff=lfs merge=lfs -text
37
+ encoder.onnx.data filter=lfs diff=lfs merge=lfs -text
38
+ projector.onnx.data filter=lfs diff=lfs merge=lfs -text
BENCHMARKS.md ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Benchmark Notes
2
+
3
+ ## End-to-End Route Comparison
4
+
5
+ All routes were measured with the current Taurscribe Rust runtime and the same
6
+ first 30 entries from `eval_manifest_30.jsonl`. Audio was decoded, converted to
7
+ 16 kHz mono, edge-trimmed, and processed through the same Granite pipeline.
8
+
9
+ Test machine:
10
+
11
+ - CPU: AMD Ryzen 7 8845HS
12
+ - integrated GPU: AMD Radeon 780M
13
+ - discrete GPU: NVIDIA GeForce RTX 4070 Laptop GPU
14
+ - sample count: 30 LibriSpeech `test-clean` utterances
15
+ - mean processed audio duration: 8.47 seconds
16
+
17
+ | Route | Load | Mean | Median | P95 | Mean RTF | Mean WER |
18
+ |---|---:|---:|---:|---:|---:|---:|
19
+ | CUDA artifact, RTX 4070 | 16.610 s | 0.250 s | 0.245 s | 0.303 s | 0.040 | 4.31% |
20
+ | Portable, full DirectML, Radeon 780M | 12.770 s | 4.045 s | 3.513 s | 4.518 s | 0.643 | 4.31% |
21
+ | Portable, CPU, 8 intra-op threads | 4.698 s | 8.823 s | 8.840 s | 10.168 s | 1.415 | 4.31% |
22
+ | Historical hybrid, 1-thread CPU encoder + DirectML | 8.421 s | 13.135 s | 12.874 s | 14.161 s | 2.194 | 4.31% |
23
+
24
+ CUDA load time includes a 5.594-second performance warmup. DirectML was forced
25
+ to DXGI device 0, identified as the Radeon 780M on this laptop. Every portable
26
+ graph was loaded on DirectML and runtime fallback was disabled for that run.
27
+
28
+ ## Interpretation
29
+
30
+ - Full DirectML was approximately 2.18 times faster than eight-thread CPU on
31
+ this end-to-end workload.
32
+ - The earlier 5.2-second CPU prediction came from adding isolated per-graph
33
+ probes and was not representative of full transcription. The measured
34
+ end-to-end CPU mean is 8.823 seconds.
35
+ - All routes produced the same 4.31% mean WER on this subset, so the execution
36
+ route did not change recognition accuracy here.
37
+ - Thirty utterances are sufficient for route validation but not for publishing
38
+ a general model-quality claim. Consult the IBM base model card for the full
39
+ Granite evaluation.
40
+
41
+ RTF is transcription time divided by processed audio duration. Values below
42
+ 1.0 are faster than real time.
LICENSE ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
NOTICE ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Granite Speech 4.1 2B NAR Portable INT4 for Taurscribe
2
+
3
+ This artifact is derived from IBM Granite Speech 4.1 2B NAR:
4
+
5
+ https://huggingface.co/ibm-granite/granite-speech-4.1-2b-nar
6
+
7
+ Original model provider:
8
+ IBM Granite Team
9
+
10
+ Original license:
11
+ Apache License 2.0
12
+
13
+ Taurscribe modifications:
14
+ - Copied the Granite ONNX model bundle and tokenizer assets.
15
+ - Applied INT4 weight-only MatMulNBits quantization to selected MatMul weights.
16
+ - Patched editor.onnx to output token_ids through in-graph ArgMax.
17
+ - Flattened rank-5 windowed-attention MatMul operations to equivalent rank-3 operations for DirectML.
18
+ - Baked fixed-bucket shape calculations as ONNX initializers and pruned dead shape nodes.
19
+ - Replaced two-output GLU Split operations with equivalent Slice pairs for DirectML correctness.
20
+ - Packaged the artifact for Taurscribe's ONNX Runtime DirectML and CPU paths.
21
+
22
+ No additional training or fine-tuning was performed by Taurscribe.
README.md ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: ibm-granite/granite-speech-4.1-2b-nar
4
+ library_name: onnx
5
+ pipeline_tag: automatic-speech-recognition
6
+ language:
7
+ - en
8
+ - fr
9
+ - de
10
+ - es
11
+ - pt
12
+ tags:
13
+ - automatic-speech-recognition
14
+ - granite-speech
15
+ - onnx
16
+ - onnxruntime
17
+ - directml
18
+ - cpu
19
+ - int4
20
+ - matmulnbits
21
+ - taurscribe
22
+ ---
23
+
24
+ # Granite Speech 4.1 2B NAR Portable INT4 for Taurscribe
25
+
26
+ This repository contains a portable ONNX Runtime artifact derived from IBM's
27
+ [Granite Speech 4.1 2B NAR](https://huggingface.co/ibm-granite/granite-speech-4.1-2b-nar)
28
+ model for local transcription in Taurscribe.
29
+
30
+ It is designed for Windows systems without an NVIDIA CUDA GPU. It supports:
31
+
32
+ - full GPU inference through ONNX Runtime DirectML on compatible AMD, Intel,
33
+ and NVIDIA DirectX 12 GPUs;
34
+ - multi-threaded ONNX Runtime CPU inference as a portable fallback.
35
+
36
+ This is not a newly trained or fine-tuned model. The learned Granite weights,
37
+ tokenizer, vocabulary, and supported languages are inherited from IBM's base
38
+ model. Taurscribe changed the ONNX representation and host runtime path.
39
+
40
+ > This is a multi-graph Taurscribe runtime bundle, not a single-file
41
+ > Transformers replacement. Correct inference requires Taurscribe's feature
42
+ > extraction, CTC, projection, edit-slot, and tokenizer pipeline.
43
+
44
+ ## What Changed
45
+
46
+ The portable artifact builds on Taurscribe's INT4/token-ID Granite bundle:
47
+
48
+ 1. Selected large `MatMul` weights use INT4 weight-only quantization through
49
+ ONNX `MatMulNBits`.
50
+ 2. `editor.onnx` performs `ArgMax` in the graph and returns `token_ids` instead
51
+ of transferring the full sequence-by-vocabulary logits tensor to Rust.
52
+ 3. Thirty-two rank-5 windowed-attention `MatMul` operations in `encoder.onnx`
53
+ are reshaped to equivalent rank-3 batched operations supported by DirectML.
54
+ 4. Runtime shape chains are evaluated for Taurscribe's fixed `[1, 800, 160]`
55
+ encoder bucket, stored as constants, and approximately 950 dead shape nodes
56
+ are removed.
57
+ 5. Sixteen two-output GLU `Split` operations are replaced with equivalent
58
+ `Slice` pairs to avoid incorrect output inside DirectML fused partitions.
59
+
60
+ Only `encoder.onnx` receives the DirectML compatibility rewrites. The
61
+ projector, token embedding graph, editor, tokenizer, and model weights are
62
+ copied from the INT4/token-ID parent artifact.
63
+
64
+ ## Runtime Placement
65
+
66
+ Full DirectML:
67
+
68
+ ```text
69
+ encoder.onnx -> DirectML
70
+ projector.onnx -> DirectML
71
+ embed_tokens.onnx -> DirectML
72
+ editor.onnx -> DirectML
73
+ ```
74
+
75
+ CPU fallback:
76
+
77
+ ```text
78
+ encoder.onnx -> CPU
79
+ projector.onnx -> CPU
80
+ embed_tokens.onnx -> CPU
81
+ editor.onnx -> CPU
82
+ ```
83
+
84
+ The ONNX files do not select a GPU vendor. Taurscribe's Rust code asks ONNX
85
+ Runtime to create DirectML or CPU sessions. See
86
+ `taurscribe_granite_nar_manifest.json` for the graph contract.
87
+
88
+ ## Validation
89
+
90
+ The conversion script compares every rewritten encoder output against the
91
+ source encoder on CPU and aborts if the worst relative difference exceeds
92
+ `1e-3`. The produced artifact measured a worst relative difference of about
93
+ `4.4e-5`. DirectML encoder BPE argmax agreement with CPU was `1.0000` on the
94
+ validated input.
95
+
96
+ The following end-to-end Taurscribe results use the same 30 utterances from
97
+ LibriSpeech `test-clean` (mean processed duration: 8.47 seconds):
98
+
99
+ | Route | Hardware | Mean latency | Mean RTF | Mean WER |
100
+ |---|---|---:|---:|---:|
101
+ | CUDA reference artifact | RTX 4070 Laptop | 0.250 s | 0.040 | 4.31% |
102
+ | **This artifact, full DirectML** | **Radeon 780M** | **4.045 s** | **0.643** | **4.31%** |
103
+ | **This artifact, CPU (8 threads)** | **Ryzen 7 8845HS** | **8.823 s** | **1.415** | **4.31%** |
104
+ | Historical hybrid baseline | 1-thread CPU encoder + DirectML | 13.135 s | 2.194 | 4.31% |
105
+
106
+ These are limited local validation results, not a replacement for the base
107
+ model's full published evaluation. See `BENCHMARKS.md` for methodology and tail
108
+ latency.
109
+
110
+ ## Hardware Compatibility
111
+
112
+ - **AMD Radeon 780M DirectML:** validated end to end with CPU fallback disabled.
113
+ - **NVIDIA DirectML:** graph-level compatibility validated; use the separate
114
+ CUDA artifact for substantially better NVIDIA performance.
115
+ - **Intel DirectML:** expected to work on DirectX 12 hardware but not yet
116
+ validated with this exact artifact.
117
+ - **x86-64 CPU:** supported through ONNX Runtime CPU; actual speed depends
118
+ heavily on memory bandwidth and thread count.
119
+
120
+ DirectML requires Windows and a DirectX 12-compatible GPU. A GPU driver or
121
+ execution-provider failure should be handled by the host application with CPU
122
+ fallback. For production hardware certification, run the DirectML probe in a
123
+ separate helper process so a native driver crash cannot terminate the app.
124
+
125
+ ## Taurscribe Selection
126
+
127
+ Taurscribe model ID:
128
+
129
+ ```text
130
+ granite-speech-4.1-2b-nar-portable
131
+ ```
132
+
133
+ Development overrides:
134
+
135
+ ```powershell
136
+ $env:TAURSCRIBE_GRANITE_BACKEND = "directml"
137
+ $env:TAURSCRIBE_GRANITE_DML_DEVICE_ID = "0"
138
+ $env:TAURSCRIBE_GRANITE_BACKEND = "cpu"
139
+ $env:TAURSCRIBE_GRANITE_CPU_THREADS = "8"
140
+ ```
141
+
142
+ The DirectML device ID follows DXGI adapter order and is machine-specific.
143
+
144
+ ## Files
145
+
146
+ ```text
147
+ encoder.onnx
148
+ encoder.onnx.data
149
+ projector.onnx
150
+ projector.onnx.data
151
+ embed_tokens.onnx
152
+ editor.onnx
153
+ editor.onnx.data
154
+ tokenizer.json
155
+ tokenizer_config.json
156
+ preprocessor_config.json
157
+ processor_config.json
158
+ generation_config.json
159
+ taurscribe_granite_nar_manifest.json
160
+ manifest.json
161
+ BENCHMARKS.md
162
+ NOTICE
163
+ LICENSE
164
+ ```
165
+
166
+ `manifest.json` records artifact metadata, exact file sizes, and SHA-256
167
+ checksums for the runtime payload.
168
+
169
+ ## Source and Attribution
170
+
171
+ - Base model: [ibm-granite/granite-speech-4.1-2b-nar](https://huggingface.co/ibm-granite/granite-speech-4.1-2b-nar)
172
+ - Original provider: IBM Granite Team
173
+ - Original license: Apache License 2.0
174
+ - ONNX optimization and packaging: Taurscribe project
175
+
176
+ No additional training or fine-tuning was performed by Taurscribe.
editor.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40dc0e1eafa152fd6fdcb0ca8030128469906501a63ea4d4ae83df195d23d792
3
+ size 1630677
editor.onnx.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72704971b72bf00c281a859825cb72b25b7768239d009abe52fb4fbc6ddc009b
3
+ size 873816064
embed_tokens.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10f33a9646ea843d65c761c5295d8487e1091bf66de587f395ccec5b44c71ad3
3
+ size 822083791
encoder.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4e34584c2de0ebbf95d318a386bb6f150ae62eb9505837dae3e82190a72859a
3
+ size 300910
encoder.onnx.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:038e259276a1119ad03afcd8fce16ff50cd3a98db535cd68be0b5a71bbcf3318
3
+ size 650685536
generation_config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "transformers_version": "5.8.1"
3
+ }
manifest.json ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "granite-speech-4.1-2b-nar-portable",
3
+ "display_name": "Granite Speech 4.1 2B NAR Portable INT4",
4
+ "artifact_type": "onnxruntime-directml-cpu",
5
+ "created_at_utc": "2026-07-10T00:03:54.0897852Z",
6
+ "source_model": "ibm-granite/granite-speech-4.1-2b-nar",
7
+ "source_license": "Apache-2.0",
8
+ "target_runtime": "onnxruntime",
9
+ "target_execution_providers": [
10
+ "DmlExecutionProvider",
11
+ "CPUExecutionProvider"
12
+ ],
13
+ "intended_app": "Taurscribe",
14
+ "expected_editor_output": "token_ids",
15
+ "fixed_encoder_frames": 800,
16
+ "encoder_dml_safe": true,
17
+ "size_bytes": 2398658963,
18
+ "graphs": {
19
+ "encoder": "encoder.onnx",
20
+ "projector": "projector.onnx",
21
+ "embed_tokens": "embed_tokens.onnx",
22
+ "editor": "editor.onnx"
23
+ },
24
+ "modifications": [
25
+ "Applied INT4 weight-only MatMulNBits quantization to selected ONNX MatMul weights",
26
+ "Patched editor.onnx with ArgMax so the graph outputs token_ids instead of full logits",
27
+ "Flattened 32 rank-5 windowed-attention MatMul operations to equivalent rank-3 batched MatMul operations",
28
+ "Baked fixed 800-frame shape-slot tensors as initializers and pruned approximately 950 dead nodes",
29
+ "Replaced 16 two-output GLU Split operations with equivalent Slice pairs for DirectML correctness",
30
+ "Packaged for Taurscribe ONNX Runtime DirectML with CPU fallback"
31
+ ],
32
+ "validation": {
33
+ "encoder_cpu_worst_relative_difference": 0.000044,
34
+ "directml_bpe_argmax_agreement": 1.0,
35
+ "librispeech_subset_utterances": 30,
36
+ "portable_directml_mean_seconds": 4.0454,
37
+ "portable_directml_mean_rtf": 0.6429,
38
+ "portable_directml_mean_wer": 0.0431,
39
+ "portable_cpu_8_threads_mean_seconds": 8.8227,
40
+ "portable_cpu_8_threads_mean_rtf": 1.4145,
41
+ "portable_cpu_8_threads_mean_wer": 0.0431
42
+ },
43
+ "files": {
44
+ "editor.onnx": {
45
+ "size_bytes": 1630677,
46
+ "sha256": "40dc0e1eafa152fd6fdcb0ca8030128469906501a63ea4d4ae83df195d23d792"
47
+ },
48
+ "editor.onnx.data": {
49
+ "size_bytes": 873816064,
50
+ "sha256": "72704971b72bf00c281a859825cb72b25b7768239d009abe52fb4fbc6ddc009b"
51
+ },
52
+ "embed_tokens.onnx": {
53
+ "size_bytes": 822083791,
54
+ "sha256": "10f33a9646ea843d65c761c5295d8487e1091bf66de587f395ccec5b44c71ad3"
55
+ },
56
+ "encoder.onnx": {
57
+ "size_bytes": 300910,
58
+ "sha256": "e4e34584c2de0ebbf95d318a386bb6f150ae62eb9505837dae3e82190a72859a"
59
+ },
60
+ "encoder.onnx.data": {
61
+ "size_bytes": 650685536,
62
+ "sha256": "038e259276a1119ad03afcd8fce16ff50cd3a98db535cd68be0b5a71bbcf3318"
63
+ },
64
+ "generation_config.json": {
65
+ "size_bytes": 38,
66
+ "sha256": "af7cd9bbb214dea4f6a37756c2c133d002f6325ed4f497efc991f02b4d486dad"
67
+ },
68
+ "preprocessor_config.json": {
69
+ "size_bytes": 289,
70
+ "sha256": "e12be1e9d4ec5c459741328f28d9d8c00c3c688e8fe4230a6ec28df5470db8b3"
71
+ },
72
+ "processor_config.json": {
73
+ "size_bytes": 153,
74
+ "sha256": "74d21364b507dcbe465420152d48edd9276f94a84d22a78d0da371e716a79374"
75
+ },
76
+ "projector.onnx": {
77
+ "size_bytes": 33527,
78
+ "sha256": "0641d423a5700d6b16c0d8a47a25b58e750b1e2d065f26a670b72a78930968b2"
79
+ },
80
+ "projector.onnx.data": {
81
+ "size_bytes": 42950656,
82
+ "sha256": "d660a66a75178c1b111d154de6b6cfe6a8183111c68ada33948e42ba0acefc19"
83
+ },
84
+ "taurscribe_granite_nar_manifest.json": {
85
+ "size_bytes": 3128,
86
+ "sha256": "bb59c18cdfa4297ff42d7f76d27911030fb118e04f2291b15e488e32dc92a47e"
87
+ },
88
+ "tokenizer_config.json": {
89
+ "size_bytes": 392,
90
+ "sha256": "c7e48adce9bdf6cfe3524759067b5dfa2428de9ccba2fd257502bf0246161c2f"
91
+ },
92
+ "tokenizer.json": {
93
+ "size_bytes": 7153802,
94
+ "sha256": "64c10a88b2495872bd7da5a885861a1757d9c23590c40fd378546ae176d280f6"
95
+ }
96
+ }
97
+ }
preprocessor_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoFeatureExtractor": "feature_extraction_granite_speech_nar.GraniteSpeechNarFeatureExtractor"
4
+ },
5
+ "feature_extractor_type": "GraniteSpeechNarFeatureExtractor",
6
+ "hop_length": 160,
7
+ "n_fft": 512,
8
+ "n_mels": 80,
9
+ "sampling_rate": 16000,
10
+ "win_length": 400
11
+ }
processor_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "processor_class": "GraniteSpeechNarProcessor",
3
+ "auto_map": {
4
+ "AutoProcessor": "processing_granite_speech_nar.GraniteSpeechNarProcessor"
5
+ }
6
+ }
projector.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0641d423a5700d6b16c0d8a47a25b58e750b1e2d065f26a670b72a78930968b2
3
+ size 33527
projector.onnx.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d660a66a75178c1b111d154de6b6cfe6a8183111c68ada33948e42ba0acefc19
3
+ size 42950656
taurscribe_granite_nar_manifest.json ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "format": "taurscribe-granite-nar-onnx-bundle",
3
+ "format_version": 1,
4
+ "source_model": "ibm-granite/granite-speech-4.1-2b-nar",
5
+ "export_dtype": "int4-matmulnbits-weights",
6
+ "fixed_encoder_frames": 800,
7
+ "opset": 20,
8
+ "execution_provider_preference": [
9
+ "DmlExecutionProvider",
10
+ "CPUExecutionProvider"
11
+ ],
12
+ "graphs": {
13
+ "encoder": {
14
+ "file": "encoder.onnx",
15
+ "inputs": [
16
+ "input_features",
17
+ "attention_mask"
18
+ ],
19
+ "outputs": [
20
+ "bpe_logits",
21
+ "hidden_4",
22
+ "hidden_8",
23
+ "hidden_12",
24
+ "hidden_last"
25
+ ],
26
+ "notes": "Fixed-shape app bucket: pad input_features to 800 frames. Trim bpe_logits to ceil(valid_frames / bpe_pooling_window) before CTC collapse."
27
+ },
28
+ "projector": {
29
+ "file": "projector.onnx",
30
+ "inputs": [
31
+ "multilayer_features"
32
+ ],
33
+ "outputs": [
34
+ "audio_embeds"
35
+ ]
36
+ },
37
+ "embed_tokens": {
38
+ "file": "embed_tokens.onnx",
39
+ "inputs": [
40
+ "token_ids"
41
+ ],
42
+ "outputs": [
43
+ "text_embeds"
44
+ ]
45
+ },
46
+ "editor": {
47
+ "file": "editor.onnx",
48
+ "inputs": [
49
+ "inputs_embeds",
50
+ "position_ids"
51
+ ],
52
+ "outputs": [
53
+ "token_ids"
54
+ ],
55
+ "notes": "Non-causal bidirectional editor. Host code should pass one flattened sample sequence at a time."
56
+ }
57
+ },
58
+ "host_pipeline": [
59
+ "Extract Granite log-mel features with the copied preprocessor config and pad/truncate to 800 encoder frames.",
60
+ "Run encoder.onnx.",
61
+ "Trim padded BPE logits using the valid frame count, argmax, unique-consecutive collapse, and remove blank_token_id.",
62
+ "Concatenate hidden_4, hidden_8, hidden_12, and hidden_last, then run projector.onnx.",
63
+ "Trim audio embeddings using floor(valid_frames / projector.downsample_rate).",
64
+ "Insert blank edit slots around the encoder CTC token IDs.",
65
+ "Run embed_tokens.onnx for the slotted token IDs.",
66
+ "Concatenate audio embeddings and text embeddings, create monotonic position_ids, then run editor.onnx.",
67
+ "Select the text segment logits, argmax, unique-consecutive collapse, remove blank_token_id, and decode with tokenizer.json."
68
+ ],
69
+ "validation": {
70
+ "onnx_checker": "run scripts/granite_nar_export.py validate --model-dir <onnx-bundle>",
71
+ "ort_cpu_session_load": "run scripts/granite_nar_export.py validate --model-dir <onnx-bundle>"
72
+ },
73
+ "notes": [
74
+ "Fallback is controlled by ONNX Runtime session creation in Rust, not encoded inside the ONNX files.",
75
+ "INT4 weight-only MatMulNBits bundle with an editor that returns token_ids instead of full vocabulary logits.",
76
+ "Portable bundle: rank-5 attention MatMuls are flattened to rank 3, fixed 800-frame shape chains are baked as constants, and GLU Split nodes are replaced with Slice pairs so the full encoder runs correctly on DirectML.",
77
+ "DirectML is preferred on compatible Windows GPUs; ONNX Runtime CPU remains the portable fallback."
78
+ ],
79
+ "variant": "int4-argmax-dml-static",
80
+ "encoder_dml_safe": true
81
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|end_of_text|>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|end_of_text|>",
7
+ "is_local": true,
8
+ "local_files_only": false,
9
+ "model_max_length": 1000000000000000019884624838656,
10
+ "pad_token": "<|pad|>",
11
+ "padding_side": "left",
12
+ "tokenizer_class": "TokenizersBackend",
13
+ "unk_token": "<|unk|>"
14
+ }