Skip to content

[ET-VK][CI] Retry rate-limited HF snapshot downloads - #24002

Merged
SS-JIA merged 1 commit into
mainfrom
ssjia/vulkan-hf-rate-limit
Oct 21, 2026
Merged

SS-JIA merged 1 commit into
mainfrom
ssjia/vulkan-hf-rate-limit

Conversation

@SS-JIA

@SS-JIA SS-JIA commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix the Vulkan LLM job's Hugging Face HTTP 429 failure seen on PR #23892. Snapshot downloads now retry up to five times, respecting Retry-After and exhausted RateLimit quota resets. A one-second margin avoids rounded reset times; missing/invalid headers use exponential waits capped at five minutes. Other errors still propagate, and retry logs use stderr.

Review hf_download.py, then its regression tests in test_export_vulkan_llm.py. The tests exercise the actual Hub repository-listing client against a local HTTP server, plus bounded exhaustion and checksum/error guards.

Authored with OpenAI Codex.

Validation

Check Result
Parent implementation with retry regressions 9 expected failures, 4 passed
HTTP/download/checksum subset, Hub 1.33.0 16 passed
Same subset, Hub 0.36.2 16 passed
Lintrunner, both files Passed
NVIDIA end-to-end workflow Pending

Full reproduction commands are in the commit Test Plan.

URL lint follow-up

Synthetic HTTP-error request fixtures now use the reserved example.com domain. The exact URL checker returned HTTP 200 for both entries, seven affected tests passed, and CI URL lint passed.

@SS-JIA SS-JIA added the release notes: none Do not include this in the release notes label Oct 19, 2026
@pytorch-bot

pytorch-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24002

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 1 Pending, 2 Unrelated Failures

As of commit 7e86f65 with merge base c8b72ff (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@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 Oct 19, 2026
@SS-JIA
SS-JIA force-pushed the ssjia/vulkan-hf-rate-limit branch from b9f4837 to acc5869 Compare October 20, 2026 07:00
Summary:

The Vulkan LLM job failed on PR #23892 when Hugging Face returned HTTP 429
while listing the pinned Phi-4-mini checkpoint. Qwen and five Llama recipes
passed. Hub repository pagination bypasses its existing HTTP backoff helper.

Retry snapshot downloads up to five times for HTTP 429. Honor Retry-After
(seconds or HTTP-date) and exhausted RateLimit quota resets, with a one-second
rounding margin. Use bounded exponential waits when reset headers are absent
or invalid. Preserve pinned download arguments, checksum validation, and
path-only stdout; retry messages go to stderr. Other errors still fail promptly.

Read hf_download.py first, then test_export_vulkan_llm.py. Regression coverage
uses the real Hub repository-listing client against a local HTTP server that
returns 429 followed by success, and checks retry exhaustion/error propagation.

Authored with OpenAI Codex.

Test Plan:

## Observed Results

| Correctness validation | Environment | Result |
|---|---|---|
| New retry tests against parent helper | Python 3.11, Hub 1.33.0, local HTTP fixture | 9 expected failures, 4 passed |
| Retry/header/error/checksum subset | Python 3.11, Hub 1.33.0 (failed CI version) | 16 passed, 0 failed, 13 deselected |
| Same subset with older Hub | Python 3.11, Hub 0.36.2 | 16 passed, 0 failed, 13 deselected |
| Lintrunner on both changed files | macOS | Passed |
| Seven-model NVIDIA workflow with this fix | GitHub CI | Pending at publication |

| Performance validation | Result |
|---|---|
| Runtime/operator performance and end-to-end A/B | Not run; download retry change, no performance claim |

## Reproduction Guide

### Checkout and dependency setup

Install Git and Python 3.11. These focused HTTP/download tests need no GPU,
model checkpoint, native build, or full ExecuTorch installation.

```bash
git clone https://github.com/pytorch/executorch.git
cd executorch
git checkout ssjia/vulkan-hf-rate-limit
python3.11 -m venv .venv-hf-retry
.venv-hf-retry/bin/python -m pip install pytest pyyaml httpx==0.28.1 huggingface_hub==1.33.0
```

### Fixed implementation

Run the retry tests and existing pinned-download/checksum guards. The conftest
cutoff isolates HTTP tests from the repository-wide PyTorch fixture. A local
HTTP server emits the protocol responses; sleeps are recorded without waiting.

```bash
.venv-hf-retry/bin/python -m pytest --confcutdir=.ci/scripts/tests -q   .ci/scripts/tests/vulkan/test_export_vulkan_llm.py   -k 'rate_limit or other_http_errors or existing_hf_download'
```

### Parent reproducer

Copy the current tests into a temporary directory and retrieve the parent
helper. The retry cases fail because the parent aborts on the first 429.
This keeps the checked-out implementation intact.

```bash
ET_HF_PARENT=$(mktemp -d)
mkdir -p "$ET_HF_PARENT/.ci/scripts/tests/vulkan" "$ET_HF_PARENT/examples/models/llama"
cp .ci/scripts/tests/vulkan/test_export_vulkan_llm.py   "$ET_HF_PARENT/.ci/scripts/tests/vulkan/test_export_vulkan_llm.py"
git show HEAD^:examples/models/llama/hf_download.py   > "$ET_HF_PARENT/examples/models/llama/hf_download.py"
.venv-hf-retry/bin/python -m pytest   --confcutdir="$ET_HF_PARENT/.ci/scripts/tests" -q   "$ET_HF_PARENT/.ci/scripts/tests/vulkan/test_export_vulkan_llm.py"   -k 'rate_limit or other_http_errors'
```

### Older Hub compatibility

```bash
.venv-hf-retry/bin/python -m pip install huggingface_hub==0.36.2
.venv-hf-retry/bin/python -m pytest --confcutdir=.ci/scripts/tests -q   .ci/scripts/tests/vulkan/test_export_vulkan_llm.py   -k 'rate_limit or other_http_errors or existing_hf_download'
```

### Lint

```bash
python3.11 -m pip install lintrunner lintrunner-adapters
lintrunner init
lintrunner lint --output oneline examples/models/llama/hf_download.py   .ci/scripts/tests/vulkan/test_export_vulkan_llm.py
```

### GPU workflow

The existing Vulkan workflow installs dependencies, builds the runner, then
exports/tests all seven pinned recipes on NVIDIA. Check its job and download
the vulkan-llm-e2e artifact to inspect results.tsv and per-model download logs.
The regression's failing run is internet-accessible:
https://github.com/pytorch/executorch/actions/runs/39289788119/job/118187613858

No runtime performance validation was run.

Reviewers:
@SS-JIA
SS-JIA force-pushed the ssjia/vulkan-hf-rate-limit branch from acc5869 to 7e86f65 Compare October 20, 2026 15:53
@SS-JIA
SS-JIA merged commit 86b967e into main Oct 21, 2026
422 of 426 checks passed
@SS-JIA
SS-JIA deleted the ssjia/vulkan-hf-rate-limit branch October 21, 2026 14:43

This branch was successfully deployed

1 active deployment
cadence — 7e86f651 Deployed Oct 20, 2026 by SS-JIA via hifi-op-test / hifi4 #34201
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. release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants