-
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
weight_quantize/weight_only_linear support Volta Arch #58082
weight_quantize/weight_only_linear support Volta Arch #58082
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
paddle/phi/infermeta/multiary.cc
Outdated
@@ -3846,7 +3846,13 @@ void WeightOnlyLinearInferMeta(const MetaTensor& x, | |||
const MetaTensor& bias, | |||
const MetaTensor& weight_scale, | |||
const std::string& weight_dtype, | |||
const int32_t arch, |
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类型的值传递就不需要const修饰了
paddle/phi/api/yaml/ops.yaml
Outdated
@@ -2807,7 +2807,7 @@ | |||
backward: weight_only_linear_grad | |||
|
|||
- op : weight_quantize | |||
args : (Tensor x, str algo="weight_only_int8") | |||
args : (Tensor x, str algo = "weight_only_int8", int arch = -1) |
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.
改为默认是80
@@ -146,9 +159,24 @@ def weight_only_linear( | |||
... print(out.shape) | |||
[1, 2, 32] | |||
""" | |||
if arch is None: | |||
# Get SMVersion from device. | |||
cuda_version = version.cuda() |
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.
这块代码封装成一个函数给这两个api调用
Sorry to inform you that f744bcb's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
paddle seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
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.
LGGGTM
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.
weight_quantize
and weight_only_linear
have added default value parameters arch=None
which belongs to compatibility upgrade, so approve.
…8082) * fix volta arch weight quantize error * set default arch as 0 and use getSMVersion to get device's arch automatically * move getSmVersion to python api
PR types
New features
PR changes
OPs
Description
Pcard-72603