Ryan Dick
|
03944191db
|
Split test_autocast_modules.py into separate test files to mirror the source file structure.
|
2024-12-24 22:29:11 +00:00 |
|
Ryan Dick
|
987c9ae076
|
Move custom autocast modules to separate files in a custom_modules/ directory.
|
2024-12-24 22:21:31 +00:00 |
|
Ryan Dick
|
6d7314ac0a
|
Consolidate the LayerPatching patching modes into a single implementation.
|
2024-12-24 15:57:54 +00:00 |
|
Ryan Dick
|
80db9537ff
|
Rename model_patcher.py -> layer_patcher.py.
|
2024-12-24 15:57:54 +00:00 |
|
Ryan Dick
|
0148512038
|
(minor) Rename num_layers -> num_loras in unit tests.
|
2024-12-24 15:57:54 +00:00 |
|
Ryan Dick
|
d0f35fceed
|
Add test_apply_smart_lora_patches_to_partially_loaded_model(...).
|
2024-12-24 15:57:54 +00:00 |
|
Ryan Dick
|
cefcb340d9
|
Add LoRAPatcher.smart_apply_lora_patches()
|
2024-12-24 15:57:54 +00:00 |
|
Ryan Dick
|
0fc538734b
|
Skip flaky test when running on Github Actions, and further reduce peak unit test memory.
|
2024-12-24 14:32:11 +00:00 |
|
Ryan Dick
|
7214d4969b
|
Workaround a weird quirk of QuantState.to() and add a unit test to exercise it.
|
2024-12-24 14:32:11 +00:00 |
|
Ryan Dick
|
a83a999b79
|
Reduce peak memory used for unit tests.
|
2024-12-24 14:32:11 +00:00 |
|
Ryan Dick
|
f8a6accf8a
|
Fix bitsandbytes imports to avoid ImportErrors on MacOS.
|
2024-12-24 14:32:11 +00:00 |
|
Ryan Dick
|
f8ab414f99
|
Add CachedModelOnlyFullLoad to mirror the CachedModelWithPartialLoad for models that cannot or should not be partially loaded.
|
2024-12-24 14:32:11 +00:00 |
|
Ryan Dick
|
c6795a1b47
|
Make CachedModelWithPartialLoad work with models that have non-persistent buffers.
|
2024-12-24 14:32:11 +00:00 |
|
Ryan Dick
|
0a8fc74ae9
|
Add CachedModelWithPartialLoad to manage partially-loaded models using the new autocast modules.
|
2024-12-24 14:32:11 +00:00 |
|
Ryan Dick
|
dc54e8763b
|
Add CustomInvokeLinearNF4 to enable CPU -> GPU streaming for InvokeLinearNF4 layers.
|
2024-12-24 14:32:11 +00:00 |
|
Ryan Dick
|
1b56020876
|
Add CustomInvokeLinear8bitLt layer for device streaming with InvokeLinear8bitLt layers.
|
2024-12-24 14:32:11 +00:00 |
|
Ryan Dick
|
3f990393a1
|
Simplify the state management in InvokeLinear8bitLt and add unit tests. This is in preparation for wrapping it to support streaming of weights from cpu to gpu.
|
2024-12-24 14:32:11 +00:00 |
|
Ryan Dick
|
97d56f7dc9
|
Add torch module autocast unit test for GGUF-quantized models.
|
2024-12-24 14:32:11 +00:00 |
|
Ryan Dick
|
fe0ef2c27c
|
Add torch module autocast utilities.
|
2024-12-24 14:32:11 +00:00 |
|
Ryan Dick
|
d30a9ced38
|
Rename model_cache_default.py -> model_cache.py.
|
2024-12-24 14:23:18 +00:00 |
|
Ryan Dick
|
e0bfa6157b
|
Remove ModelCacheBase.
|
2024-12-24 14:23:18 +00:00 |
|
Ryan Dick
|
dd09509dbd
|
Rename ModelPatcher -> LayerPatcher to avoid conflicts with another ModelPatcher definition.
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
7fad4c9491
|
Rename LoRAModelRaw to ModelPatchRaw.
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
b820862eab
|
Rename ModelPatcher methods to reflect that they are general model patching methods and are not LoRA-specific.
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
c604a0956e
|
Rename LoRAPatcher -> ModelPatcher.
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
37e3089457
|
Push LoRA layer reshaping down into the patch layers and add a new FluxControlLoRALayer type.
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
fe09f2d27a
|
Move handling of LoRA scale and patch weight down into the layer patch classes.
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
606d58d7db
|
Add sidecar wrapper for FLUX RMSNorm layers to support SetParameterLayers used by FLUX structural control LoRAs.
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
c76a448846
|
Delete old sidecar_layers/ dir.
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
1e0552c813
|
Add optimized implementations for the LinearSidecarWrapper when using LoRALayer or ConcatenatedLoRALayer patch types (since these are the most common).
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
e2451ef5ca
|
A unit tests for LinearSidecarWrapper (and fix a bug).
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
3a8a5442ea
|
Add basic unit tests for SetParameterLayer.
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
693d42661c
|
Add basic unit tests for LoRALayer.
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
41664f88db
|
Rename backend/patches/conversions/ to backend/patches/lora_conversions/
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
42f8d6aa11
|
Rename backend/lora/ to backend/patches
|
2024-12-17 13:20:19 +00:00 |
|
Ryan Dick
|
a4bed7aee3
|
Minor tidy of FLUX control LoRA implementation. (mostly documentation)
|
2024-12-17 07:28:45 -05:00 |
|
Brandon Rising
|
046d19446c
|
Rename Structural Lora to Control Lora
|
2024-12-17 07:28:45 -05:00 |
|
Brandon Rising
|
f53da60b84
|
Lots of updates centered around using the lora patcher rather than changing the modules in the transformer model
|
2024-12-17 07:28:45 -05:00 |
|
Ryan Dick
|
c6fc82f756
|
Infer the clip_extra_context_tokens param from the state dict for FLUX XLabs IP-Adapter V2 models.
|
2024-11-18 17:06:53 -08:00 |
|
Ryan Dick
|
9a77e951d2
|
Add unit test for FLUX XLabs IP-Adapter V2 model format.
|
2024-11-18 17:06:53 -08:00 |
|
Ryan Dick
|
68c3b0649b
|
Add unit tests for FLUX diffusers LoRA without .proj_mlp layers.
|
2024-11-14 16:53:49 +00:00 |
|
Ryan Dick
|
8ef8bd4261
|
Add state dict tensor shapes for existing LoRA unit tests.
|
2024-11-14 16:53:49 +00:00 |
|
Darrell
|
fb19621361
|
Updated link to flux ip adapter model
|
2024-11-12 08:11:40 -05:00 |
|
Ryan Dick
|
740f6eb19f
|
Skip tests that use the meta device - they fail on the MacOS CI runners.
|
2024-10-22 15:56:49 +00:00 |
|
Ryan Dick
|
c2a8fbd8d6
|
(minor) Move infer_xlabs_ip_adapter_params_from_state_dict(...) to state_dict_utils.py.
|
2024-10-21 15:38:50 +00:00 |
|
Ryan Dick
|
f939dbdc33
|
Add is_state_dict_xlabs_ip_adapter() utility function.
|
2024-10-21 15:38:50 +00:00 |
|
Ryan Dick
|
24a0ca86f5
|
Add logic for loading an Xlabs IP-Adapter from a state dict.
|
2024-10-21 15:38:50 +00:00 |
|
Ryan Dick
|
95c30f6a8b
|
Add initial logic for inferring FLUX IP-Adapter params from a state_dict.
|
2024-10-21 15:38:50 +00:00 |
|
Ryan Dick
|
7bf5927c43
|
Add XLabs IP-Adapter state dict for unit tests.
|
2024-10-21 15:38:50 +00:00 |
|
Ryan Dick
|
6798bbab26
|
Skip tests that are failing on MacOS CI runners (for now).
|
2024-10-09 16:34:42 +00:00 |
|