fix(schedulers): guard Helios schedulers against float64 on MPS - #14427
Open
erensh27 wants to merge 2 commits into
Open
fix(schedulers): guard Helios schedulers against float64 on MPS#14427erensh27 wants to merge 2 commits into
erensh27 wants to merge 2 commits into
Conversation
The labeler LLM is told to pick from a fixed set of labels, but several of those labels do not exist in the repo (e.g. 'compile', 'attention-backends', 'torchao', 'new-pipeline/model'). Applying any of them with 'gh issue edit --add-label' fails the whole job, so most bug reports end up with no labels at all (issue huggingface#14377: 'needs-env-info'). Filter the model output against the repo's actual label list before applying, and emit a warning for any label that does not exist instead of failing the run.
Both Helios schedulers built float64 tensors without the MPS guard used elsewhere in the codebase, raising TypeError on Apple Silicon the moment the pipeline set timesteps (or reached convert_flow_pred_to_x0). - set_timesteps (both schedulers): when the target device is MPS, cast the numpy schedule to float32 before from_numpy, and force the concatenated sigma tensor to float32 (mps does not support float64). - convert_flow_pred_to_x0 (HeliosDMDScheduler): use float64 for calculation on non-MPS devices, fall back to float32 on MPS. Mirrors the existing device guard in scheduling_consistency_models.py and scheduling_cosine_dpmsolver_multistep.py.
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.
Fixes #14367.
Both Helios schedulers build
float64tensors without the MPS guard used elsewhere in the codebase, so on Apple Silicon the pipeline fails withTypeErrorat the first scheduler call.Changes in
src/diffusers/schedulers/scheduling_helios.pyandscheduling_helios_dmd.py:set_timesteps(both): when the target device is MPS, cast the NumPy schedule tofloat32beforefrom_numpyand force the concatenatedsigmastensor tofloat32— mps does not support float64. Non-MPS behavior unchanged.convert_flow_pred_to_x0(HeliosDMDScheduler): keepfloat64for the high-precision calculation on non-MPS devices; usefloat32on MPS instead ofx.double().to(device).Mirrors the existing guard in
scheduling_consistency_models.py/scheduling_cosine_dpmsolver_multistep.py.