Benchmarks were run on the compute nodes of Cascade Lake
microarchitecture (Intel Xeon Gold 6248 CPU@2.50GHz). The HIBAG package
was compiled with GCC v8.3.0 in R-v4.0.2. In HIBAG (>= v1.26.1),
users can use hlaSetKernelTarget()
to select the target
intrinsics, or hlaSetKernelTarget("max")
for maximizing the
algorithm efficiency.
GCC (>= v6.0) is recommended to compile the HIBAG package. In the benchmarks, the kernel version of HIBAG_v1.24 is v1.4, and the kernel version of newer package is v1.5.
# continue without interrupting
<- function(cmd) tryCatch(cmd, error=function(e) { message("Not support"); invisible() }) IgnoreError
IgnoreError(hlaSetKernelTarget("sse4"))
## [1] "64-bit"
## [2] "Apple LLVM 14.0.0 (clang-1400.0.29.202), GNUG_v4.2.1"
## [3] "Algorithm SIMD:"
IgnoreError(hlaSetKernelTarget("avx"))
## [1] "64-bit"
## [2] "Apple LLVM 14.0.0 (clang-1400.0.29.202), GNUG_v4.2.1"
## [3] "Algorithm SIMD:"
IgnoreError(hlaSetKernelTarget("avx2"))
## [1] "64-bit"
## [2] "Apple LLVM 14.0.0 (clang-1400.0.29.202), GNUG_v4.2.1"
## [3] "Algorithm SIMD:"
IgnoreError(hlaSetKernelTarget("avx512f"))
## [1] "64-bit"
## [2] "Apple LLVM 14.0.0 (clang-1400.0.29.202), GNUG_v4.2.1"
## [3] "Algorithm SIMD:"
IgnoreError(hlaSetKernelTarget("avx512bw"))
## [1] "64-bit"
## [2] "Apple LLVM 14.0.0 (clang-1400.0.29.202), GNUG_v4.2.1"
## [3] "Algorithm SIMD:"
The CPU may reduce the frequency of the cores dynamically to keep
power usage of AVX512 within bounds,
hlaSetKernelTarget("auto.avx2")
can automatically select
AVX2 even if the CPU supports the AVX512F and AVX512BW intrinsics.
Please check the CPU throttling with AVX512 intrinsics.
The multi-threaded implementation can be enabled by specifying the
number of threads via nthread
in the function
hlaAttrBagging()
, or
hlaParallelAttrBagging(cl=nthread, ...)
.
Here are the performance of multithreading and the comparison between AVX2 and AVX512BW:
sessionInfo()
## R version 4.2.1 (2022-06-23)
## Platform: aarch64-apple-darwin20 (64-bit)
## Running under: macOS Ventura 13.0
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
##
## locale:
## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] ggplot2_3.4.0 HIBAG_1.34.1
##
## loaded via a namespace (and not attached):
## [1] RColorBrewer_1.1-3 highr_0.9 bslib_0.4.1 compiler_4.2.1 pillar_1.8.1
## [6] jquerylib_0.1.4 tools_4.2.1 digest_0.6.31 jsonlite_1.8.4 evaluate_0.18
## [11] lifecycle_1.0.3 tibble_3.1.8 gtable_0.3.1 pkgconfig_2.0.3 rlang_1.0.6
## [16] cli_3.4.1 DBI_1.1.3 yaml_2.3.6 xfun_0.35 fastmap_1.1.0
## [21] withr_2.5.0 stringr_1.5.0 dplyr_1.0.10 knitr_1.41 generics_0.1.3
## [26] vctrs_0.5.1 sass_0.4.4 grid_4.2.1 tidyselect_1.2.0 glue_1.6.2
## [31] R6_2.5.1 fansi_1.0.3 rmarkdown_2.18 farver_2.1.1 magrittr_2.0.3
## [36] scales_1.2.1 htmltools_0.5.4 assertthat_0.2.1 colorspace_2.0-3 labeling_0.4.2
## [41] utf8_1.2.2 stringi_1.7.8 RcppParallel_5.1.5 munsell_0.5.0 cachem_1.0.6
Zheng X, et al. (2014). HIBAG – HLA Genotype Imputation with Attribute Bagging. The Pharmacogenomics Journal. https://doi.org/10.1038/tpj.2013.18.
Zheng X (2018). Imputation-based HLA Typing with SNPs in GWAS Studies. Methods in Molecular Biology. https://doi.org/10.1007/978-1-4939-8546-3_11.
Intel AVX2 intrinsics: https://www.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top/compiler-reference/intrinsics/intrinsics-for-avx2.html.
Intel AVX-512 overview: https://www.intel.com/content/www/us/en/architecture-and-technology/avx-512-overview.html.
National Center for Supercomputing Applications (UIUC): https://www.ncsa.illinois.edu.