-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[HybridParallel] Add ParallelCrossEntropy for TensorParallel #33401
Conversation
Thanks for your contribution! |
if not return_softmax: | ||
return loss | ||
else: | ||
return loss, softmax |
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.
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)); |
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.
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)); |
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.
As 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.
LGTM for ShareDataWith because the usage is similar to old softmax_with_cross_entropy_op
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 for PADDLE_ENFORCE in kernel
PR types
New features
PR changes
APIs
Describe
[HybridParallel] Add ParallelCrossEntropy for TensorParallel