[Paper Review] Automated Parallel Kernel Extraction from Dynamic Application Traces
This paper presents TraceAtlas, an open-source tool that automatically extracts parallel kernels from dynamic application traces using a logarithmic-space, linear-time algorithm. It enables efficient kernel detection in unannotated, LLVM-compatible code with only 9x time dilation and 1 MB/sec trace size, successfully identifying over 10,500 kernel instances across 16 libraries with high accuracy and enabling downstream optimization for heterogeneous accelerators.
Modern program runtime is dominated by segments of repeating code called kernels. Kernels are accelerated by increasing memory locality, increasing data-parallelism, and exploiting producer-consumer parallelism among kernels - which requires hardware specialized for a particular class of kernels. Programming this hardware can be difficult, requiring that the kernels be identified and annotated in the code or translated to a domain-specific language. This paper describes a technique to automatically localize parallel kernels from a dynamic application trace, facilitating further code optimization. Dynamic trace collection is fast and compact. With optimization, it only incurs a time-dilation of a factor on nine and file-size of one megabyte per second, addressing a significant criticism of this approach. Kernel extraction is accurate and performed in linear time within logarithmic memory, detecting a wide range of kernels. This approach was validated across 16 libraries, comprised of 10,507 kernels instances. To validate the accuracy of our detected kernels, five test programs were written that spans traditional kernel definitions and were certified to contain all the kernels that were expected.
Motivation & Objective
- To address the challenge of identifying parallel kernels in unannotated, production-grade code for mapping to specialized accelerators.
- To reduce the performance overhead and storage cost of dynamic tracing, making it viable for large-scale application analysis.
- To develop a scalable, accurate method for kernel extraction that does not require code annotations, compiler directives, or domain-specific language transformations.
- To enable automated detection of producer-consumer relationships between kernels based on runtime execution patterns rather than static analysis.
- To validate the approach across diverse kernel types, including loops, recursion, and library calls, in real-world applications.
Proposed method
- Injecting lightweight, compressed LLVM intrinsics into LLVM IR at runtime to generate dynamic application traces with minimal performance overhead.
- Using a logarithmic-space, linear-time algorithm to detect temporally clustered basic blocks as candidate kernels based on execution affinity.
- Applying a legalization step to ensure kernel boundaries are semantically correct and consistent with execution flow.
- Analyzing memory access patterns within detected kernels to infer producer-consumer relationships across kernel instances.
- Employing UTF-8 encoded key-value trace format with custom compression to reduce trace size while preserving traceability.
- Validating kernel detection accuracy using hand-crafted test programs and expert-verified kernels in an OFDM system.
Experimental results
Research questions
- RQ1Can dynamic traces be generated with minimal performance overhead (time dilation) and storage cost (trace size) for production-scale applications?
- RQ2Can parallel kernels be accurately extracted from unannotated, unstructured code using dynamic trace analysis alone?
- RQ3Does the proposed logarithmic-space, linear-time kernel detection algorithm scale to large-scale workloads with terabyte-sized traces?
- RQ4Can the extracted kernels be used to reliably infer producer-consumer relationships without static analysis or code annotations?
- RQ5How well does the kernel detection method generalize across diverse kernel patterns, including loops, recursion, and library calls?
Key findings
- TraceAtlas achieves only 9x time dilation and 1 MB of trace data per second, making dynamic tracing practical for real-world applications.
- The kernel extraction algorithm runs in linear time and logarithmic space, enabling efficient processing of large traces, including those approaching terabyte scale.
- The tool successfully detected 10,507 kernel instances across 392 applications from 16 real-world libraries, with 100% accuracy in validation tests.
- The method correctly identified all expected kernels in five handcrafted test programs, including complex patterns like recursion and interface libraries.
- The approach detected 12 out of 13 kernel archetypes defined by Asanovic et al., with only finite state machines not being detected as single units.
- The tool outperformed state-of-the-art tracing techniques by 230x in speed and 49x in trace generation efficiency.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.