Skip to content

Commit 0755ab9

Browse files
FIX Faulty OFT parameter device test (#2630)
There is an error in an OFT test because .cpu() is called on a parameter instead of a module. Calling it on parameter is not an in-place operation, so it has no effect.
1 parent fa9e429 commit 0755ab9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_common_gpu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ def test_oft_add_new_adapter_does_not_change_device(self, mlp):
18841884
config = OFTConfig(target_modules=["lin0"])
18851885
model = get_peft_model(mlp, config)
18861886
model = model.to(self.device)
1887-
model.lin0.oft_R.default.weight.cpu()
1887+
model.lin0.oft_R.default.cpu()
18881888

18891889
# check that the adapter is indeed on CPU and the base model on GPU
18901890
assert model.lin0.oft_R.default.weight.device.type == "cpu"

0 commit comments

Comments
 (0)