The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.
Chandra OCR 2 sur RTX 3090 - benchmark vLLM natif
Ce depot publie les resultats d'optimisation de datalab-to/chandra-ocr-2
sur une RTX 3090 24 Go RunPod, sans Docker ni sudo, avec le backend vLLM natif.
Resultat principal
| configuration | pages/s | s/page | gain vs HF | qualite |
|---|---|---|---|---|
| HF origine | 0.053 | 18.828 | 1.0x | stable |
| vLLM natif simple page | 0.306 | 3.266 | 5.8x | stable |
| vLLM batch optimise | 1.359 | 0.736 | 25.6x | stable |
Le meilleur resultat observe est 1.359 pages/s avec --batch-size 16
et --max-workers 16, sans degradation visible de la sortie OCR sur le PDF
multi-pages propre teste.
Comment l'optimisation a ete faite
- Installation du package officiel
chandra-ocravec backend HF et vLLM. - Validation du backend HF comme baseline qualite/vitesse.
- Inspection du code
chandra-ocrpour comprendre la connexion vLLM:VLLM_API_BASE=http://localhost:8000/v1VLLM_MODEL_NAME=chandra- endpoint OpenAI-compatible
/v1/chat/completions - image envoyee en
image_urlbase64.
- Remplacement du lanceur officiel
chandra_vllm, qui utilisaitsudo docker, par un serveur natif:python -m vllm.entrypoints.openai.api_server. - Profiling du pipeline:
- rasterisation PDF
- scaling image
- encodage PNG/base64
- inference vLLM
- post-processing Markdown/HTML.
- Sweep vLLM progressif:
max-num-seqsmax-num-batched-tokensgpu-memory-utilizationmax-model-len.
- Benchmark batch multi-pages:
- batch 1
- batch 2
- batch 4
- batch 8
- batch 16.
- Rejet des configurations qui changent trop la sortie OCR ou provoquent OOM.
Configuration vLLM stable
cd /workspace/chandra-runpod-ocr
source .venv/bin/activate
source scripts/env.sh
bash scripts/serve_vllm_native.sh
Parametres valides sur RTX 3090:
DTYPE=float16
MAX_MODEL_LEN=4096
GPU_MEMORY_UTILIZATION=0.82
MAX_NUM_SEQS=4
MAX_NUM_BATCHED_TOKENS=1024
VLLM_MODEL_NAME=chandra
MODEL_CHECKPOINT=datalab-to/chandra-ocr-2
Commande OCR gagnante observee:
chandra benchmarks/fixtures/simple_16p.pdf ./output/best_vllm_b16 \
--batch-size 16 \
--max-workers 16 \
--max-output-tokens 2048 \
--max-retries 0 \
--no-images
Goulot identifie
Le profiling montre que l'inference vLLM represente environ 96% du temps
mesure sur le PDF simple. La rasterisation PDF, l'encodage image et le
post-processing sont marginaux sur ce cas.
Fichiers inclus
reports/performance_evolution.mdreports/performance_breakdown.mdreports/vllm_native_report.mdreports/final_optimization_report.mdreports/model_comparison.mdreports/quantization_search.mdresults/vllm_sweep.jsonlresults/batch_results.jsonlresults/performance_breakdown.jsonscripts/serve_vllm_native.shscripts/test_vllm_native.shscripts/profile_pipeline.pyscripts/sweep_vllm.pyscripts/benchmark_batches.py
Limites
Le meilleur debit publie ici a ete mesure sur un PDF propre multi-pages. Avant usage production, il faut repasser les benchmarks sur:
- scans
- tableaux
- documents multi-colonnes
- documents francais
- images texte
La regle appliquee ici est stricte: aucune optimisation n'est acceptee si la qualite OCR se degrade visiblement.
- Downloads last month
- 66