Repository navigation
Studio diffusion: free the failed group offload setup before the OOM retry - #14821
Merged
Merged
Conversation
…retry The pipe kept the setup exception, and its traceback kept the failed frames alive, so whatever they had allocated stayed on the device through gc.collect and empty_cache in the lower-residency retry. Store only the type, message and OOM classification, and clear the record before the retry runs. Also pin the device name in three learned-peak tests whose fake torch had no get_device_name: they keyed the record on None and the lookup on the real card, so they failed whenever CUDA was visible.
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
danielhanchen
added a commit
that referenced
this pull request
Oct 23, 2026
… (#14885) Two files merged without the repo formatter, so pre-commit.ci's `ruff-format-with-kwargs` hook (which runs on all files) rewrites them on every PR queued after: - `studio/backend/tests/test_diffusion_learned_peaks.py` from #14821 (03:15 UTC) - `tests/test_fp8_scale_dequant_one_pass.py` from #14886 (03:49 UTC), folded in while this was in review Same class as #14817, #14852 and #14878. `python scripts/run_ruff_format.py` (the hook's entry point, `ruff==0.6.9`) applied to those two files. Both parse to identical ASTs before and after, `ruff check` passes, and a full run of the hook over every tracked Python file on this branch changes nothing else.
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.
When group offload setup ran out of memory, the pipe kept the exception, and its traceback kept the failed frames alive. Whatever those frames had allocated therefore stayed on the device through the
gc.collect()andempty_cache()of the lower-residency retry that needed the room.The stored failure is now only its type, its message and whether it was an OOM (still judged across the cause chain), and it is cleared before the retry runs.
Tests
test_the_setup_oom_retry_frees_what_the_failed_setup_allocateddrives the real setup and retry with a failing installer that holds a 4 MiB tensor, and checks it is gone when the retry installs.test_a_stored_setup_failure_keeps_its_kind_but_not_its_tracebackchecks that an OOM wrapped by another error still counts as an OOM. Both fail on main.get_device_name, so a peak was recorded under one device key and looked up under another. The device name is now pinned in those tests. On a B200: 3 failed on main, 104 passed here; CPU 103 passed.Not measured: how much a real diffusers group-offload OOM retains (only the synthetic 4 MiB).