-
Notifications
You must be signed in to change notification settings - Fork 1.9k
speedyspeech code adapt for npu #3804
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
Conversation
paddlespeech/t2s/exps/synthesize.py
Outdated
@@ -219,12 +219,18 @@ def parse_args(): | |||
) | |||
# other | |||
parser.add_argument( | |||
"--ngpu", type=int, default=1, help="if ngpu == 0, use cpu or xpu.") | |||
"--ngpu", type=int, default=1, help="if ngpu == 0, use cpu or xpu or npu.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix grammar, do not use too much or.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
paddlespeech/t2s/exps/synthesize.py
Outdated
parser.add_argument( | ||
"--nxpu", | ||
type=int, | ||
default=0, | ||
help="if wish to use xpu, set ngpu == 0 and nxpu > 0, and if ngpu == 0 and nxpu == 0, use cpu." | ||
help="if wish to use xpu, set ngpu == 0 and nxpu > 0, and if ngpu == 0 and nxpu == 0 and nnpu == 0, use cpu." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help should be written more concisely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
paddlespeech/t2s/exps/synthesize.py
Outdated
"--nnpu", | ||
type=int, | ||
default=0, | ||
help="if wish to use npu, set ngpu == 0 and nxpu == 0 and nnpu > 0, and if ngpu == 0 and nxpu == 0 and nnpu == 0, use cpu." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
paddlespeech/t2s/exps/syn_utils.py
Outdated
@@ -591,7 +591,8 @@ def get_predictor( | |||
|
|||
config = inference.Config( | |||
str(Path(model_dir) / model_file), str(Path(model_dir) / params_file)) | |||
config.enable_memory_optim() | |||
if device != "npu": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to check why can not support here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
paddle.set_device("cpu") | ||
else: | ||
print("ngpu or nxpu should >= 0 !") | ||
print("ngpu, nxpu and nnpu should be >= 0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or?
paddle.set_device("cpu") | ||
else: | ||
print("ngpu or nxpu should >= 0 !") | ||
print("ngpu, nxpu and nnpu should be >= 0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, pls fix it in next pr.
PR types
New features
PR changes
Others
Describe
SpeedySpeech code adaption for npu, add device support and training, synthesize, synthesize_e2e and inference scripts