Skip to content

osdc/hf-cache: self-heal rclone mount across a dead FUSE#876

Merged
huydhn merged 1 commit into
pytorch:mainfrom
huydhn:hf-cache-selfheal
Jul 22, 2026
Merged

osdc/hf-cache: self-heal rclone mount across a dead FUSE#876
huydhn merged 1 commit into
pytorch:mainfrom
huydhn:hf-cache-selfheal

Conversation

@huydhn

@huydhn huydhn commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

When rclone dies (e.g. OOM), the FUSE at /mnt/hf_cache goes stale ("transport endpoint is not connected") and containerd can't stat the volumeMount source, so the rclone container can't restart and every job pod on the node wedges in CreateContainerError until a manual unmount.

rclone now Bidirectional-mounts the stable parent /mnt instead of /mnt/hf_cache, so containerd always stats a live dir and the mount self-heals on restart. The init container also clears any dead FUSE on pod recreation.

Updated 2026-07-17:

  • Rebased onto current main (was ~18 commits behind; now sits on top of the GPU tiering / GOMEMLIMIT / per-tier buffer changes and the smoke-test refactor).
  • Switched all FUSE-clear calls from fusermount to fusermount3: the rclone image (rclone/rclone:1.69.1) and the AL2023 host both ship only the FUSE3 binary, so the previous fusermount -uz cleanups silently no-op'd (command not found) and never cleared a stale mount — which is exactly why mounts wedged. Verified in-cluster: command -v fusermount is empty, /usr/bin/fusermount3 is present.

⚠️ Still changes mount propagation (now the parent /mnt) — needs a staging soak before prod.

@huydhn
huydhn force-pushed the hf-cache-selfheal branch from 8123cf6 to 9997305 Compare July 7, 2026 16:59
@huydhn
huydhn force-pushed the hf-cache-selfheal branch from 9997305 to fad219c Compare July 17, 2026 17:26
@huydhn
huydhn marked this pull request as ready for review July 17, 2026 17:57
@huydhn
huydhn requested a review from jeanschmidt as a code owner July 17, 2026 17:57
Comment thread osdc/modules/hf-cache/kubernetes/mount-daemonset.yaml.tpl
Comment thread osdc/modules/hf-cache/kubernetes/mount-daemonset.yaml.tpl
@huydhn
huydhn force-pushed the hf-cache-selfheal branch from fad219c to eeefb92 Compare July 18, 2026 06:54
huydhn added a commit to huydhn/pytorch-ci-infra that referenced this pull request Jul 18, 2026
…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.
When rclone dies (e.g. OOM), the FUSE at /mnt/hf_cache goes stale
("transport endpoint is not connected") and containerd can't stat the
volumeMount source, so the rclone container can't restart and every job pod
on the node wedges in CreateContainerError until a manual unmount.

rclone now Bidirectional-mounts the stable parent /mnt instead of
/mnt/hf_cache, so containerd always stats a live dir and the mount self-heals
on restart; the init container also clears any dead FUSE on pod recreation.

Use fusermount3 (not fusermount) everywhere: the rclone image and the AL2023
host both ship only the FUSE3 binary, so the old 'fusermount -uz' cleanups
silently no-op'd (command not found) and never cleared a stale mount.
huydhn added a commit to huydhn/pytorch-ci-infra that referenced this pull request Jul 18, 2026
…h#917)

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 pytorch#876 adds self-heal so any residual OOM
recovers instead of wedging.
@huydhn
huydhn force-pushed the hf-cache-selfheal branch 2 times, most recently from 481a92c to 2214fc0 Compare July 18, 2026 23:12
@huydhn
huydhn enabled auto-merge July 22, 2026 06:36
@huydhn
huydhn added this pull request to the merge queue Jul 22, 2026
Merged via the queue into pytorch:main with commit 494edf2 Jul 22, 2026
13 checks passed
@huydhn
huydhn deleted the hf-cache-selfheal branch July 22, 2026 06:38
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