Fix UniPC dtype handling with float64 default dtype - #1
Closed
lindicaphxag-tech wants to merge 1 commit into
Closed
lindicaphxag-tech wants to merge 1 commit into
lindicaphxag-tech wants to merge 1 commit into
Conversation
|
|
Owner
Author
|
Closing this fork-local validation PR because the upstream issue is already covered by huggingface#14920. The branch remains available for reference. |
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.
Validation PR for upstream issue huggingface#14888.
What does this PR do?
UniPC builds the final unit entry of
rkswithtorch.ones((), device=device). That tensor follows the global default dtype, while the other entries follow the scheduler coefficient dtype. Undertorch.set_default_dtype(torch.float64), this promotesRto float64 whilebremains float32 andtorch.linalg.solve(R, b)fails.This changes both UniP and UniC paths to
torch.ones_like(h), keeping the unit coefficient on the same dtype/device as the rest of the scheduler coefficients, and adds a regression test for a float64 global default.Validation
check_code_quality: passedcheck_repository_consistency: passedpytest -q tests/schedulers/test_scheduler_unipc.pypassedsize-labelexpects upstream labels such assize/Sthat do not exist in the fork.AI-assisted contribution self-review
AI assistance was used for issue triage, implementation, and validation. I reviewed the complete diff against Diffusers'
.ai/skills/self-reviewrubric and the testing/code-style/numerical-pitfall references.Blocking issues: none.
Non-blocking issues: none identified.
Dead code: none. Both changes are on the active UniP/UniC scheduler update paths.
Numerical review:
hhas the same dtype/device provenance as the otherrksentries, soones_like(h)removes the global-default-dtype leak without changing the normal float32 path.Verdict: READY.