cbalint13 opened a new pull request, #15903:
URL: https://github.com/apache/tvm/pull/15903
This PR adds helper functions to query system info from the LLVM backend.
It enhances TVM target information handling, and extends the CI coverage.
---
#### Changes:
* Introduces ```llvm_get_system_cpu()```, ```llvm_get_system_triple()```
and ```llvm_get_system_x86_vendor()```
* Exposes booth C/FFI & PY interfaces for all the functions mentioned above
with proper test cases.
* Enhances CI test utils, removes old limiting checks related to
arch/system/cpu/vendor dependencies.
#### Usage example
```
$ cat tvm-system-info.py
#!/usr/bin/python3
import tvm
from tvm.target import codegen, Target
cpu = codegen.llvm_get_system_cpu()
triple = codegen.llvm_get_system_triple()
vendor = codegen.llvm_get_system_x86_vendor()
target = "llvm -mtriple=%s -mcpu=%s" % (triple, cpu)
print("Current system CPU: [%s], VENDOR: [%s] TRIPLE: [%s]" % (cpu, vendor,
triple))
with tvm.target.Target(target):
features = codegen.llvm_get_cpu_features()
print("TVM target [%s] having features:\n\n{%s}" % (target, features))
```
```
$ ./tvm-system-info.py
Current system CPU: [skylake], VENDOR: [intel] TRIPLE:
[x86_64-redhat-linux-gnu]
TVM target [llvm -mtriple=x86_64-redhat-linux-gnu -mcpu=skylake] having
features:
{["64bit", "64bit-mode", "adx", "aes", "allow-light-256-bit", "avx", "avx2",
"bmi", "bmi2", "clflushopt",
"cmov", "crc32", "cx16", "cx8", "ermsb", "f16c", "false-deps-popcnt",
"fast-15bytenop", "fast-gather",
"fast-scalar-fsqrt", "fast-shld-rotate", "fast-variable-crosslane-shuffle",
"fast-variable-perlane-shuffle",
"fast-vector-fsqrt", "fma", "fsgsbase", "fxsr", "idivq-to-divl", "invpcid",
"lzcnt", "macrofusion", "mmx",
"movbe", "no-bypass-delay-blend", "no-bypass-delay-mov",
"no-bypass-delay-shuffle", "nopl", "pclmul",
"popcnt", "prfchw", "rdrnd", "rdseed", "sahf", "slow-3ops-lea", "sse",
"sse2", "sse3", "sse4.1", "sse4.2",
"ssse3", "vzeroupper", "x87", "xsave", "xsavec", "xsaveopt", "xsaves"]}
$
```
Cc: @kparzysz-quic , @vinx13 , @masahi , @driazati , @junrushao , @tqchen ,
@elvin-n , @vvchernov , @echuraev
--
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]