opt-gemma track — data-processing optimization
1.352× Faster Halo Data Processing for Gemma 4 26B-A4B
Eliminating serial tokenizer dill pickling and redundant rejected-row filtering with a +59/−9 line, model-agnostic, byte-identical patch.
- opt-gemma
- Category: data-processing
- Row: gemma4-26b-a4b-data-processing-cpu16
- Branch: opt-gemma-tokenize
- Team @Badoot
Data-Processing Speedup
1.352×+35.2%
3,406.8 → 4,607.4 rows/s. Verdict: PASS, outside noise.
Tokenization Row Speedup
1.294×+29.4%
3.72M → 4.82M tok/s. Same head, same H200 job.
Launch-to-Exit Wall Time
44.9s → 36.8s
−8.1s saved per launch; −7.7s measured clock.
Correctness & Footprint
Byte-Identical7/7 digests
+59 / −9 lines across 3 files in halo/data/.
H200 official benchmark kit · 3 interleaved repeats + 1 discarded warmup
01
Technical Breakdown — 2 Levers
Two independent changes in halo/data/, +59/−9 lines in total across 3 files.
Lever A
C-Pickle Fast Path for PreTrainedTokenizerBase
- halo/data/pipeline/coordinated_map.py
Multi-process datasets.map pickled the map callable via pure-Python dill, walking Gemma 4's large vocabulary for seconds on every launch. _TokenizerCPickler(ForkingPickler) intercepts PreTrainedTokenizerBase via reducer_override and routes it through C pickle, falling back cleanly to dill for everything else.
tokenizer pickling 2.86s → 0.42s
Lever B
Columnar Arrow Zero-Reject Fast Path
- halo/data/pipeline/rejected_rows.py
- halo/data/preprocessed/tokenization.py
count_rejected_rows counts invalid rows directly in Arrow; _drop_rejected_rows skips the row-by-row Python filter pass whenever the rejected count is 0 (the common case on FineWeb-Edu), while keeping identical behavior whenever rejected rows exist.
~4.6s saved per launch
02
Verification & Benchmarks
Official benchmark kit on two Hugging Face Jobs flavors: 3 interleaved repeats + 1 discarded warmup.
| Flavor | Metric | Baseline | Patched | Speedup |
|---|---|---|---|---|
| cpu-performanceEPYC 7R13, 16 pinned CPUs | data-processing (rows/s) | 2,912.2 | 3,852.5 | 1.323× |
| tokenization (tok/s) | 3.14M | 4.13M | 1.318× | |
| h200Xeon Platinum 8581C, 16 pinned CPUs | data-processing (rows/s) | 3,406.8 | 4,607.4 | 1.352× |
| tokenization (tok/s) | 3.72M | 4.82M | 1.294× |
Every check passed on every repeat
- inputs
- batch_digests
- cold_launches
- whole_launch
- kit_modified: false
- head_changed_during_run: false
Byte-identical across 7 real Gemma 4 tokenizer digests
- sft-chat
- smpo-rendered
- smpo
- offline-grpo-rendered
- offline-grpo
- opt-text-row
- opt-text-row-with-rejects
03
Reproducibility & Honest Limits
$ python scripts/benchmarks/reference/compare.py measure gemma4-26b-a4b-data-processing-cpu16