Skip to content

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

Merged
merged 10 commits into from
Aug 20, 2024
Merged

Conversation

warrentdrew
Copy link
Contributor

PR types

New features

PR changes

Others

Describe

SpeedySpeech code adaption for npu, add device support and training, synthesize, synthesize_e2e and inference scripts

@@ -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.")
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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."
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"--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."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -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":
Copy link
Collaborator

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.

Copy link
Contributor Author

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")
Copy link
Collaborator

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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or?

Copy link
Collaborator

@zxcd zxcd left a 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.

@zxcd zxcd merged commit 0b56813 into PaddlePaddle:develop Aug 20, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants