cbalint13 commented on PR #15685:
URL: https://github.com/apache/tvm/pull/15685#issuecomment-1713463565

   > Hello @cbalint13! Thank you for big work and good improvement and 
unification of target check. For me it looks like that "avx512bw" is not the 
best name to split usual avx512 (e.g. for skylake) and avx512 with VNNI (e.g. 
for cascadelake), may be return "avx512", I do not see places where it uses in 
other context
   
   @vvchernov ,
   
   Good question regarding "avx512bw" ! 
   
   Please help me with a double check on these statements below:
   
   * To my understanding [needed in 
tvm](https://github.com/search?q=repo%3Aapache%2Ftvm%20llvm.x86.avx512.pmaddubs&type=code)
 ```.avx512.pmaddubs.w.512``` ,```.avx512.pmaddw.d.512``` are in ```avx512bw``` 
subset.
   * See for reference: https://reviews.llvm.org/D11351 , so the ```avx512bw``` 
flag is what we seek within LLVM.
   
   There are also other avx512 subsets, but none holding instructions for our 
topi/tir intrinsics, on their name here:
   ```
   "avx512vl", "avx512dq", "avx512cd", "avx512er", "avx512pf", "avx512vbmi", 
"avx512ifma",
   "avx5124vnniw", "avx5124fmaps", "avx512vpopcntdq", "avx512vbmi2", "gfni", 
"vpclmulqdq", 
   "avx512vnni", "avx512bitalg", "avx512bf16"
   ```
   
   ---
   
   Some arches investigated here:
   
   * The "skylake", "cascadelake" have it:
   
   ```
   print( _ffi_api.llvm_x86_get_features("skylake") )
   ["cmov", "mmx", "popcnt", "sse", "sse2", "sse3", "ssse3", "sse4.1", 
"sse4.2", 
   "avx", "avx2", "fma", "bmi", "bmi2", "aes", "pclmul", "adx", "clflushopt", 
"cx16",
   "cx8", "crc32", "f16c", "fsgsbase", "fxsr", "invpcid", "lzcnt", "movbe", 
"prfchw", 
   "rdrnd", "rdseed", "sahf", "sgx", "x87", "xsave", "xsavec", "xsaveopt", 
"xsaves"]
   
   print( _ffi_api.llvm_x86_get_features("cascadelake") )
   ["cmov", "mmx", "popcnt", "sse", "sse2", "sse3", "ssse3", "sse4.1", 
"sse4.2", 
   "avx", "avx2", "fma", "avx512f", "bmi", "bmi2", "aes", "pclmul",
    "avx512vl", "avx512bw", "avx512dq", "avx512cd", "avx512vnni",
    "adx", "clflushopt", "clwb", "cx16", "cx8", "crc32", "f16c", "fsgsbase", 
   "fxsr", "invpcid", "lzcnt", "movbe", "pku", "prfchw", "rdrnd", "rdseed", 
   "sahf", "x87", "xsave", "xsavec", "xsaveopt", "xsaves"]
   ```
   
   * The "knl" which have some ```avx512*``` **but not** the desired 
```avx512bw```:
   ```
   print( _ffi_api.llvm_x86_get_features("knl") )
   ["cmov", "mmx", "popcnt", "sse", "sse2", "sse3", "ssse3", "sse4.1", 
"sse4.2", 
   "avx", "avx2", "fma", "avx512f", "bmi", "bmi2", "aes", "pclmul", 
   "avx512cd", "avx512er", "avx512pf", "adx", "cx16", "cx8", "crc32", "f16c",
    "fsgsbase", "fxsr", "invpcid", "lzcnt", "movbe", "prefetchwt1", "prfchw", 
   "rdrnd", "rdseed", "sahf", "x87", "xsave", "xsaveopt"]
   ```
   
   * The odd "alderlake" have ```avxvnni``` **but not** ```avx512bw``` 
**either** ```avx512vnni```:
   ```
   print( _ffi_api.llvm_x86_get_features("knl") )
   ["cmov", "mmx", "popcnt", "sse", "sse2", "sse3", "ssse3", "sse4.1", 
"sse4.2", 
   "fma", "bmi", "bmi2", "aes", "pclmul", "gfni", "vpclmulqdq", "adx", 
"cldemote", 
   "clflushopt", "clwb", "cx16", "cx8", "crc32", "f16c", "fsgsbase", "fxsr", 
"invpcid", 
   "widekl", "lzcnt", "movbe", "movdir64b", "movdiri", "pconfig", "pku", 
"prfchw", 
   "ptwrite", "rdpid", "rdrnd", "rdseed", "sahf", "serialize", "sgx", "sha", 
"shstk", 
   "vaes", "waitpkg", "x87", "xsave", "xsavec", "xsaveopt", "xsaves", "hreset", 
   "avxvnni"]
   ```
   BTW, "alderlake" here, is the only "strangeness" having ```avxvnni``` but 
not ```avx512vnni```.
   
   * The "sapphirerapids" have "avx512bw" "avx512vnni" , and "amx-int8" among 
with lot of new "interesting goodies".
   ```
   print( _ffi_api.llvm_x86_get_features("sapphirerapids") )
   ["cmov", "mmx", "popcnt", "sse", "sse2", "sse3", "ssse3", "sse4.1", 
"sse4.2", "avx", "avx2", "fma", 
   "avx512f", "bmi", "bmi2", "aes", "pclmul", "avx512vl", "avx512bw", 
"avx512dq", "avx512cd", 
   "avx512vbmi", "avx512ifma", "avx512vpopcntdq", "avx512vbmi2", "gfni", 
"vpclmulqdq", 
   "avx512vnni", "avx512bitalg", "avx512bf16", "adx", "amx-bf16", "amx-int8", 
"amx-tile", 
   "cldemote", "clflushopt", "clwb", "cx16", "cx8", "crc32", "enqcmd", "f16c", 
"fsgsbase", 
   "fxsr", "invpcid", "lzcnt", "movbe", "movdir64b", "movdiri", "pconfig", 
"pku", "prfchw", 
   "ptwrite", "rdpid", "rdrnd", "rdseed", "sahf", "serialize", "sgx", "sha", 
"shstk", "tsxldtrk", 
   "uintr", "vaes", "waitpkg", "wbnoinvd", "x87", "xsave", "xsavec", 
"xsaveopt", "xsaves", 
   "avx512fp16", "avxvnni"]
   ```
   
   ---
   
   I put **Cc** @Qianshui-Jiang (author of #13642) he might help with a second 
opinion in this too.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to