Skip to content

ci: mitigate OOM kills on large-model export tests - #244

Merged
regisss merged 2 commits into
huggingface:mainfrom
JakeStevens:ci/oom-mitigation-large-models
Jul 22, 2026
Merged

ci: mitigate OOM kills on large-model export tests#244
regisss merged 2 commits into
huggingface:mainfrom
JakeStevens:ci/oom-mitigation-large-models

Conversation

@JakeStevens

Copy link
Copy Markdown
Collaborator

Large models (e.g. phi4 ~14.7B) exceed the 16GB RAM on standard ubuntu-22.04 runners and get OOM-killed during model load/quantization, surfacing as exit code 143 / 'The operation was canceled' rather than a test failure. Add an aggressive disk cleanup step and a 24GB swapfile so these jobs page to disk instead of being killed, plus a timeout-minutes so genuine hangs fail cleanly instead of dragging the run for hours.

Applied to both the stable (test_models.yml) and nightly (test_models_nightly.yml) workflows.

A larger runner can avoid the need for this swap, but this change keeps it within the current footprint and we can consider a larger runner in the future

Large models (e.g. phi4 ~14.7B) exceed the 16GB RAM on standard
ubuntu-22.04 runners and get OOM-killed during model load/quantization,
surfacing as exit code 143 / 'The operation was canceled' rather than a
test failure. Add an aggressive disk cleanup step and a 24GB swapfile so
these jobs page to disk instead of being killed, plus a timeout-minutes
so genuine hangs fail cleanly instead of dragging the run for hours.

Applied to both the stable (test_models.yml) and nightly
(test_models_nightly.yml) workflows.
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

The 'Free up disk space' step deleted $AGENT_TOOLSDIRECTORY
(/opt/hostedtoolcache), which is where actions/setup-python installs
Python -- removing it broke pip/pytest and caused 'pytest: command not
found' on every job. Root already has ~87GB free and the swapfile lives
on the separate /mnt disk, so the cleanup was unnecessary. Remove it and
keep only the swapfile + timeout.
@JakeStevens

Copy link
Copy Markdown
Collaborator Author

I think efficientnet failure is due to API request overload, potentially unrelated or maybe uncovered by more of these tests passing and so we have more rpm

Phi4 should be resolved by #245

@regisss
regisss merged commit 733e282 into huggingface:main Jul 22, 2026
84 of 86 checks passed
@JakeStevens
JakeStevens deleted the ci/oom-mitigation-large-models branch July 22, 2026 09:55
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.

4 participants