Skip to content

linux_job_v3: refresh the HF cache unattended, and honour the label off a PR - #8683

Open
huydhn wants to merge 1 commit into
mainfrom
osdc/hf-cache-writable
Open

linux_job_v3: refresh the HF cache unattended, and honour the label off a PR#8683
huydhn wants to merge 1 commit into
mainfrom
osdc/hf-cache-writable

Conversation

@huydhn

@huydhn huydhn commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

The refresh label is read from github.event.pull_request.labels, which only exists on a pull_request event. So the ciflow tag run sitting next to a labelled PR ignores it, writes at the read-only /mnt/hf_cache mount, and dies on any model the seeded cache does not carry:

OSError: [Errno 30] Read-only file system: '/mnt/hf_cache/hub/models--timm--inception_v4.tf_in1k'

Example: a tag run reporting HF_CACHE_REFRESH: 0 on a labelled PR's own commit.

Two changes, both following pytorch's _linux-test.yml:

  • A ciflow tag names its PR, so resolve the label off that — the same resolution filter_test_configs.py does.
  • schedule and workflow_dispatch refresh unconditionally. This is what keeps the cache seeded; otherwise the only way to add a model is to label a PR, which is also the only way to find out one was needed.

Anything else, a plain push included, does not refresh, so the read-only mount stays the default.

Tests

test-hf-cache-mode in test_linux_job_v3.yml already asserted whichever mode it was given; it now also requires that a workflow_dispatch run took the refresh branch, covering the unattended path.

The ciflow tag path has no coverage — test-infra has no ciflow tags to run against. I verified it by hand against pytorch/executorch: ciflow/trunk/22247 (labelled) resolves to refresh, ciflow/trunk/22106 (unlabelled) does not.

Authored with Claude Code.

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
torchci Ignored Ignored Sep 1, 2026 7:11am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 31, 2026
@huydhn
huydhn requested a review from atalman August 31, 2026 23:52
@huydhn
huydhn marked this pull request as draft August 31, 2026 23:53
@huydhn
huydhn force-pushed the osdc/hf-cache-writable branch from 45207f9 to b71aa4e Compare August 31, 2026 23:56
@huydhn huydhn changed the title linux_job_v3: give HF a writable cache on every run linux_job_v3: honour ci-refresh-hf-cache on push and tag runs Aug 31, 2026
@huydhn
huydhn force-pushed the osdc/hf-cache-writable branch from b71aa4e to 9133b90 Compare September 1, 2026 01:10
@huydhn huydhn changed the title linux_job_v3: honour ci-refresh-hf-cache on push and tag runs linux_job_v3: refresh the HF cache unattended, and honour the label off a PR Sep 1, 2026
@huydhn
huydhn requested a review from georgehong September 1, 2026 01:20
@huydhn
huydhn force-pushed the osdc/hf-cache-writable branch 5 times, most recently from c0b5cd1 to ab6c869 Compare September 1, 2026 07:07
…ff a PR

The refresh label is read from github.event.pull_request.labels, which only
exists on a pull_request event, so the ciflow tag run sitting next to a labelled
pull request ignores it, writes at the read-only /mnt/hf_cache mount, and dies on
any model the seeded cache does not carry:

  OSError: [Errno 30] Read-only file system: '/mnt/hf_cache/hub/models--...'

Two changes, both following pytorch's _linux-test.yml. A ciflow tag names its
pull request, so resolve the label off that, the same resolution
filter_test_configs.py does. And a schedule or workflow_dispatch run refreshes
unconditionally, which is what keeps the shared cache seeded -- otherwise the
only way to add a model is to label a pull request, which is also the only way
to notice one was needed.

Anything else, a plain push included, does not refresh, so the read-only mount
stays the default.

test-hf-cache-mode already asserted whichever mode it was given; it now also
requires that a workflow_dispatch run took the refresh branch, which covers the
unattended path. The ciflow tag path has no coverage: test-infra has no ciflow
tags to run against.

Authored with Claude Code.

@atalman atalman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants