Repository navigation
feat: enhance decision in --lora-apply-mode auto for quantized parameters - #2162
Merged
Merged
Conversation
If runnnig LoRAs using default --lora-apply-mode auto the automatic decision between modes "immediately" and "at_runtime" works very well, but there is still a minor gap if using command line options like --type q4_0 etc.
leejet
requested changes
Oct 18, 2026
leejet
left a comment
Owner
There was a problem hiding this comment.
Could we check each tensor’s effective type (expected_type when set, otherwise type) instead of only the global wtype?
--tensor-type-rules takes precedence over --type, but get_wtype_stat() only counts the original storage types. With a floating-point model:
- --tensor-type-rules 'model.diffusion_model.*=q4_0' still selects immediately, leaving the same class of issue unresolved.
- --type q4_0 --tensor-type-rules '.*=f16' now selects at_runtime, even though the resulting weights are not quantized.
Checking the effective types would cover both cases while preserving the existing INT8 tensorwise handling.
Contributor
Author
|
@leejet Thank you for your review! So here comes an update that addresses the mentioned issues. |
Owner
|
Thank you for your contribution. |
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.
If runnnig LoRAs using --lora-apply-mode auto the automatic decision between modes "immediately" and "at_runtime" works very well, but there is still a minor gap if using command line options like --type q4_0 etc.
This PR should solve the problem by checking the --type option.
Summary
Two examples will show the problem:
This first runs very well in at_runtime mode:
The sceond is similar but will crash because the --lora-apply-mode is is wrong state.
It runs in immediately mode - but should not:
At all: using --type q4_0 is the difference.
Related Issue / Discussion
Additional Information
Checklist
Summary by CodeRabbit