[论文解读] Efficient Architecture-Aware Acceleration of BWA-MEM for Multicore Systems
本文提出了与体系结构相关的端到端优化,以在多核CPU上加速 BWA-MEM,在单线程下实现最高 3.5x 的端到端加速,在单一插槽上实现 2.4x,同时输出保持完全一致。
Innovations in Next-Generation Sequencing are enabling generation of DNA sequence data at ever faster rates and at very low cost. Large sequencing centers typically employ hundreds of such systems. Such high-throughput and low-cost generation of data underscores the need for commensurate acceleration in downstream computational analysis of the sequencing data. A fundamental step in downstream analysis is mapping of the reads to a long reference DNA sequence, such as a reference human genome. Sequence mapping is a compute-intensive step that accounts for more than 30% of the overall time of the GATK workflow. BWA-MEM is one of the most widely used tools for sequence mapping and has tens of thousands of users. In this work, we focus on accelerating BWA-MEM through an efficient architecture aware implementation, while maintaining identical output. The volume of data requires distributed computing environment, usually deploying multicore processors. Since the application can be easily parallelized for distributed memory systems, we focus on performance improvements on a single socket multicore processor. BWA-MEM run time is dominated by three kernels, collectively responsible for more than 85% of the overall compute time. We improved the performance of these kernels by 1) improving cache reuse, 2) simplifying the algorithms, 3) replacing small fragmented memory allocations with a few large contiguous ones, 4) software prefetching, and 5) SIMD utilization wherever applicable - and massive reorganization of the source code enabling these improvements. As a result, we achieved nearly 2x, 183x, and 8x speedups on the three kernels, respectively, resulting in up to 3.5x and 2.4x speedups on end-to-end compute time over the original BWA-MEM on single thread and single socket of Intel Xeon Skylake processor. To the best of our knowledge, this is the highest reported speedup over BWA-MEM.
研究动机与目标
- 在高通量NGS数据时代和低测序成本背景下,推动更快的序列比对。
- 在不改变输出的前提下,加速 BWA-MEM 的主导内核(SMEM、SAL、BSW)在多核CPU上的执行。
- 展示面向体系结构的技术以改善缓存重用、内存访问和 SIMD 的利用。
- 提供详细的性能分析以识别瓶颈并指导未来的优化。
提出的方法
- 识别在 BWA-MEM 的运行时中占主导地位的三个内核(SMEM、SAL、BSW),并将它们作为优化目标。
- 重新组织处理工作流,以实现跨读的批处理式 SIMD 并行。
- 以大连续缓冲区替代小的动态分配,以改善预取和缓存重用。
- 对 SMEM 的不规则内存访问应用软件预取并在可行处整合 SIMD。
- 压缩并优化 FM-index 组件(包括一个压缩的 O 数组),并通过使用未压缩的后缀数组进行直接坐标提取来增强 SA 查找。
- 为 BSW 开发跨任务向量化,利用跨线程和跨读并行性,包括按读长排序以平衡向量通道,并转换输入数据布局以提升 SIMD 效率。
- 调整精度和向量宽度(8/16 位分数),并使用 AVX/AVX-512 指令来加速带状 Smith-Waterman。
实验结果
研究问题
- RQ1在不改变原始工具输出的前提下,是否能够在单个CPU插槽上对 BWA-MEM 实现端到端加速?
- RQ2在多核CPU上,BWA-MEM 的瓶颈是什么,面向体系结构的优化如何改善这些内核(SMEM、SAL、BSW)?
- RQ3内存布局、预取和 SIMD 启用如何影响 BWA-MEM 中的 SMEM、SAL 和 BSW 的性能?
- RQ4与 Skylake/HaswellCPU 相比,优化后的 BWA-MEM 的潜在端到端加速是多少?
- RQ5重组工作流和内存分配策略是否能实现有效的向量化并保持输出保真?
主要发现
- Smem、Sal 和 Bsw 负责原始计算时间的超过 85%,成为加速的目标。
- 在 SMEM、SAL 和 BSW 内核上分别实现了大约 2x、183x 和 8x 的加速。
- 在英特尔 Xeon Skylake 上,原始 BWA-MEM 相比的端到端加速最高可达 3.5x(单线程)和 2.4x(单插槽)。
- 输出保持与原始 BWA-MEM 完全一致,便于在流水线中无缝替换。
- 广泛的性能分析表明存在体系结构瓶颈,并验证了缓存感知和 SIMD 启用优化的有效性。
- 声称是发表时单个 CPU 实例上对 BWA-MEM 的最高已报道加速。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。