-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move peft imports to avoid RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase #30
Conversation
Thank you @geronimi73 much appreciated :) |
Sorry, I still met this problem using the merged code
|
try again after |
thanks for your response,
|
pip list
8xA6000 48G, CUDA Version: 12.2 |
can't reproduce with those packages. give me the entire |
Thanks for your patience! Here is the complete list: |
Check if this works: in Line 1036 in 467933f code to insert: if __name__ != '__main__':
return your code starting from line entity: str = None, # For wandb logging
):
if __name__ != '__main__':
return
# Set world size
if world_size == -1:
world_size = torch.cuda.device_count()
print(f"World size: {world_size}") then try again |
Thanks! I'll give this a try later. |
I successfully ran the code! Thank you very much. This project is wonderful! |
👍 which OS are you on, windows? |
Ubuntu 22.04.2 LTS in Docker |
@iseesaw could you please check if this runs or throws the same error: import torch.multiprocessing as mp
from fastcore.script import call_parse
print(f"script. {__name__}")
def do_something(inp):
print('do_something')
@call_parse
def main():
print('main')
mp.spawn(
do_something,
nprocs=2,
join=True
)
print('Finished') |
I tested the code, and it executed successfully without any errors. Here is the output I observed:
|
i'm still trying to understand why this error happens. are you using the original |
The error may be related to the use of multiprocessing for dataset processing. To adapt to different model chat templates, I modified the My apologies for any confusion caused. This modification could be the source of the problem. |
It seems that something in
autoawq
causes aRuntimeError
intrain.py
if the package (autoawq
) is imported before process forking.peft
, starting from0.9
importsautoawq
. This PR moves the peft imports after process forking and thereby prevents theRuntimeError
withpeft>=0.9
.Related issue: #28