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

polish avx/no_avx install error message #33818

Merged
merged 1 commit into from
Jun 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions python/paddle/fluid/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,13 @@ def to_list(s):
else:
from .. import compat as cpt
sys.stderr.write(
"WARNING: AVX is supported on local machine, but you have installed "
"paddlepaddle without avx core. Hence, no_avx core which has worse "
"preformance will be imported.\nYou could reinstall paddlepaddle by "
"'python -m pip install --force-reinstall paddlepaddle-gpu[==version]' or rebuild "
"paddlepaddle WITH_AVX=ON to get better performance.\n"
"The original error is: %s\n" % cpt.get_exception_message(e))
"Hint: Your machine support AVX, but the installed paddlepaddle doesn't have avx core. "
"Hence, no-avx core with worse preformance will be imported.\nIf you like, you could "
"reinstall paddlepaddle by 'python -m pip install --force-reinstall paddlepaddle-gpu[==version]' "
"to get better performance.\nThe original error is: %s\n" %
cpt.get_exception_message(e))
load_noavx = True
else:
sys.stderr.write(
"WARNING: AVX is not support on your machine. Hence, no_avx core will be imported, "
"It has much worse preformance than avx core.\n")
load_noavx = True

if load_noavx:
Expand Down Expand Up @@ -339,17 +335,14 @@ def to_list(s):
current_path + os.sep + 'core_noavx.' + core_suffix + '\n')
elif avx_supported():
sys.stderr.write(
"Error: AVX is support on your machine, but you have installed "
"paddlepaddle without avx core, you should reinstall paddlepaddle by "
"'python -m pip install --force-reinstall paddlepaddle-gpu[==version]\n"
"Error: The installed PaddlePaddle is incorrect. You should reinstall it by "
Copy link
Contributor

Choose a reason for hiding this comment

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

这里只说明安装不对,感觉没有明确问题。
是否能够提示用户“There is a problem with loading no-avx core. AVX is support on your machine, you can try to install paddlepaddle with avx core.“

Copy link
Contributor Author

@zhwesky2010 zhwesky2010 Jun 29, 2021

Choose a reason for hiding this comment

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

这个case是用户是avx机器,但是既没有avx核,也没有no_avx核,比较特殊,应该是 paddlepaddle被误删了一部分,所以和avx或no avx关系不大,就没有暴露太多的avx no_avx概念,减少理解成本

"'python -m pip install --force-reinstall paddlepaddle-gpu[==version]'\n"
)
else:
sys.stderr.write(
"Error: AVX is not support on your machine, but you have installed "
"paddlepaddle without no_avx core, you should reinstall paddlepaddle by "
"'python -m pip install --force-reinstall paddlepaddle-gpu[==version] -f "
"https://paddlepaddle.org.cn/whl/mkl/stable/noavx.html or "
"https://paddlepaddle.org.cn/whl/openblas/stable/noavx.html\n")
"Error: Your machine doesn't support AVX, but the installed PaddlePaddle is avx core, "
"you should reinstall paddlepaddle with no-avx core.\n")

raise e


Expand Down