-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[inference] Support groupwise mode of gemv kernel #60204
[inference] Support groupwise mode of gemv kernel #60204
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -24,6 +24,8 @@ limitations under the License. */ | |||
#include "paddle/phi/common/float16.h" | |||
#include "paddle/phi/core/kernel_registry.h" | |||
|
|||
// #define _DEBUG_WEIGHT_ONLY_GEMV |
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.
这个需要保留吗?
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.
可以删掉~
int initial_offset, | ||
int stride) | ||
: _scales(scales), _zeros(zeros), _stride(stride) { | ||
_scales += initial_offset; | ||
#ifndef WIN32 | ||
// linux | ||
if constexpr (Zero) { |
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.
这个没必要删掉吧?
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.
这里加上,paddle 的 pre-commit 会报错,不让提交,我再试下是否有其他规避的方法
struct WeightOnlyConverter {}; | ||
|
||
template <> | ||
struct WeightOnlyConverter<half, WeightOnlyQuantType::Int8b> { |
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.
这里的功能和fast_cvt_4_packed_signed_i8s_to_2_half2s是不是一样的?
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.
是一样的,这里为了 int4/int8 写在一起,包了一层 struct~
for (int p = 0; p < 16; ++p) { | ||
weights_f16[p * NPerBlock + idx] = | ||
weights_vec[p / 8 + (p % 8) * 2] * scale[idx]; | ||
#ifdef _DEBUG_WEIGHT_ONLY_GEMV |
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.
debug信息就不保留了吧?
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.
好的,下个 commit 删除掉
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 group_size
attr
Generally speaking, adding parameters to operator needs to update checkpoint information in |
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 unittest.skipIf
97e9192
已添加 |
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
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 docs
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
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 YAML
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 unittest.skipIf
* support gemv-groupwise func && weightQuanter-groupwise && weightDeQuanter-groupwise * fix build bug * add unit_test && fix bug * delete useless code * fix ci build bug * fix ci && optimize * fix merge conflict * add op change info * fix weight_only_linear_pass * fix format * solve ci unit_test
PR types
New features
PR changes
OPs
Description
PCard-77383