TL;DR
This paper introduces "hyperqueues," a novel programming abstraction for deterministic and scale-free pipeline parallelism. By extending concepts from task dataflow and Cilk++ hyperobjects, hyperqueues enable efficient and scalable pipeline implementations that are easier to write and debug than existing approaches.
What Problem Does This Paper Address?
Ubiquitous parallel computing aims to make parallel programming accessible to a wider audience by focusing on deterministic and scale-free models. However, a significant challenge arises with pipeline parallelism, where the degree of parallelism is often hard-coded into the program structure. Existing deterministic and scale-free models, like task dataflow, struggle to efficiently handle pipelines, often requiring coarse-grained stages or complex manual restructuring. This paper addresses the need for a programming model that elegantly supports pipeline parallelism while maintaining determinism and scale-freeness, making it easier for programmers to leverage parallel hardware without sacrificing correctness or performance portability.
Methods
The core contribution is the hyperqueue abstraction. Hyperqueues are designed as deterministic, scale-free queues for task-based parallel programming. They extend the concept of Cilk++ hyperobjects by providing thread-local views on shared data structures, but crucially, they require shared concurrent views.
Key aspects of the hyperqueue implementation include:
- Task Dataflow Integration: Hyperqueues are integrated into a task dataflow runtime (Swan), leveraging its ability to build task dependence graphs on the fly.
- Deterministic Semantics: The model ensures that programs using hyperqueues have a well-defined serial elision, guaranteeing deterministic execution.
- Scale-Free Design: Programs written with hyperqueues are designed to be performance-portable across architectures with varying core counts.
- Queue Segments: The internal data structure uses a linked list of fixed-size queue segments, allowing for efficient concatenation and management of data.
- Views: Hyperqueues manage data access through "views" (local, shared, head-only, tail-only) that allow concurrent pushes and pops while maintaining determinism.
- Work-Stealing Scheduler: The implementation relies on a work-stealing scheduler to manage task execution and load balancing.
- Access Modes: Procedures interacting with hyperqueues use access modes like
pushdep,popdep, andpushpopdepto define their interaction with the queue, guiding the scheduler.
Datasets
Not discussed in the paper. The paper focuses on evaluating performance using existing benchmarks.
Key Insights and Ideas
- Bridging the Gap: Hyperqueues effectively bridge the gap between the simplicity of task dataflow and the performance needs of pipeline parallelism, a common but challenging pattern.
- Determinism without Sacrifice: The paper demonstrates that deterministic pipeline parallelism is achievable without resorting to complex manual synchronization or sacrificing performance.
- Scale-Freeness for Portability: The scale-free nature of hyperqueue programs is crucial for modern hardware with rapidly increasing core counts, ensuring performance portability.
- Concurrent Push/Pop Elegance: The ability to handle concurrent push and pop operations on a single queue, while maintaining serializability, is a significant technical achievement.
- Simplified Programming: Hyperqueues simplify the development of pipeline-parallel applications by abstracting away low-level synchronization details.
Key Results
The paper evaluates hyperqueues on pipeline-parallel benchmarks from the PARSEC suite (ferret, dedup) and bzip2.
- Performance: Hyperqueues achieved comparable or up to 30% better performance than POSIX threads and Intel's Threading Building Blocks (TBB) on a 32-core system.
- Ease of Implementation: Programs using hyperqueues required less programming effort compared to POSIX threads and TBB, largely due to hidden synchronization.
- Ferret: Hyperqueue implementation showed significant improvement over a basic task dataflow ("objects") version by enabling overlap of the serial input stage with other pipeline stages. It matched Pthreads performance without requiring core-count dependent tuning.
- Dedup: Hyperqueues outperformed Pthreads by at least 12% and up to 30% in the 6-8 thread range, and also showed advantages over TBB, particularly in handling variable-sized data chunks and nested pipelines.
- Bzip2: Hyperqueue implementation achieved performance equivalent to the baseline task dataflow model, with improved memory locality using techniques from Section 5.4.
Limitations and Future Work
- Blocking Behavior: The current implementation blocks workers when a consumer encounters an empty queue. The authors suggest that suspending the task and allowing the worker to process other tasks might be a better approach in some scenarios, and propose allowing programmers to specify this behavior.
- Special Optimization: The paper mentions a "special optimization" from Cilk++ hyperobjects that was not implemented for hyperqueues. They expect it would have a negligible impact on their benchmarks due to shallow spawn trees but could be beneficial in other cases.
- Concurrent Pop Operations: The authors aim to extend the semantics of hyperqueues to allow concurrent pop operations while retaining programming productivity.
- Cilk Implementation: While the current implementation is in Swan, the paper discusses how hyperqueues could be implemented in Cilk with modifications to handle postponed tasks and differentiated interfaces based on spawn tree branches.
Summary updated