You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the following error when attempting to use LoRa with Llama 2
File "/path/libraries/conda/lib/python3.9/site-packages/tensor_parallel/wrapper.py", line 75, in __getattr__
return getattr(self.tp_wrapped_module, attr)
[Previous line repeated 2979 more times]
RecursionError: maximum recursion depth exceeded
caused by the peft module executing: if getattr(model, "is_gradient_checkpointing", True):
Below is the minimal reproducible example that breaks when using tensor parallel and works when disabling it
When settings USE_TENSOR_PARALLEL = False the code works, but when setting USE_TENSOR_PARALLEL = True I get the following error:
-- Process 0 terminated with the following error:
Traceback (most recent call last):
File "/path/libraries/conda/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
fn(i, *args)
File "/path/projects/silos/TEST_tensor_parallel.py", line 24, in _wrap_main_fn
main_fn(rank)
File "/path/projects/silos/TEST_tensor_parallel.py", line 56, in main_fn
get_model(devices[rank])
File "/path/projects/silos/TEST_tensor_parallel.py", line 49, in get_model
model_peft = get_peft_model(model, peft_config)
File "/path/libraries/conda/lib/python3.9/site-packages/peft/mapping.py", line 105, in get_peft_model
return PeftModel(model, peft_config, adapter_name=adapter_name)
File "/path/libraries/conda/lib/python3.9/site-packages/peft/peft_model.py", line 120, in __init__
if getattr(model, "is_gradient_checkpointing", True):
File "/path/libraries/conda/lib/python3.9/site-packages/transformers/modeling_utils.py", line 1745, in is_gradient_checkpointing
return any(hasattr(m, "gradient_checkpointing") and m.gradient_checkpointing for m in self.modules())
File "/path/libraries/conda/lib/python3.9/site-packages/transformers/modeling_utils.py", line 1745, in <genexpr>
File "/path/libraries/conda/lib/python3.9/site-packages/transformers/modeling_utils.py", line 1745, in <genexpr>
return any(hasattr(m, "gradient_checkpointing") and m.gradient_checkpointing for m in self.modules())
File "/path/libraries/conda/lib/python3.9/site-packages/tensor_parallel/wrapper.py", line 75, in __getattr__
return getattr(self.tp_wrapped_module, attr)
File "/path/libraries/conda/lib/python3.9/site-packages/tensor_parallel/wrapper.py", line 75, in __getattr__
return getattr(self.tp_wrapped_module, attr)
File "/path/libraries/conda/lib/python3.9/site-packages/tensor_parallel/wrapper.py", line 75, in __getattr__
return getattr(self.tp_wrapped_module, attr)
[Previous line repeated 2979 more times]
RecursionError: maximum recursion depth exceeded
The text was updated successfully, but these errors were encountered:
When setattr(parent, child_name, new_module) is executed, and parent is a tensor parallel wrapper, child_name is a string "tp_wrapped_module", new_module is a lora linear layer.
Ar-Kareem
added a commit
to Ar-Kareem/tensor_parallel
that referenced
this issue
Oct 2, 2023
I get the following error when attempting to use LoRa with Llama 2
caused by the
peft
module executing:if getattr(model, "is_gradient_checkpointing", True):
Below is the minimal reproducible example that breaks when using tensor parallel and works when disabling it
When settings
USE_TENSOR_PARALLEL = False
the code works, but when settingUSE_TENSOR_PARALLEL = True
I get the following error:The text was updated successfully, but these errors were encountered: