Skip to content
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

[HybridParallel] Add ParallelCrossEntropy for TensorParallel #33401

Merged
merged 6 commits into from
Jun 9, 2021

Conversation

ForFishes
Copy link
Member

PR types

New features

PR changes

APIs

Describe

[HybridParallel] Add ParallelCrossEntropy for TensorParallel

@paddle-bot-old
Copy link

paddle-bot-old bot commented Jun 7, 2021

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

if not return_softmax:
return loss
else:
return loss, softmax

Choose a reason for hiding this comment

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

Given an error if in static mode?

PADDLE_ENFORCE_CUDA_SUCCESS(platform::dynload::ncclAllReduce(
predict_logits_buff, predict_logits_buff, predicted_logits.numel(),
platform::ToNCCLDataType(predicted_logits.type()), ncclSum,
comm->comm(), stream));

Choose a reason for hiding this comment

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

should use #ifdef PADDLE_WITH_NCCL to use nccl function?

PADDLE_ENFORCE_CUDA_SUCCESS(platform::dynload::ncclAllReduce(
sum_exp_logits_buff, sum_exp_logits_buff, sum_exp_logits.numel(),
platform::ToNCCLDataType(sum_exp_logits.type()), ncclSum, comm->comm(),
stream));

Choose a reason for hiding this comment

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

As above.

Copy link
Member

@zhhsplendid zhhsplendid left a comment

Choose a reason for hiding this comment

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

LGTM for ShareDataWith because the usage is similar to old softmax_with_cross_entropy_op

Copy link
Contributor

@chenwhql chenwhql left a comment

Choose a reason for hiding this comment

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

LGTM for PADDLE_ENFORCE in kernel

@ForFishes ForFishes merged commit 5200791 into PaddlePaddle:develop Jun 9, 2021
@ForFishes ForFishes deleted the parallel_cross_entropy branch June 9, 2021 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants