Fix weird interaction between disk offload and group offload tests #10822
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.
Not quite sure what causes the following test failures: https://github.com/huggingface/diffusers/actions/runs/13384935248/job/37379809841#step:6:10497
From some debugging, the following seems to be happening:
test_disk_offload_without_safetensorsandtest_disk_offload_with_safetensorsruns first. This adds Accelerate hooks to handle device map correctly on the modelThis makes me believe Accelerate is applying hooks at the class-level instead of the instance-level (I'm not quite sure yet & will look into accelerate code as soon as I can).
I've added a new test (just for repro purposes) that shows the above behaviour consistently happens on some models. But for some models, it works without problems 🤷♂️
cc @SunMarc @DN6