-
Notifications
You must be signed in to change notification settings - Fork 7
Two Running Modes for H2Pack
H2Pack has two different running modes of matrix construction,
matrix-vector multiplication, and
matrix-matrix multiplication:
- Ahead-of-time (AOT) mode
- Just-in-time (JIT) mode
These two modes provide trade-offs between storage, computation, and communication, and can be adaptively used to obtain the optimal performance for different computing platforms and different kernel functions.
In an matrix representation of kernel matrix
, there are two components that simply kernel matrix blocks
- inadmissible dense blocks
for adjacent or identical point clusters
in the leaf level
- intermediate blocks
for the low-rank approximation of admissible blocks
where all these kernel blocks can be easily computed using the kernel function and the corresponding point.
In AOT mode, these and
are precomputed and stored in memory during
matrix construction.
In JIT mode, these blocks are constructed temporarily in
matrix-vector and
matrix-matrix multiplications, and are discarded after usage.
The AOT mode is designed to avoid redundant calculation when the kernel function evaluation is expensive. For example, kernel functions with transcendental arithmetic, e.g., exponential and logarithmic functions, have much higher evaluation cost than those without transcendental arithmetic. In this case, using AOT mode might be more efficient than using JIT mode. On the other hand, the AOT mode needs to fetch the precomputed kernel blocks from memory during multiplications, and thus takes significantly more communication cost than the JIT mode.
The JIT mode is designed to reduce the storage cost of an matrix representation.
The size of all
and
blocks usually can usually be 10 to 100 times larger than the remaining
matrix components. By not storing
and
blocks, H2Pack in the JIT mode can handle much larger kernel matrices.
In some cases with fast CPUs, the runtime for computing these kernel blocks in the JIT mode can actually be cheaper than the runtime for fethcing these blocks from memory in the AOT mode, leading to a faster multiplication in the JIT mode.
In general, the performance of matrix-vector and
matrix-matrix multiplications in the AOT/JIT mode depend on:
- The complexity of kernel function
- The implementation of kernel function
- The code optimization ability of compiler
- The performance of CPU and memory system
- Return to the top H2Pack github page (leave this wiki)
- Installing H2Pack
- Basic Application Interface
- Using and Writing Kernel Functions
- Two Running Modes for H2Pack
- HSS-Related Computations
- Bi-Kernel Matvec (BKM) Functions
- Vector Wrapper Functions for Kernel Evaluations
- Proxy Points and their Reuse
- Python Interface
- H2 Matrix File Storage Scheme (draft)
- Using H2 Matrix File Storage