Skip to content

feat: CUDA kernel warmup to fix cold-start latency - #11

Open
abimaelmartell wants to merge 8 commits into
mainfrom
feat/cuda-warmup
Open

abimaelmartell wants to merge 8 commits into
mainfrom
feat/cuda-warmup

Conversation

@abimaelmartell

Copy link
Copy Markdown
Member

Summary

  • Pre-compile CUDA/cuDNN kernels at startup via synthetic PDF inference and OCR-det shape warming (~255 shapes)
  • Pin inference to a dedicated GPU thread so warmed kernel caches are reused on real requests
  • Fixes inconsistent cold-start latency (30s vs 3m) on serverless workers

Pre-compile CUDA/cuDNN kernels at startup by running synthetic inference
and warming all ~255 OCR-det resolution shapes. Pins inference to a
dedicated GPU thread so warmed caches are reused on real requests.
- batch_sizes.patch: Increases YOLO_LAYOUT_BASE_BATCH_SIZE and
  MFD_BASE_BATCH_SIZE from 1 to 8 for better GPU utilization on
  the first two pipeline stages (~3-4s savings on 53 pages).

- wired_table_cuda.patch: Enables CUDAExecutionProvider for the
  wired table UNet ONNX model which was running CPU-only. This
  moves table structure inference from CPU to GPU, reducing the
  16s table-wired bottleneck significantly.
RunPod serverless starts its HTTP server on port 8000 only after
model loading and CUDA warmup complete. The healthcheck lets RunPod
know when the worker is ready to accept requests. 10-minute
start-period covers the warmup phase.
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.

1 participant