Skip to content

Bandwidth-aware Run:ai streamer tuning + S3 Gateway VPC endpoint - #91

Merged
jicowan merged 2 commits into
mainfrom
feature/streamer-tuning-s3-endpoint
Aug 10, 2026
Merged

Bandwidth-aware Run:ai streamer tuning + S3 Gateway VPC endpoint#91
jicowan merged 2 commits into
mainfrom
feature/streamer-tuning-s3-endpoint

Conversation

@jicowan

@jicowan jicowan commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

Tunes the Run:ai model streamer per instance network bandwidth and adds an S3 Gateway VPC endpoint to keep model/image pulls off the NAT gateway.

  • Bandwidth-aware streamer profile (internal/runtime/instance_network.go): high-bandwidth instances (≥50 Gbps — g*.24xl/48xl, g6e.12xl+, g7e, p4/p5) get AWS's profile (4 GiB RUNAI_STREAMER_CHUNK_BYTESIZE + size-derived concurrency ceil(model_gb/4), capped 64); standard instances get run.ai's profile (no chunk override, flat concurrency 32). Explicit streamer_concurrency overrides either.
  • distributed:true in --model-loader-extra-config when TP>1, gated off at TP=1. Wired through single-node, D/P, and manifest export via one shared streamerExtraConfig so deploy and export can't drift.
  • S3 retry envs (RUNAI_STREAMER_S3_REQUEST_TIMEOUT_MS=3000, RUNAI_STREAMER_S3_LOW_SPEED_LIMIT=1048576) on every streamed load — both real (present in the streamer's C++ source).
  • S3 Gateway VPC endpoint (greenfield vpc module) — keeps S3 traffic (streamer + ECR image layers) on the AWS network instead of egressing through NAT.

Rationale confirmed against the run.ai C++ source and AWS per-instance network specs, not the markdown docs (which lag).

Live validation (2026-08-10)

Provisioned a fresh accelbench-eks and ran an end-to-end benchmark streaming a cached S3 model (Qwen2.5-1.5B on g6.2xlarge, a standard-bandwidth instance):

  • Live vLLM pod serve args showed --load-format runai_streamer + "concurrency":32 (run.ai standard-BW profile, no 4 GiB chunk env) + the S3 retry envs + memory_limit; no distributed at TP=1 — exactly as designed.
  • vLLM log: Loading safetensors using Runai Model Streamer: 100% Completed 338/338 in 3s.
  • Full run completed: TTFT p50 46.9 ms, 632 tps aggregate, cost recorded.
  • Image pulled through the Docker Hub ECR pull-through cache.

go test ./... + go vet ./... green. No frontend changes.

🤖 Generated with Claude Code

jicowan and others added 2 commits August 7, 2026 10:34
Every benchmark provisions a fresh GPU node that pulls model weights (Run:ai
streamer from S3) and S3-backed ECR image layers. Without an S3 Gateway
endpoint that traffic egresses through the NAT gateway — a shared bandwidth
ceiling + per-GB data-processing charge, and a bottleneck when multiple nodes
pull at once (AWS fast-model-loading guidance flags exactly this).

Add a Gateway VPC endpoint for S3 (free) that injects the S3 prefix-list route
into the private route tables, so S3 traffic stays on the AWS network. Wired in
the vpc module (new region var for the service name; route_table_ids from the
module's private_route_table_ids). Greenfield only — this module isn't created
in brownfield mode.

terraform validate green. (Not applied — infra is currently destroyed; lands on
the next greenfield apply.)

Signed-off-by: Jeremy Cowan <jicowan@hotmail.com>
Tune the Run:ai model streamer per instance network bandwidth, reconciling
AWS's EKS "fast model loading" guide with run.ai's upstream docs — the two
give different but internally-consistent profiles because the optimum
depends on the pipe:

- distributed:true in --model-loader-extra-config when TensorParallelDegree
  > 1 (both sources agree). Each vLLM rank streams its own shard over
  torch-distributed instead of rank-0 broadcasting; requires vLLM V1,
  incompatible with --enforce-eager. Omitted at TP=1. Wired through
  single-node, D/P (per-role TP), and the manifest export via one shared
  streamerExtraConfig so deploy and export can't drift.

- Bandwidth-aware chunk + concurrency (internal/runtime/instance_network.go,
  sourced from AWS EC2 accelerated-computing network specs):
    * High-bandwidth instances (>=50 Gbps: g*.24xl/48xl, g6e.12xl+, g7e,
      p4/p5) get AWS's profile — RUNAI_STREAMER_CHUNK_BYTESIZE=4 GiB +
      size-derived concurrency ceil(model_gb / 4), capped at 64.
    * Standard instances (the small/bursty G sizes, 2.5-40 Gbps) get run.ai's
      profile — no chunk override (8 MiB object-storage default) + the
      benchmarked flat concurrency 32.
  An explicit operator StreamerConcurrency overrides either profile.

- RUNAI_STREAMER_S3_REQUEST_TIMEOUT_MS=3000 + S3_LOW_SPEED_LIMIT=1048576 on
  every streamed load. Both are real (present in the streamer's C++ source,
  just undocumented in its markdown; upstream defaults 1000 ms / disabled) —
  they abort+retry a stalled S3 request and don't depend on bandwidth.

Rationale confirmed against the run.ai C++ source and AWS's per-instance
network specs rather than the markdown docs, which lag the code and are
hardware-specific. PP (co-located) never streams today, so distributed's
known TP+PP multi-group hang (run.ai #165) isn't reachable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Jeremy Cowan <jicowan@hotmail.com>
@jicowan
jicowan merged commit 2b8d038 into main Aug 10, 2026
7 checks passed
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