• Stefy Lanza (nextime / spora )'s avatar
    ocr: max_concurrency is a ceiling, and 4 was not one (v0.3.35) · 81235f2e
    Stefy Lanza (nextime / spora ) authored
    It shipped at 4, which made it the binding limit for every install. The limiter
    is meant to be each engine's own `*_instances` -- the pool hands out one instance
    per page and an engine is not reentrant -- while a RunPod fleet can hold
    max_pods x scale_up_inflight_per_pod pages in flight: 64 x 16 = 1024 on the
    Digesta install. A ceiling of 4 capped that at a quarter of ONE pod.
    
    Measured on one A40, same page, same install:
    
        N     surya req/s  p50     chandra pg/s  p50
        1     0.93         1.1s    0.21          4.6s
        8     3.79         2.0s    1.31          6.1s
        16    7.11         2.2s    1.88          8.4s      <- both peak
        24    5.89         4.1s    2.09         10.6s
        32    5.44 +13 err 3.5s    1.44 +21 err  7.5s
        48    ALL FAILED
    
    Both peak at 16 and both fail outright by 32 -- a cliff, not a degradation.
    
    Default raised 4 -> 64: four pods' worth at the measured knee, far above what a
    single-box install can feed, so it stops being the limiter while staying finite.
    NOT higher, because every admitted page holds a rasterised bitmap (~18 MB for A4
    at 250 DPI): 64 in flight is ~1.2 GB, 1024 would be ~18 GB of page images before
    any engine does work. Trading a throughput limit for an OOM is not an upgrade.
    
    docs/ocr.md carries the table and spells out the three settings that bound this,
    which are easy to confuse: the per-model scale-out threshold, the per-engine
    instance count (the real limiter, and for the SUBPROCESS engines it is what the
    box can host -- a surya worker is a separate interpreter at ~750 MB), and this
    ceiling.
    
    Also recorded there: surya's req/s is BLOCKS, not pages, since it calls once per
    layout block; and its worker protocol is synchronous, so a worker handles one
    page at a time and concurrency is the process count. In served mode that worker
    only scales an image and makes an HTTP call, so making it concurrent -- or
    skipping the subprocess entirely, as chandra does -- is what would let surya use
    a large fleet.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01PxYHWbCAjjjD7A1rhFKtaW
    81235f2e
Name
Last commit
Last update
..
conftest.py Loading commit data...
test_admin_auth.py Loading commit data...
test_admin_forward_auth.py Loading commit data...
test_admin_remote_ui.py Loading commit data...
test_audio_ml_backends.py Loading commit data...
test_audio_ml_endpoints.py Loading commit data...
test_autoupgrade.py Loading commit data...
test_autoupgrade_recovers_a_down_server.py Loading commit data...
test_autoupgrade_sees_training.py Loading commit data...
test_broker_config.py Loading commit data...
test_broker_dispatch.py Loading commit data...
test_broker_protocol.py Loading commit data...
test_broker_shutdown.py Loading commit data...
test_broker_streaming.py Loading commit data...
test_burst_placement.py Loading commit data...
test_character_studio_fetch.py Loading commit data...
test_cluster.py Loading commit data...
test_compose.py Loading commit data...
test_forward_auth_peer_trust.py Loading commit data...
test_front_api_auth.py Loading commit data...
test_front_inflight_leak.py Loading commit data...
test_front_ocr_swap_gate.py Loading commit data...
test_image_has_c_compiler.py Loading commit data...
test_longcat_avatar_layout.py Loading commit data...
test_longcat_bsa.py Loading commit data...
test_longcat_cancellable.py Loading commit data...
test_longcat_checkpoint_resolve.py Loading commit data...
test_longcat_component_quant.py Loading commit data...
test_longcat_config_ui.py Loading commit data...
test_longcat_external_training.py Loading commit data...
test_longcat_int8_load.py Loading commit data...
test_longcat_lora.py Loading commit data...
test_longcat_orchestration.py Loading commit data...
test_longcat_packaging.py Loading commit data...
test_longcat_placement.py Loading commit data...
test_longcat_progress.py Loading commit data...
test_longcat_prompt_cache.py Loading commit data...
test_longcat_quantize.py Loading commit data...
test_longcat_scale.py Loading commit data...
test_longcat_tasks.py Loading commit data...
test_longcat_variants.py Loading commit data...
test_longcat_vendored_source.py Loading commit data...
test_longcat_venv_env.py Loading commit data...
test_longcat_vram_estimate.py Loading commit data...
test_longcat_worker.py Loading commit data...
test_manual_multimodal_test_client.py Loading commit data...
test_model_scan_cache.py Loading commit data...
test_ocr_accent_repair.py Loading commit data...
test_ocr_chandra.py Loading commit data...
test_ocr_confidence.py Loading commit data...
test_ocr_fanout.py Loading commit data...
test_ocr_language.py Loading commit data...
test_ocr_olmocr.py Loading commit data...
test_ocr_served_model.py Loading commit data...
test_ocr_token_trace.py Loading commit data...
test_ocr_unreadable_and_dpi.py Loading commit data...
test_ocr_vram_share_and_fallback.py Loading commit data...
test_olmocr_pod_tls.py Loading commit data...
test_oom_priority.py Loading commit data...
test_pod_log_drain.py Loading commit data...
test_proxy_logprobs.py Loading commit data...
test_remote_execution.py Loading commit data...
test_runpod_client_scale.py Loading commit data...
test_runpod_fleet_status.py Loading commit data...
test_runpod_global_volume.py Loading commit data...
test_runpod_ocr_remotization.py Loading commit data...
test_runpod_placement.py Loading commit data...
test_runpod_pod_extra_args.py Loading commit data...
test_runpod_reaper_grace.py Loading commit data...
test_runpod_scale_down.py Loading commit data...
test_runpod_schedule_region_spend.py Loading commit data...
test_runpod_warmup.py Loading commit data...
test_studio_composed_surfaces.py Loading commit data...
test_surya_runpod_fixes.py Loading commit data...
test_township_api_key.py Loading commit data...
test_township_clip_geometry.py Loading commit data...
test_township_longcat.py Loading commit data...
test_township_page_js.py Loading commit data...
test_township_templates.py Loading commit data...
test_township_video_dataset.py Loading commit data...
test_upgrade_launcher.py Loading commit data...
test_video_as_b64_scope.py Loading commit data...
test_video_geometry.py Loading commit data...
test_vllm_share_self_tuning.py Loading commit data...
test_vram_releasers.py Loading commit data...
test_weight_stores.py Loading commit data...
test_whisper_server_local_models.py Loading commit data...