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

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

Merged
merged 1 commit into from
May 21, 2021

Conversation

zchee
Copy link
Contributor

@zchee zchee commented Apr 5, 2021

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
Copy link
Contributor Author

zchee commented Apr 5, 2021

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

@zchee
Copy link
Contributor Author

zchee commented Apr 6, 2021

/cc @natanbc

@natanbc
Copy link
Contributor

natanbc commented Apr 6, 2021

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
Copy link
Contributor Author

zchee commented Apr 6, 2021

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

@zchee
Copy link
Contributor Author

zchee commented Apr 7, 2021

@natanbc send #155

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

zchee commented Apr 7, 2021

@natanbc @Mizux Rebased. PTAL.

@zchee
Copy link
Contributor Author

zchee commented Apr 17, 2021

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

@MayankTahil
Copy link

MayankTahil commented Apr 17, 2021 via email

@zchee
Copy link
Contributor Author

zchee commented Apr 17, 2021

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

@Mizux Mizux requested a review from gchatelet April 17, 2021 06:46
@zchee
Copy link
Contributor Author

zchee commented May 1, 2021

@gchatelet sorry, just ping 🙇‍♂️

@gchatelet gchatelet merged commit bc2846e into google:master May 21, 2021
@gchatelet
Copy link
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