Skip to content

Disable AVX for nocona - #9603

Merged
esc merged 3 commits into
numba:mainfrom
sklam:fix/avx512nocona
Jun 10, 2024
Merged

esc merged 3 commits into
numba:mainfrom
sklam:fix/avx512nocona

Conversation

@sklam

@sklam sklam commented Jun 3, 2024 •

Copy link
Copy Markdown
Member

Maybe a fix for #9582

Because VMs may report nocona as the cpu-name but has AVX512 support. This seems to cause the LLVM SVML-pass incorrectly use <8 x double> vectors.


Update. user confirmed.
Fixes #9582

Because VMs may report nocona as the cpu-name but has AVX512 support. This seems to cause the LLVM SVML-pass incorrectly use `<8 x double>` vectors.
@sklam sklam added the Pending BuildFarm For PRs that have been reviewed but pending a push through our buildfarm label Jun 3, 2024
@sklam

sklam commented Jun 3, 2024

Copy link
Copy Markdown
Member Author

BFID: numba_smoketest_cpu_yaml_196

@esc esc added this to the 0.60.0 milestone Jun 4, 2024

@stuartarchibald stuartarchibald left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the patch. A few minor comments to address else looks good. I do wonder about whether there are other approaches to detecting this sort of problem, however, I'm hoping that this will work around the reported issue.

Comment thread numba/core/config.py Outdated
Comment thread numba/core/config.py Outdated
Comment thread numba/core/config.py
cpu_name = ll.get_host_cpu_name()
return cpu_name not in ('corei7-avx', 'core-avx-i',
'sandybridge', 'ivybridge')
cpu_name = CPU_NAME or ll.get_host_cpu_name()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess that this is technically fixing a bug, in that a prescribed NUMBA_CPU_NAME was previously ignored in the logic surrounding AVX use. Should a test be added that runs if get_host_cpu_name() returns anything other than nocona and the test asserts that a prescribed NUMBA_CPU_NAME=nocona would result in config.ENABLE_AVX==False?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added test in 50af0ab

@gmarkall

gmarkall commented Jun 4, 2024

Copy link
Copy Markdown
Member

Testing locally, this does seem to resolve #9582 even when I have NUMBA_CPU_NAME="nocona" set.

@thomasfrederikhoeck

Copy link
Copy Markdown

It also works locally for me #9582 (comment)

sklam and others added 2 commits June 6, 2024 16:03
Co-authored-by: stuartarchibald <stuartarchibald@users.noreply.github.com>
@sklam sklam added the skip_release_notes Skip towncrier requirement label Jun 6, 2024
@sklam

sklam commented Jun 6, 2024

Copy link
Copy Markdown
Member Author

rerun smoketest. BFID: numba_smoketest_cpu_yaml_199

@sklam
sklam marked this pull request as ready for review June 6, 2024 22:32

@esc esc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tried this locally, executed tests, modified tests to watch them fail, looks good to me.

@esc esc added BuildFarm Passed For PRs that have been through the buildfarm and passed 5 - Ready to merge Review and testing done, is ready to merge and removed 3 - Ready for Review Pending BuildFarm For PRs that have been reviewed but pending a push through our buildfarm labels Jun 7, 2024
code = ("from numba.core import config\n"
"print('---->', bool(config.ENABLE_AVX))\n"
"assert not config.ENABLE_AVX")
out, err = run_in_subprocess(dedent(code), env=new_env)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not suggesting changing anything now, especially as this is already RTM, but I think @TestCase.run_in_subprocess is a simpler way of doing this - it allows env vars for the subprocess to be set in the decorator args.

@esc
esc merged commit 5f66393 into numba:main Jun 10, 2024
esc added a commit to esc/numba that referenced this pull request Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to merge Review and testing done, is ready to merge BuildFarm Passed For PRs that have been through the buildfarm and passed skip_release_notes Skip towncrier requirement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parallel providing wrong result on some machine but not on other

5 participants