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

upgrade for bscvrq to support non-quant #113

Open
wants to merge 3 commits into
base: paddlebox
Choose a base branch
from

Conversation

brightnesss
Copy link
Collaborator

PR types

PR changes

paddle/fluid/operators/fused/fused_seqpool_cvm_kernel.kps

Describe

支持非量化的分支,用于给bscvrq使用

// add for bscvrq
// embedx_concate_filter:true && quant_ratio_valid=false && need_filter=true && embed_threshold_filter=false
template <typename T>
struct sum_pooling_concate<T, false, false, true> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

need_filter=true or false?
need_filter和embed_threshold_filter是否反了?

// embedx_concate_filter:true && quant_ratio_valid=false && need_filter=false
template <typename T, bool use_cvm, bool clk_filter, bool need_filter,
bool embed_threshold_filter, typename T2>
struct do_sum_pooling_and_cvm<T, use_cvm, clk_filter, need_filter, false, embed_threshold_filter, true, T2> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

缺少了do_sum_pooling_and_cvm_with_large_dim的实现

// add for bscvrq
// embedx_concate_filter:true && quant_ratio_valid=false && need_filter=false && embed_threshold_filter=false
template <typename T>
struct sum_pooling_concate<T, false, true, false, false> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

应该按第一版的实现就行,第一版里的注释和模版参数的值没有对应上

};

// add for bscvrq
// embedx_concate_filter:true && quant_ratio_valid=false && need_filter=true && embed_threshold_filter=false
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个跟上面的可以合并成一个,模版参数写成<false, need_filter, false>

// add for bscvrq
// embedx_concate_filter:true && quant_ratio_valid=false && need_filter=true && embed_threshold_filter=true
template <typename T>
struct sum_pooling_concate<T, false, true, true> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

同理,这个跟现有的也可以合并,<quant_ratio_valid, true, true>

jack603047588 pushed a commit that referenced this pull request Oct 11, 2024
* fused_seqpool_cvm_with_conv support filter by threshold

* add fill zero in fused_seqpool_cvm

* add fused seq tensor && support transpose batch fc weight

* fix fused query seq tensor compare case

---------

Co-authored-by: mojingcj <ChengJing_dhu@163.com>
Co-authored-by: jiaoxuewu <jiaoxuewu@163.com>
Co-authored-by: yuandong1998 <1377526365@qq.com>
Co-authored-by: shangzhongbin <shangzhongbin@baidu.com>
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.

2 participants