Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions tests/lora/test_lora_layers_old_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ def prepare_init_args_and_inputs_for_common(self):
inputs_dict = self.dummy_input
return init_dict, inputs_dict

def test_lora_processors(self):
def test_lora_at_different_scales(self):
# enable deterministic behavior for gradient checkpointing
init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_common()

Expand All @@ -1514,9 +1514,6 @@ def test_lora_processors(self):
model.load_attn_procs(lora_params)
model.to(torch_device)

# test that attn processors can be set to itself
model.set_attn_processor(model.attn_processors)

with torch.no_grad():
sample2 = model(**inputs_dict, cross_attention_kwargs={"scale": 0.0}).sample
sample3 = model(**inputs_dict, cross_attention_kwargs={"scale": 0.5}).sample
Expand Down Expand Up @@ -1595,7 +1592,7 @@ def test_lora_xformers_on_off(self, expected_max_diff=6e-4):


@deprecate_after_peft_backend
class UNet3DConditionModelTests(unittest.TestCase):
class UNet3DConditionLoRAModelTests(unittest.TestCase):
model_class = UNet3DConditionModel
main_input_name = "sample"

Expand Down Expand Up @@ -1638,7 +1635,7 @@ def prepare_init_args_and_inputs_for_common(self):
inputs_dict = self.dummy_input
return init_dict, inputs_dict

def test_lora_processors(self):
def test_lora_at_different_scales(self):
init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_common()

init_dict["attention_head_dim"] = 8
Expand All @@ -1655,9 +1652,6 @@ def test_lora_processors(self):
model.load_attn_procs(unet_lora_params)
model.to(torch_device)

# test that attn processors can be set to itself
model.set_attn_processor(model.attn_processors)

with torch.no_grad():
sample2 = model(**inputs_dict, cross_attention_kwargs={"scale": 0.0}).sample
sample3 = model(**inputs_dict, cross_attention_kwargs={"scale": 0.5}).sample
Expand Down