add monarch_40; refresh the card with the full block-count sweep and the int8 scoping
Browse files- .gitattributes +1 -0
- README.md +43 -25
- monarch_40/config.json +37 -0
- monarch_40/g_best +3 -0
- monarch_40/g_best.onnx +3 -0
- monarch_40/g_best_fp32.onnx +3 -0
.gitattributes
CHANGED
|
@@ -53,3 +53,4 @@ blockdiag_10/g_best filter=lfs diff=lfs merge=lfs -text
|
|
| 53 |
blockdiag_20/g_best filter=lfs diff=lfs merge=lfs -text
|
| 54 |
blockdiag_40/g_best filter=lfs diff=lfs merge=lfs -text
|
| 55 |
blockdiag_5/g_best filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 53 |
blockdiag_20/g_best filter=lfs diff=lfs merge=lfs -text
|
| 54 |
blockdiag_40/g_best filter=lfs diff=lfs merge=lfs -text
|
| 55 |
blockdiag_5/g_best filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
monarch_40/g_best filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -70,25 +70,39 @@ does survive the fix — but it had never actually been tested before it.
|
|
| 70 |
| `monarch_fc` | 2.38 M | 2.843 | 2.831 | +0.012 |
|
| 71 |
| `monarch_full` | 1.10 M | 2.838 | 2.846 | −0.009 |
|
| 72 |
|
| 73 |
-
####
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
projections
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
|
| 81 |
-
| ------------
|
| 82 |
-
|
|
| 83 |
-
|
|
| 84 |
-
|
|
| 85 |
-
|
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
### Block-diagonal, dense, butterfly
|
| 94 |
|
|
@@ -120,7 +134,10 @@ the other three.
|
|
| 120 |
- **Genuine Monarch beats block-diagonal, but marginally** (+0.011…+0.038 FP32 at
|
| 121 |
matched `nblocks`) and it costs parameters — its second factor makes it larger.
|
| 122 |
Consistent with the saturation above.
|
| 123 |
-
- **
|
|
|
|
|
|
|
|
|
|
| 124 |
*with the weights genuinely quantized*.
|
| 125 |
- **Butterfly with randn init degrades catastrophically under int8** (Δ up to
|
| 126 |
0.644). Use `init=ortho`: `butterfly_ortho` loses 0.203 to int8 vs 0.644 for
|
|
@@ -132,11 +149,12 @@ One subdirectory per run: the generator (`g_best`), the streaming FP32 ONNX, the
|
|
| 132 |
static int8 ONNX, and the exact `config.json` it was trained with.
|
| 133 |
|
| 134 |
```
|
| 135 |
-
baseline/
|
| 136 |
-
blockdiag_fc/
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
|
|
|
| 140 |
|
| 141 |
each: {g_best, g_best_fp32.onnx, g_best.onnx, config.json}
|
| 142 |
```
|
|
|
|
| 70 |
| `monarch_fc` | 2.38 M | 2.843 | 2.831 | +0.012 |
|
| 71 |
| `monarch_full` | 1.10 M | 2.838 | 2.846 | −0.009 |
|
| 72 |
|
| 73 |
+
#### Block-count sweep, both families (`nblocks` 5 → 40)
|
| 74 |
+
|
| 75 |
+
One knob varies. Every run below is the `*_8` architecture — hidden 400, fc 600,
|
| 76 |
+
both FCs and both GRU projections structured — with **only `nblocks` changed**,
|
| 77 |
+
so parameters move and nothing else does. Dense baseline for reference:
|
| 78 |
+
**2.845 FP32 / 2.834 int8 at 2.78 M**.
|
| 79 |
+
|
| 80 |
+
| nblocks | blockdiag params | FP32 | int8 | Δint8 | monarch params | FP32 | int8 | Δint8 |
|
| 81 |
+
| ------: | ---------------: | ---: | ---: | ----: | -------------: | ---: | ---: | ----: |
|
| 82 |
+
| 5 | 0.563 M | 2.826 | 2.793 | +0.033 | 0.880 M | 2.852 | 2.858 | −0.007 |
|
| 83 |
+
| 8 | 0.355 M | 2.832 | 2.825 | +0.007 | 0.553 M | **2.861** | 2.856 | +0.005 |
|
| 84 |
+
| 10 | 0.285 M | 2.772 | 2.744 | +0.028 | 0.443 M | 2.849 | 2.842 | +0.007 |
|
| 85 |
+
| 20 | 0.146 M | 2.719 | 2.627 | +0.092 | 0.225 M | 2.849 | 2.854 | −0.005 |
|
| 86 |
+
| 40 | 0.077 M | 2.608 | 2.455 | +0.153 | 0.117 M | 2.837 | 2.837 | 0.000 |
|
| 87 |
+
|
| 88 |
+
**Block-diagonal collapses as blocks narrow; Monarch does not.** Over nblocks
|
| 89 |
+
5→40 blockdiag loses 0.218 PESQ in FP32, and its int8 penalty grows from 0.033 to
|
| 90 |
+
0.153 (0.338 total in int8 terms). Monarch moves 0.015 in FP32 and stays
|
| 91 |
+
int8-loss-free throughout — exactly 0.000 at nblocks 40.
|
| 92 |
+
|
| 93 |
+
The separating variable is connectivity, not capacity. A block-diagonal factor
|
| 94 |
+
never mixes across blocks, so raising `nblocks` splits the network into narrower
|
| 95 |
+
non-communicating bands; Monarch's permutation restores full cross-channel reach
|
| 96 |
+
in one step. Two checks:
|
| 97 |
+
|
| 98 |
+
- **At matched parameters**: `blockdiag_5` (0.563 M) 2.826 vs `monarch_8`
|
| 99 |
+
(0.553 M) 2.861 — +0.035 for Monarch at equal size.
|
| 100 |
+
- **Monarch wins while smaller**: `monarch_40` (0.117 M) beats `blockdiag_20`
|
| 101 |
+
(0.146 M) by 0.130 FP32 and 0.227 int8.
|
| 102 |
+
|
| 103 |
+
**`monarch_40` reaches dense parity with 24× fewer parameters** (2.837 vs 2.845,
|
| 104 |
+
inside metric noise) and is loss-free in int8, where the dense baseline itself
|
| 105 |
+
gives up 0.012. It is the model to take unless you have a reason not to.
|
| 106 |
|
| 107 |
### Block-diagonal, dense, butterfly
|
| 108 |
|
|
|
|
| 134 |
- **Genuine Monarch beats block-diagonal, but marginally** (+0.011…+0.038 FP32 at
|
| 135 |
matched `nblocks`) and it costs parameters — its second factor makes it larger.
|
| 136 |
Consistent with the saturation above.
|
| 137 |
+
- **Monarch quantizes loss-free at every block count tested** (|Δ| ≤ 0.012 over
|
| 138 |
+
nblocks 4–40). **Block-diagonal only up to `nblocks` 8** (|Δ| ≤ 0.018) — at 20
|
| 139 |
+
and 40 the penalty is 0.092 and 0.153. The older unqualified "block-diagonal
|
| 140 |
+
quantizes loss-free" claim was tested only on wide blocks,
|
| 141 |
*with the weights genuinely quantized*.
|
| 142 |
- **Butterfly with randn init degrades catastrophically under int8** (Δ up to
|
| 143 |
0.644). Use `init=ortho`: `butterfly_ortho` loses 0.203 to int8 vs 0.644 for
|
|
|
|
| 149 |
static int8 ONNX, and the exact `config.json` it was trained with.
|
| 150 |
|
| 151 |
```
|
| 152 |
+
baseline/ blockdiag_5/ monarch_5/ butterfly_fc/
|
| 153 |
+
blockdiag_fc/ blockdiag_8/ monarch_8/ butterfly_full/
|
| 154 |
+
blockdiag_full/ blockdiag_10/ monarch_10/ butterfly_ortho/
|
| 155 |
+
wide_blockdiag/ blockdiag_20/ monarch_20/ butterfly_2blocks/
|
| 156 |
+
wide_monarch/ blockdiag_40/ monarch_40/
|
| 157 |
+
monarch_fc/
|
| 158 |
|
| 159 |
each: {g_best, g_best_fp32.onnx, g_best.onnx, config.json}
|
| 160 |
```
|
monarch_40/config.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"num_gpus": 0,
|
| 3 |
+
"batch_size": 256,
|
| 4 |
+
"learning_rate": 0.003,
|
| 5 |
+
"adam_b1": 0.8,
|
| 6 |
+
"adam_b2": 0.99,
|
| 7 |
+
"lr_decay": 0.99,
|
| 8 |
+
"seed": 1234,
|
| 9 |
+
"hidden_dim": 400,
|
| 10 |
+
"fc_hidden_dim": 600,
|
| 11 |
+
"num_gru_layers": 2,
|
| 12 |
+
"compress_factor": 0.3,
|
| 13 |
+
"linear": {
|
| 14 |
+
"kind": "monarch",
|
| 15 |
+
"nblocks": 40
|
| 16 |
+
},
|
| 17 |
+
"gru": {
|
| 18 |
+
"kind": "triton_monarch",
|
| 19 |
+
"nblocks": 40,
|
| 20 |
+
"struct_input": true
|
| 21 |
+
},
|
| 22 |
+
"sampling_rate": 16000,
|
| 23 |
+
"segment_size": 32000,
|
| 24 |
+
"n_fft": 512,
|
| 25 |
+
"hop_size": 256,
|
| 26 |
+
"win_size": 512,
|
| 27 |
+
"num_workers": 8,
|
| 28 |
+
"quant": {
|
| 29 |
+
"enabled": false,
|
| 30 |
+
"n_calib_utts": 200
|
| 31 |
+
},
|
| 32 |
+
"dist_config": {
|
| 33 |
+
"dist_backend": "nccl",
|
| 34 |
+
"dist_url": "tcp://localhost:54321",
|
| 35 |
+
"world_size": 1
|
| 36 |
+
}
|
| 37 |
+
}
|
monarch_40/g_best
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0249ed293dd1cb0a011cf572f997f32af6fb244d1fd071bcda1b08d5fa4d83cb
|
| 3 |
+
size 526417
|
monarch_40/g_best.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:121ea3098c6982618fd4115fa6cec3703133c701ab99f166336a72729ed1713d
|
| 3 |
+
size 235731
|
monarch_40/g_best_fp32.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0318f13771de065e306868e8bdf1ec4d70054606777d02940cdf730ab461c3b4
|
| 3 |
+
size 498045
|