Skip to content

[serge] Fix 2 integration tests for model moshi failing with OOM (other (2)) - #48581

Open
sergereview[bot] wants to merge 2 commits into
mainfrom
serge/fix/itf-3604e3273d01-ccfe2501
Open

[serge] Fix 2 integration tests for model moshi failing with OOM (other (2))#48581
sergereview[bot] wants to merge 2 commits into
mainfrom
serge/fix/itf-3604e3273d01-ccfe2501

Conversation

@sergereview

@sergereview sergereview Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

CPU CI GPU run-slow

Original CI failure

  • Failure group: 2 integration tests for model moshifailing withOOM (other (2))
  • tests/models/moshi/test_modeling_moshi.py::MoshiIntegrationTests::test_moshiko_greedy_unconditional_fp16 — retained memory (fixable): needed 64 MiB, PyTorch already held 21.89 GiB of 22.30 GiB
CI traceback — tests/models/moshi/test_modeling_moshi.py::MoshiIntegrationTests::test_moshiko_greedy_unconditional_fp16
(line 1240)  torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 64.00 MiB. GPU 1 has a total capacity of 22.30 GiB of which 42.69 MiB is free. Process 702873 has 22.25 GiB memory in use. Of the allocated memory 21.89 GiB is allocated by PyTorch, with 22.00 MiB allocated in private pools (e.g., CUDA Graphs), and 39.78 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation.  See documentation for Memory Management  (https://docs.pytorch.org/docs/stable/notes/cuda.html#optimizing-memory-usage-with-pytorch-cuda-alloc-conf)

Where to watch it:

Relates to #48579

MoshiIntegrationTests::test_moshiko_greedy_unconditional_fp16 and fp32 fail with CUDA OOM because earlier tests in the same class leave models on the GPU; the 34–64 MiB allocation fails only because the device is already full.

Add a class-wide tearDown that calls cleanup(torch_device, gc_collect=True) after each test, matching the repo's idiom for large-model integration tests.

Possibly related

Existing issues/PRs mentioning test_moshiko_greedy_unconditional_fp16 (keyword match — not verified to share a root cause):

  • #46738 — 🚨 Modeling changes for export, compile, and hybrid-attention standardization (PR, closed, updated 2026-06-30)

This change was produced automatically by serge from a CI failure report. The patch was generated by an LLM and applied by serge; review before merging.

serge v0.1.0 · model: moonshotai/Kimi-K2.7-Code · 21 LLM turns · 20 tool calls · 28.9s · 217201 in / 2015 out tokens

@sergereview
sergereview Bot marked this pull request as ready for review September 6, 2026 22:37
@github-actions
github-actions Bot requested a review from ydshieh September 6, 2026 22:38
@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.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: moshi

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 34064587754:1
Result: success | Jobs: 5 | Tests: 562 | Failures: 0 | Duration: 3m 24s

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.

1 participant