Closed
Conversation
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
3f0515d to
b99bb72
Compare
Contributor
Author
|
closing as already elegantly implemented by @ServeurpersoCom |
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.
This pull request adds LoRA (Low-Rank Adaptation) support to the
dit-vaepipeline, enabling users to apply PEFT LoRA adapters insafetensorsformat for more flexible and efficient model fine-tuning. The changes include new code for loading LoRA adapters, modifications to the DiT model to support LoRA at key projection points, and updated documentation and examples to demonstrate usage.LoRA integration and model changes:
src/dit-lora.cpp, which implements loading LoRA adapters from PEFT-compatiblesafetensorsfiles and integrates them into the DiT model by mapping adapter weights to the appropriate layers and projections.src/dit-graph.hto support LoRA at all major linear projections (self-attention, cross-attention, and MLP layers) by introducing thedit_ggml_linear_lorahelper and updating all relevant computation paths to optionally add LoRA contributions. [1] [2] [3] [4] [5] [6] [7]Build system and CLI updates:
CMakeLists.txtto includesrc/dit-lora.cppwhen building thedit-vaeexecutable, enabling LoRA support in the main pipeline.Documentation and usage examples:
README.mdwith a new section describing LoRA support, usage instructions for the new--loraand--lora-scaleoptions, and example commands and JSON inputs.examples/lora.shandexamples/lora.jsonto provide a fully working example of using a LoRA adapter in the pipeline. [1] [2]