-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Optimizing the performance of fused_layer_norm and top_p_sampling operators #65711
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
Optimizing the performance of fused_layer_norm and top_p_sampling operators #65711
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
| float random_ratio = exponential_transform(curand_uniform(&state), 1.0f); | ||
| float random_ratio = | ||
| exponential_transform(curand_uniform(states + bid), 1.0f); | ||
| #endif |
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.
这里也可以用GPU(rand_uniform)包起来
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
| for (int i = idx; i < bs; i += gridDim.x * blockDim.x) { | ||
| if (need_batch_random) { | ||
| #ifdef PADDLE_WITH_HIP | ||
| hiprand_init(seed, i, offset, &state[i]); |
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.
函数也可以用宏定义:GPU(rand_init)
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
| PD_THROW( | ||
| "the input data shape has error in the topp_beam_topk kernel."); | ||
| } | ||
| if (mode == "truncate") { |
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.
需要对应修改search.py的python接口的默认mode 为“truncate”
PR Category
Inference
PR Types
Performance
Description
pcard-71500
Optimizing the performance of fused_layer_norm and top_p_sampling operators.