Repository navigation
override Flux transformer #639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a40c25e
override Flux transformer
dxqb c5c08a2
ignore hugging face connection error for offline training
dxqb b60968d
pre-commit fix
dxqb 395d078
Merge branch 'Nerogar:master' into master
dxqb a441f04
Merge branch 'Nerogar:master' into master
dxqb 0fb8512
Merge branch 'Nerogar:master' into master
dxqb a1a263d
Merge branch 'Nerogar:master' into master
dxqb ae2e7ce
Merge branch 'master' of https://github.com/dxqbYD/OneTrainer
dxqb aec59b6
clean exit
dxqb 15967e6
Merge branch 'Nerogar:master' into override_transformer
dxqb 93fe9e0
Merge branch 'master' of https://github.com/dxqbYD/OneTrainer
dxqb 6fefde0
Merge branch 'master' of https://github.com/dxqbYD/OneTrainer
dxqb af3cea8
Merge branch 'master' of https://github.com/dxqbYD/OneTrainer
dxqb 0aa6c63
Merge branch 'master' of https://github.com/dxqbYD/OneTrainer
dxqb 7929cb3
Merge branch 'master' into override_transformer
dxqb bf38e55
avoid loading in float32; bugfix
dxqb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could now quantize the weights twice if the source is not in bf16 format. For example, if weight_dtypes.prior is set to fp8, and the source is in fp32, then this will first convert to bf16 (losing precision). Then the actual quantization to fp8 is done.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is model-specific code and Flux was published in bf16, so I don't think we have to worry about precision loss from fp32.
the alternative is mentioned here, #639 (comment), to let the user choose a load dtype.
The current behaviour is to load a fp8 source to fp32 and load a bf16 source to bf16. Loading fp8 sources needs 48 GB vram just for that.
new behaviour is to load both to bf16.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that argument is only true for the base flux model released by BFL. Fine tunes can be distributed in any other precision. There was some discussion about a possible solution in the diffusers library, but it didn't really reach any conclusion huggingface/diffusers#10679
A load d type could work, but I can almost guarantee you that there will be a lot of questions about that setting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave it as proposed in the PR.
It's not ideal, but an improvement for all current use cases, which is fp8 and bf16 transformer files. Precision loss can happen only if you had a fp32 transformer file and wanted to load it in fp8, and what's the point of that? If you specifically created an fp32 transformer for some reason on your own (because none exist AFAIK), you would load it in fp32 and not in fp8