|
7 | 7 | - **mimalloc**: global allocator replaced with mimalloc for parallel allocation throughput. |
8 | 8 | - **MDL cache**: total E cost cached during training beam passes — avoids a full extra pass to build `e_distribution`. |
9 | 9 | - **Infer match_log reuse**: level-0 `beam_search` result's `match_log` seeded directly into the N-level loop; level=1 extracts pid_seq from it without a second beam call. |
10 | | -- **SymbolIndex on GrammarLevel**: inverted index `symbol_id → [(pattern_idx, pos)]` built once per level, eliminates per-call `HashMap` rebuild in `beam_search`. Measured gain on HDFS 50k/446k: <1% — bottleneck is beam candidate expansion, not index construction. |
| 10 | +- **SymbolIndex on GrammarLevel**: inverted index `symbol_id → [(pattern_idx, pos)]` built once per level, eliminates per-call `HashMap` rebuild in `beam_search`. Measured gain on HDFS 1k/446k: <1% — bottleneck is beam candidate expansion, not index construction. |
11 | 11 |
|
12 | | -Observed on HDFS (50k training corpus, 446k infer, release build, Apple Silicon): |
13 | | -- Training (50k sequences): ~138s user, ~1m48s wall (sequential, 128% CPU) |
| 12 | +Observed on HDFS (1k training corpus, 446k infer, release build, Apple Silicon): |
| 13 | +- Training (1k sequences): ~138s user, ~1m48s wall (sequential, 128% CPU) |
14 | 14 | - Infer (446k sequences, parallel, baseline): ~1816s user, ~123s wall (1480% CPU, 16 cores) |
15 | 15 | - Infer (446k sequences, parallel, after H+I+J): ~637s user, ~42s wall (~2.85× user, ~2.9× wall) |
16 | 16 |
|
@@ -63,8 +63,8 @@ pub struct PatternStore { |
63 | 63 | } |
64 | 64 | ``` |
65 | 65 |
|
66 | | -**D — Parallel training** |
67 | | -Training beam passes are currently sequential per level. Each new pattern is independent within a level — could parallelize with rayon, keeping grammar update sequential. |
| 66 | +**D — Parallel training** *(independent of B)* |
| 67 | +Training beam passes are currently sequential per level. Each new pattern is independent within a level — could parallelize with rayon, keeping grammar update sequential. Does not require the SoA refactor (B) — can be done on the current AoS layout. |
68 | 68 |
|
69 | 69 | **E — SIMD symbol comparison** *(after B)* |
70 | 70 | AVX2: 8 `u32` symbols per instruction. |
|
0 commit comments