Authors: Fatima Zahra & Ramalah Amir — Data Science, FAST-NUCES Islamabad
Low-resource languages like Urdu remain heavily underexplored in NLP. This project fine-tunes M2M-100, a multilingual machine translation model, for Roman-Urdu ↔ Urdu transliteration — while tackling a critical but often overlooked bottleneck: the CPU-GPU communication gap during training.
The core contribution is integrating MinatoLoader, an asynchronous data loading framework that eliminates GPU idle time through dynamic batch scheduling, reducing training time from 35+ hours to ~30 hours on 6.3M sentence pairs.
Fine-tuning large multilingual models like M2M-100 on low-resource language pairs is computationally expensive. A key bottleneck is head-of-line blocking (HOLB) — when variable-length sequences stall preprocessing, the GPU sits idle waiting for data. Most existing work assumes preprocessing is fully pre-done, which is not always feasible at scale.
The system is designed as an asynchronous CPU-GPU pipeline:
| Technique | Purpose |
|---|---|
Parallel tokenization (num_proc=4) | 2.6× speedup on offline tokenization |
Mixed precision training (fp16=True) | Reduced memory footprint, faster computation |
Multi-worker data loading (num_workers=4) | Eliminates GPU stall from sequential preprocessing |
Pinned memory (pin_memory=True) | Faster CPU-to-GPU data transfer |
| MinatoLoader integration | Resolves head-of-line blocking at scale |
All experiments conducted on Kaggle free-tier (dual NVIDIA T4 GPUs, 13GB RAM).
| Configuration | 35k samples | 100k samples | 6.3M samples |
|---|---|---|---|
| Unoptimized Baseline | 3h 12m | 8h 25m | 634h 10m |
| Optimized Baseline | 2h 11m | 6h 44m | 385h 07m |
| MinatoLoader | 1h 30m | 4h 10m | 55h 10m |
MinatoLoader achieves ~38% speedup on 100k samples and reduces full-scale training from 385h to 55h.
| Metric | Score |
|---|---|
| General BLEU | 76.62 |
| Char-BLEU | 82.25 |
| CHRF | 79.61 |
Translation quality is identical across all pipeline configurations — the optimizations affect training efficiency only, not model performance.
MinatoLoader's benefit scales with dataset size. At 35k samples it introduces overhead (queue initialization costs), but at 100k+ samples it significantly outperforms standard PyTorch DataLoader — confirming it is most valuable for production-scale training.
├── Minato/ # MinatoLoader integration and training scripts
├── notebooks/ # Experiment notebooks
├── i232616_i232644_paper.pdf # Full research paper
└── README.md
11 commits
5 commits
Jupyter Notebook
97.2%
Python
2.7%
Authors: Fatima Zahra & Ramalah Amir — Data Science, FAST-NUCES Islamabad
Low-resource languages like Urdu remain heavily underexplored in NLP. This project fine-tunes M2M-100, a multilingual machine translation model, for Roman-Urdu ↔ Urdu transliteration — while tackling a critical but often overlooked bottleneck: the CPU-GPU communication gap during training.
The core contribution is integrating MinatoLoader, an asynchronous data loading framework that eliminates GPU idle time through dynamic batch scheduling, reducing training time from 35+ hours to ~30 hours on 6.3M sentence pairs.
Fine-tuning large multilingual models like M2M-100 on low-resource language pairs is computationally expensive. A key bottleneck is head-of-line blocking (HOLB) — when variable-length sequences stall preprocessing, the GPU sits idle waiting for data. Most existing work assumes preprocessing is fully pre-done, which is not always feasible at scale.
The system is designed as an asynchronous CPU-GPU pipeline:
| Technique | Purpose |
|---|---|
Parallel tokenization (num_proc=4) | 2.6× speedup on offline tokenization |
Mixed precision training (fp16=True) | Reduced memory footprint, faster computation |
Multi-worker data loading (num_workers=4) | Eliminates GPU stall from sequential preprocessing |
Pinned memory (pin_memory=True) | Faster CPU-to-GPU data transfer |
| MinatoLoader integration | Resolves head-of-line blocking at scale |
All experiments conducted on Kaggle free-tier (dual NVIDIA T4 GPUs, 13GB RAM).
| Configuration | 35k samples | 100k samples | 6.3M samples |
|---|---|---|---|
| Unoptimized Baseline | 3h 12m | 8h 25m | 634h 10m |
| Optimized Baseline | 2h 11m | 6h 44m | 385h 07m |
| MinatoLoader | 1h 30m | 4h 10m | 55h 10m |
MinatoLoader achieves ~38% speedup on 100k samples and reduces full-scale training from 385h to 55h.
| Metric | Score |
|---|---|
| General BLEU | 76.62 |
| Char-BLEU | 82.25 |
| CHRF | 79.61 |
Translation quality is identical across all pipeline configurations — the optimizations affect training efficiency only, not model performance.
MinatoLoader's benefit scales with dataset size. At 35k samples it introduces overhead (queue initialization costs), but at 100k+ samples it significantly outperforms standard PyTorch DataLoader — confirming it is most valuable for production-scale training.
├── Minato/ # MinatoLoader integration and training scripts
├── notebooks/ # Experiment notebooks
├── i232616_i232644_paper.pdf # Full research paper
└── README.md
11 commits
5 commits
Jupyter Notebook
97.2%
Python
2.7%