Optimizing the Linear Fascicle Evaluation Algorithm for Multi-Core and Many-Core Systems

Karan Aggarwal, Uday Bondhugula, Varsha Sreenivasan, Devarajan SridharanarXiv 2019

Abstract

Mapping the human connectome requires processing massive, sparse datasets to identify the structural wiring of the brain. The Linear Fascicle Evaluation (LiFE) algorithm is a state-of-the-art tool for this task, but it suffers from severe computational bottlenecks due to irregular memory access patterns in sparse tensor decompositions. This paper introduces a suite of hardware-aware optimizations, including data restructuring and hardware-specific tuning for CPUs and GPUs. Our results demonstrate a 27.12x speedup on multi-core CPUs and a 5.2x speedup on GPUs compared to existing implementations, significantly advancing the feasibility of large-scale brain connectivity analysis.

The Computational Challenge of Connectome Mapping

Mapping the "connectome"—the complex wiring diagram of the human brain—is a fundamental goal in neuroscience. Researchers use the LiFE algorithm to prune connectivity graphs, identifying the specific "fibers" or fascicles that best explain observed diffusion MRI signals. To manage the sheer volume of data, the algorithm utilizes Sparse Tucker Decomposition (STD).

Mathematical formulation of the LiFE algorithm, representing the relationship between MRI signals (y), the fiber dictionary (M), and fascicle weights (w).

While STD drastically reduces memory usage, it introduces a major computational headache: indirect array references. As shown in the matrix formulation above, the processor must navigate multiple layers of indices (essentially "pointers to pointers") rather than accessing data linearly. This creates a "memory wall" where the CPU or GPU spends more time waiting for data than performing calculations, rendering standard parallelization techniques ineffective.

Optimization Methodology

The authors propose a multi-layered optimization strategy that spans from high-level data organization to low-level hardware instructions. The core of the optimization focuses on two primary operations: Diffusion Signal Computation (DSC) and Weight Computation (WC).

Memory access patterns for Diffusion Signal Computation (DSC) and Weight Computation (WC), highlighting the complex indirect indexing optimized in this work.

1. Target-Independent Optimizations

  • Data Restructuring: The authors discovered that the optimal data layout is operation-dependent. For DSC, voxel-based restructuring is superior, while for WC, atom-based restructuring is more effective. By sorting indirection vectors, they transformed scattered memory accesses into clustered ones, significantly improving cache hit rates.
  • Computation Partitioning: Workloads were split among threads to minimize or eliminate "atomic operations," which typically slow down parallel code by forcing threads to synchronize. By partitioning based on sorted indices, the authors converted a data-race problem into a sequential-within-parallel problem.

2. Hardware-Specific Tuning

  • Multi-core CPUs: The implementation utilizes hand-optimized BLAS (Basic Linear Algebra Subprograms) calls and synchronization-free thread mapping to ensure maximum core utilization.
  • Many-core GPUs: Computations were mapped precisely to the GPU's warp and thread block architecture. The team leveraged shared memory and shuffle instructions for ultra-fast data exchange between threads, overcoming the overhead of global memory access.

3. Automation via DSL

To make these optimizations accessible to neuroscientists, the authors extended PolyMage, a Domain-Specific Language (DSL) embedded in Python. This allows researchers to write high-level code that automatically generates the highly optimized, low-level C++ required for peak performance.

Performance Evaluation

The optimizations were evaluated using the STN96 diffusion MRI dataset from Stanford, scaling from 50,000 to 500,000 fascicles to represent realistic modern workloads.

  • CPU Results: On a 16-core Intel Xeon system, the optimized code achieved a 27.12x speedup over the original sequential implementation and was 6.3x faster than a naive parallel version.
  • GPU Results: On an NVIDIA RTX 2080 Ti, the implementation was 5.2x faster than the previous reference GPU code.
  • Cross-Platform: The final GPU version was 9.7x faster than the optimized CPU version, confirming that GPUs are the ideal hardware for connectome processing when memory management is handled correctly.

Conclusion and Future Work

This work demonstrates that hardware-aware restructuring of sparse tensor operations can overcome the memory wall in computational neuroscience. While the hybrid data restructuring carries some overhead for small datasets, the gains for large-scale connectomics are transformative. Future work will focus on extending the DSL to support additional tensor formats like Kronecker Product and CANDECOMP/PARAFAC, further automating high-performance computing for the broader scientific community.

Summary updated

BibTeX
@misc{aggarwal2019optimizing,
  author = {Karan Aggarwal and Uday Bondhugula and Varsha Sreenivasan and Devarajan Sridharan},
  title = {{Optimizing the Linear Fascicle Evaluation Algorithm for Multi-Core and Many-Core Systems}},
  year = {2019},
  eprint = {1905.06234},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1905.06234},
}
Figure