Repository navigation
[serge] Fix 2 integration tests for model cohere2_vision failing with OOM, raising OutOfMemoryError (other (2)) - #50483
Open
sergereview[bot] wants to merge 1 commit into
Open
sergereview[bot] wants to merge 1 commit into
sergereview[bot] wants to merge 1 commit into
Conversation
…th `OOM`, raising `OutOfMemoryError` (other (2))
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: cohere2_vision |
|
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. |
This was referenced Nov 9, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original CI failure
2 integration tests for modelcohere2_visionfailing withOOM, raisingOutOfMemoryError(other (2))tests/models/cohere2_vision/test_modeling_cohere2_vision.py::Cohere2IntegrationTest::test_model_integration_batched_generate— retained memory (fixable): needed 288 MiB, PyTorch already held 21.68 GiB of 22.30 GiBCI traceback —
tests/models/cohere2_vision/test_modeling_cohere2_vision.py::Cohere2IntegrationTest::test_model_integration_batched_generateWhere to watch it:
Relates to #50482
test_model_integration_forwardandtest_model_integration_batched_generateOOM on a 288 MiB copy duringfrom_pretrained.Not retained memory: the class already uses
MemoryCleanupMixin, each test loads exactly one model, and both reproduced tracebacks fail at the same weight key with the same 21.68 GiB already allocated on GPU 1 — that is the checkpoint being loaded in that call, not a leftover from an earlier test.Root cause is the load pattern:
device_map="auto"budgets each device to its full capacity when several are visible, so the last weight copy has no headroom. The patch adds the per-GPUmax_memorycap (70%, plus a CPU budget) already used byphimoe,glm4_moe,glm4v_moe,flex_olmoandqwen3_omni_moefor the same failure. No coverage is reduced and no expected values change.✅ Verified on GPU
serge ran the targeted
@slowtest(s) on a GPU runner and opened this PR only after they passed with this patch. Each targeted test was run 5× on both the pre-patch and patched trees to rule out flakiness — the result held on every run.Possibly related
Existing issues/PRs mentioning
test_model_integration_batched_generate(keyword match — not verified to share a root cause):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:deepseek-ai/DeepSeek-V4.1-Flash-1017:together· 46 LLM turns · 69 tool calls · 585.3s · 2157099 in / 203496 out tokens