Skip to content

perf(triton): size ocr_pipeline instances per profile within a memory budget - #243

Merged
davidamacey merged 1 commit into
mainfrom
perf/240-ocr-instances
Oct 11, 2026
Merged

davidamacey merged 1 commit into
mainfrom
perf/240-ocr-instances

Conversation

@davidamacey

Copy link
Copy Markdown
Owner

Closes #240

What

  • models/ocr_pipeline ships 2 instances (was 1). The installer profiles set the count through a new ocr_pipeline_instances field: minimal 1, standard 2, full 4. load_profile reads it and generate_all_configs now applies it to ocr_pipeline, which no profile touched before.
  • The model config records GPU_MIB_PER_INSTANCE (512) and each profile has python_backend_budget_mib. tests/test_triton_instance_budget.py parses the committed configs and fails when a Python-backend count exceeds the budget. It also runs the real shell path per profile on a copy.
  • Docs: docs/PERFORMANCE.md (tuning section), INSTALLATION.md profile list, CHANGELOG.

Measured (live, isolated project ocrinst, Triton only, GPU 1, 12 GB, 0% foreign utilisation, torn down)

Whole-card memory with det and rec engines loaded and the Python instances warm (640x480 frames, 16 clients): 1 instance 11082 MiB, 2 instances 11337, 4 instances 11850, so about 256 MiB per instance. The 512 MiB budget figure is 2x that for larger frames. 16 MP frames were not measured (the throwaway container had the default 64 MB shm). Throughput on this card was client-bound and only confirms the scaling (2.7, 5.5, 11.4 images/s for 1, 2, 4 instances); the throughput numbers in the issue come from Wave 0 on the A6000.

det and rec counts and batching are unchanged: Wave 0 showed GPU time under 10 ms per image for both, so the Python instance is the limit.

Tests

New test failed first (10 failed before the change, 10 pass after). pre-commit run --from-ref origin/main --to-ref HEAD exit 0.

… budget

The Python BLS model runs one request per instance, so a single instance
capped OCR at about 21 images/s (42 with two, 80 with four). The installer
profiles now set ocr_pipeline_instances (1, 2, 4), the model ships 2, and a
per-instance GPU memory figure plus a per-profile Python budget are checked
by an offline test.
@davidamacey
davidamacey merged commit bdba83e into main Oct 11, 2026
5 checks passed
@davidamacey
davidamacey deleted the perf/240-ocr-instances branch October 11, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(triton): ocr_pipeline runs one instance, so OCR is capped at about 21 images/s (2 instances 42, 4 instances 80)

1 participant