Skip to content

Detect AVX512 on Darwin use GetDarwinSysCtlByName("hw.optional.avx512f")#153

Merged
gchatelet merged 1 commit into
google:masterfrom
zchee:darwin-support-avx512
May 21, 2021
Merged

Detect AVX512 on Darwin use GetDarwinSysCtlByName("hw.optional.avx512f")#153
gchatelet merged 1 commit into
google:masterfrom
zchee:darwin-support-avx512

Conversation

@zchee

@zchee zchee commented Apr 5, 2021

Copy link
Copy Markdown
Contributor

Detect AVX512 on Darwin use GetDarwinSysCtlByName("hw.optional.avx512f")

On the below CPU, darwin support AVX512 with on-demand.

arch            : x86
brand           : Intel(R) Xeon(R) W-2150B CPU @ 3.00GHz
family          :   6 (0x06)
model           :  85 (0x55)
stepping        :   4 (0x04)
uarch           : INTEL_SKL
.
.

sysctl result is here:

$ sysctl hw.optional | grep avx512
hw.optional.avx512bw: 1
hw.optional.avx512cd: 1
hw.optional.avx512dq: 1
hw.optional.avx512f: 1
hw.optional.avx512ifma: 0
hw.optional.avx512vbmi: 0
hw.optional.avx512vl: 1

So, detect os_support.have_avx512 to use GetDarwinSysCtlByName("hw.optional.avx512f");, support Intel(R) Xeon AVX512 on Darwin OS.


after patched result on the same CPU:

arch            : x86
brand           : Intel(R) Xeon(R) W-2150B CPU @ 3.00GHz
family          :   6 (0x06)
model           :  85 (0x55)
stepping        :   4 (0x04)
uarch           : INTEL_SKL
flags           : aes,avx,avx2,avx512_second_fma,avx512bw,avx512cd,avx512dq,avx512f,avx512vl,bmi1,bmi2,clflushopt,clfsh,clwb,cx16,cx8,dca,erms,f16c,fma3,fpu,hle,mmx,movbe,pclmulqdq,popcnt,rdrnd,rdseed,rtm,smx,ss,sse,sse2,sse3,sse4_1,sse4_2,ssse3,tsc
cache_info      : {"level":1,"cache_type":"data","cache_size":32768,"ways":8,"line_size":64,"tlb_entries":64,"partitioning":1},{"level":1,"cache_type":"instruction","cache_size":32768,"ways":8,"line_size":64,"tlb_entries":64,"partitioning":1},{"level":2,"cache_type":"unified","cache_size":1048576,"ways":16,"line_size":64,"tlb_entries":1024,"partitioning":1},{"level":3,"cache_type":"unified","cache_size":14417920,"ways":11,"line_size":64,"tlb_entries":20480,"partitioning":1}

@zchee

zchee commented Apr 5, 2021

Copy link
Copy Markdown
Contributor Author

Why clang-format failed? No diff at lease my local machine.

@zchee

zchee commented Apr 6, 2021

Copy link
Copy Markdown
Contributor Author

/cc @natanbc

@natanbc

natanbc commented Apr 6, 2021

Copy link
Copy Markdown
Contributor

Looks like clang-format was moved from the clang package to the clang-extra-tools package on current alpine edge, so the dockerfile needs to be fixed.

@zchee

zchee commented Apr 6, 2021

Copy link
Copy Markdown
Contributor Author

@natanbc Should I also fix? if so, send another PR :D

@zchee

zchee commented Apr 7, 2021

Copy link
Copy Markdown
Contributor Author

@natanbc send #155

@zchee zchee force-pushed the darwin-support-avx512 branch from ac472dc to 9525f37 Compare April 7, 2021 07:16
@zchee

zchee commented Apr 7, 2021

Copy link
Copy Markdown
Contributor Author

@natanbc @Mizux Rebased. PTAL.

@zchee

zchee commented Apr 17, 2021

Copy link
Copy Markdown
Contributor Author

@natanbc @Mizux Sorry, just ping.
If any concerns, I wan to hear that :)

@MayankTahil

MayankTahil commented Apr 17, 2021 via email

Copy link
Copy Markdown

@zchee

zchee commented Apr 17, 2021

Copy link
Copy Markdown
Contributor Author

@MayankTahil ohh..? what do you mean...?

@Mizux Mizux requested a review from gchatelet April 17, 2021 06:46
@zchee

zchee commented May 1, 2021

Copy link
Copy Markdown
Contributor Author

@gchatelet sorry, just ping 🙇‍♂️

@gchatelet gchatelet merged commit bc2846e into google:master May 21, 2021
@gchatelet

Copy link
Copy Markdown
Collaborator

Thx @zchee for the PR! My apologies for the late reply.

Mizux pushed a commit to Mizux/cpu_features that referenced this pull request Jun 21, 2021
@zchee zchee deleted the darwin-support-avx512 branch July 24, 2021 14:58
@gchatelet gchatelet added this to the v0.7.0 milestone Mar 8, 2022
@gchatelet gchatelet added the enhancement New feature or request label Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants