-
Notifications
You must be signed in to change notification settings - Fork 1k
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
AttributeError: 'DistributedDataParallel' object has no attribute 'generate' when validating T5 model #754
Comments
Hello, |
Thanks for the quick response! I was able to implement the multi-gpu generation using the example. |
Hi @gansem , I am also looking for similar thing, I have trained t5 model, want to multi GPU inference on my custom dataset(csv), can you please share a snippet to do multi GPU inference. |
I am meeting the same problem on multi GPU inference for translation . |
Simply calling A minimal working example:
Calling +-----------------------------------------------------------------------------+ I hope this helps, let me know if you have any more questions :) |
@gansem I noticed you do have persistent mode turned based on |
System Info
Information
Tasks
no_trainer
script in theexamples
folder of thetransformers
repo (such asrun_no_trainer_glue.py
)Reproduction
Reproduction:
Stack trace:
Expected behavior
The expected behaviour for this code is to return an output tensor containing the tokens for the generated text just like a normal
T5ForConditionalGeneration
model would. It seems that the error is being raised becauseaccelerate.prepare()
returns aDistributedDataParallel
object which does not have this attribute. My question is if there is a way to do generation in a distributed manner? Currently I found a work around by unwrapping the model and running it on a single GPU. However, ideally I would like to do this in a multi-gpu setting as well.The text was updated successfully, but these errors were encountered: