Skip to content

osdc/hf-cache: per-tier rclone --buffer-size (CPU 0, gpu1 2M) - #917

Merged
huydhn merged 1 commit into
pytorch:mainfrom
huydhn:hf-cache-buffer-size-2m
Jul 18, 2026
Merged

osdc/hf-cache: per-tier rclone --buffer-size (CPU 0, gpu1 2M)#917
huydhn merged 1 commit into
pytorch:mainfrom
huydhn:hf-cache-buffer-size-2m

Conversation

@huydhn

@huydhn huydhn commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Makes rclone --buffer-size a per-tier value in deploy.sh instead of one global flag. Read-ahead RAM scales as (concurrent open shards) × buffer-size, and peak concurrency scales with a node's pod density, so the tight small tiers need less read-ahead:

  • CPU catch-all (256Mi) — densely packed (many runner pods per node share one mount) → --buffer-size 0 (read-ahead off; served from the --vfs-cache-mode full on-disk cache).
  • 1-GPU tier (512Mi)--buffer-size 2M (a single HF model opening ~100+ shards at 4M overruns the 512Mi reserve; observed OOMs on g5.16xlarge gpu1 nodes).
  • multi-GPU tiers (1–4Gi)--buffer-size 4M (roomier reserve, keep more prefetch).

Addresses the OOM driver on both small tiers via buffer sizing. Note this is buffer-size only; the deeper fix (mount reserve sized to pod density) can follow, and #876 adds self-heal so any residual OOM recovers instead of wedging.

@huydhn
huydhn requested a review from jeanschmidt as a code owner July 17, 2026 17:06
@huydhn huydhn changed the title osdc/hf-cache: lower rclone --buffer-size 4M -> 2M osdc/hf-cache: per-tier rclone --buffer-size (CPU 0, GPU 2M) Jul 17, 2026
@huydhn
huydhn force-pushed the hf-cache-buffer-size-2m branch from 418d12e to abbf25e Compare July 17, 2026 17:19
@huydhn huydhn changed the title osdc/hf-cache: per-tier rclone --buffer-size (CPU 0, GPU 2M) osdc/hf-cache: set CPU-tier rclone --buffer-size to 0 Jul 17, 2026
@huydhn
huydhn force-pushed the hf-cache-buffer-size-2m branch from abbf25e to a257b56 Compare July 17, 2026 17:22
@jeanschmidt

Copy link
Copy Markdown
Contributor

do we know that --buffer-size is the culprit here? If it was, it should have been fixed when we lowered to 4MiB, correct?

@huydhn

huydhn commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

do we know that --buffer-size is the culprit here? If it was, it should have been fixed when we lowered to 4MiB, correct?

There is no single culprit, as both memory limit and the size of of nodes are involved. Lower buffer size does help reduce the memory footprint, but in a bigger node with multiple pods, it's not enough. 4MB is not low enough for CPU nodes that only has 256MB granted to rclone. That's why you see OOM crash concentrated on CPU nodes, not GPU ones which allocate more memory to rclone

@jeanschmidt

Copy link
Copy Markdown
Contributor

yaeah, but the question is that this knob is substantial or marginal. But maybe worth releasing any way.

@huydhn
huydhn force-pushed the hf-cache-buffer-size-2m branch from a257b56 to 66df31b Compare July 18, 2026 00:32
@huydhn huydhn changed the title osdc/hf-cache: set CPU-tier rclone --buffer-size to 0 osdc/hf-cache: per-tier rclone --buffer-size (CPU 0, gpu1 2M) Jul 18, 2026
@huydhn
huydhn force-pushed the hf-cache-buffer-size-2m branch 4 times, most recently from 273e10a to fe71d5f Compare July 18, 2026 09:05
…to 640Mi

CPU-tier (r7i/m7i) rclone OOMs persist at buffer 0 AND at 512Mi (both clusters OOM'd
again at ~14:00 and ~18:00 under load), because the OOM is rclone heap/vfs-item/
dir-cache overhead, not read-ahead. Raise CPU catch-all 256->640Mi and gpu1 512->640Mi
(GOMEMLIMIT ~576MiB). 640Mi is the safe ceiling: 1Gi strands the tight nodes
(c7i.metal-24xl/r7a.12xlarge for CPU, a10g/l4/t4 8xl for gpu1) per
analyze_node_utilization; at 640Mi all fit (c7i.metal 328Mi / r7a.12xl 331Mi / g4dn.8xl
168Mi free). Residual peak-load OOMs still possible -> pair with pytorch#876 self-heal.
@huydhn
huydhn force-pushed the hf-cache-buffer-size-2m branch from fe71d5f to 81f7a8d Compare July 18, 2026 18:16
@huydhn
huydhn added this pull request to the merge queue Jul 18, 2026
Merged via the queue into pytorch:main with commit f4e7d8b Jul 18, 2026
14 checks passed
@huydhn
huydhn deleted the hf-cache-buffer-size-2m branch July 18, 2026 22:39
huydhn added a commit to huydhn/pytorch-ci-infra that referenced this pull request Jul 18, 2026
…#917)

pytorch#917 raised the CPU catch-all and 1-GPU reserves to 640Mi in deploy.sh but the
smoke test's MOUNT_TIERS still asserted 256Mi/512Mi, failing 'deploy-fast / Smoke
tests'. Sync the smoke-test expectations to deploy.sh.
huydhn added a commit to huydhn/pytorch-ci-infra that referenced this pull request Jul 18, 2026
…#917)

pytorch#917 raised the CPU catch-all and 1-GPU reserves to 640Mi in deploy.sh but the
smoke test's MOUNT_TIERS still asserted 256Mi/512Mi, failing 'deploy-fast / Smoke
tests'. Sync the smoke-test expectations to deploy.sh.
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.

2 participants