3 research outputs found

    High-level compiler analysis for OpenMP

    Get PDF
    Nowadays, applications from dissimilar domains, such as high-performance computing and high-integrity systems, require levels of performance that can only be achieved by means of sophisticated heterogeneous architectures. However, the complex nature of such architectures hinders the production of efficient code at acceptable levels of time and cost. Moreover, the need for exploiting parallelism adds complications of its own (e.g., deadlocks, race conditions,...). In this context, compiler analysis is fundamental for optimizing parallel programs. There is however a trade-off between complexity and profit: low complexity analyses (e.g., reaching definitions) provide information that may be insufficient for many relevant transformations, and complex analyses based on mathematical representations (e.g., polyhedral model) give accurate results at a high computational cost. A range of parallel programming models providing different levels of programmability, performance and portability enable the exploitation of current architectures. However, OpenMP has proved many advantages over its competitors: 1) it delivers levels of performance comparable to highly tunable models such as CUDA and MPI, and better robustness than low level libraries such as Pthreads; 2) the extensions included in the latest specification meet the characteristics of current heterogeneous architectures (i.e., the coupling of a host processor to one or more accelerators, and the capability of expressing fine-grained, both structured and unstructured, and highly-dynamic task parallelism); 3) OpenMP is widely implemented by several chip (e.g., Kalray MPPA, Intel) and compiler (e.g., GNU, Intel) vendors; and 4) although currently the model lacks resiliency and reliability mechanisms, many works, including this thesis, pursue their introduction in the specification. This thesis addresses the study of compiler analysis techniques for OpenMP with two main purposes: 1) enhance the programmability and reliability of OpenMP, and 2) prove OpenMP as a suitable model to exploit parallelism in safety-critical domains. Particularly, the thesis focuses on the tasking model because it offers the flexibility to tackle the parallelization of algorithms with load imbalance, recursiveness and uncountable loop based kernels. Additionally, current works have proved the time-predictability of this model, shortening the distance towards its introduction in safety-critical domains. To enable the analysis of applications using the OpenMP tasking model, the first contribution of this thesis is the extension of a set of classic compiler techniques with support for OpenMP. As a basis for including reliability mechanisms, the second contribution consists of the development of a series of algorithms to statically detect situations involving OpenMP tasks, which may lead to a loss of performance, non-deterministic results or run-time failures. A well-known problem of parallel processing related to compilers is the static scheduling of a program represented by a directed graph. Although the literature is extensive in static scheduling techniques, the work related to the generation of the task graph at compile-time is very scant. Compilers are limited by the knowledge they can extract, which depends on the application and the programming model. The third contribution of this thesis is the generation of a predicated task dependency graph for OpenMP that can be interpreted by the runtime in such a way that the cost of solving dependences is reduced to the minimum. With the previous contributions as a basis for determining the functional safety of OpenMP, the final contribution of this thesis is the adaptation of OpenMP to the safety-critical domain considering two directions: 1) indicating how OpenMP can be safely used in such a domain, and 2) integrating OpenMP into Ada, a language widely used in the safety-critical domain.Actualment, aplicacions de dominis diversos com la computaci贸 d'altes prestacions i els sistemes d'alta integritat, requereixen nivells de rendiment assolibles nom茅s mitjan莽ant arquitectures heterog猫nies sofisticades. No obstant, la natura complexa d'aquestes dificulta la producci贸 de codi eficient en un temps i cost acceptables. A m茅s, la necessitat d鈥檈xplotar paral路lelisme introdueix complicacions en s铆 mateixa (p. ex. bloqueig mutu, condicions de carrera,...). En aquest context, l'an脿lisi de compiladors 茅s fonamental per optimitzar programes paral路lels. Existeix per貌 un equilibri entre complexitat i beneficis: la informaci贸 obtinguda amb an脿lisis simples (p. ex. definicions abastables) pot ser insuficient per moltes transformacions rellevants, i an脿lisis complexos basats en models matem脿tics (p. ex. model poli猫dric) faciliten resultats acurats a un alt cost computacional. Existeixen molts models de programaci贸 paral路lela que proporcionen diferents nivells de programabilitat, rendiment i portabilitat per l'explotaci贸 de les arquitectures actuals. En aquest marc, OpenMP ha demostrat molts avantatges respecte dels seus competidors: 1) el seu nivell de rendiment 茅s comparable a models molt ajustables com CUDA i MPI, i proporciona m茅s robustesa que llibreries de baix nivell com Pthreads; 2) les extensions que inclou la darrera especificaci贸 satisfan les caracter铆stiques de les actuals arquitectures heterog猫nies (茅s a dir, l鈥檃coblament d鈥檜n processador principal i un o m茅s acceleradors, i la capacitat d'expressar paral路lelisme de tasques de gra fi, ja sigui estructurat o sense estructura; 3) OpenMP 茅s 脿mpliament implementat per venedors de xips (p. ex. Kalray MPPA, Intel) i compiladors (p. ex. GNU, Intel); i 4) tot i que el model actual manca de mecanismes de resili猫ncia i fiabilitat, molts treballs, incloent aquesta tesi, busquen la seva introducci贸 a l'especificaci贸. Aquesta tesi adre莽a l'estudi de t猫cniques d鈥檃n脿lisi de compiladors amb dos objectius: 1) millorar la programabilitat i la fiabilitat de OpenMP, i 2) provar que OpenMP 茅s un model adequat per explotar paral路lelisme en sistemes cr铆tics. En particular, la tesi es centra en el model de tasques per qu猫 aquest ofereix la flexibilitat per abordar aplicacions amb problemes de balanceig de c脿rrega, recursivitat i bucles incomptables. A m茅s, treballs recents han provat la predictibilitat en q眉esti贸 de temps del model, escur莽ant la dist脿ncia cap a la seva introducci贸 en sistemes cr铆tics. Per a poder analitzar aplicacions que utilitzen el model de tasques d鈥橭penMP, la primera contribuci贸 d鈥檃questa tesi consisteix en l鈥檈xtensi贸 d'un conjunt de t猫cniques cl脿ssiques de compilaci贸 per suportar OpenMP. Com a base per incloure mecanismes de fiabilitat, la segona contribuci贸 consisteix en el desenvolupament duna s猫rie d'algorismes per detectar de forma est脿tica situacions que involucren tasques d鈥橭penMP, i que poden conduir a una p猫rdua de rendiment, resultats no deterministes, o fallades en temps d鈥檈xecuci贸. Un problema ben conegut del processament paral路lel relacionat amb els compiladors 茅s la planificaci贸 est脿tica d鈥檜n programa representat mitjan莽ant un graf dirigit. Tot i que la literatura sobre planificaci贸 est脿tica 茅s extensa, aquella relacionada amb la generaci贸 del graf en temps de compilaci贸 茅s molt escassa. Els compiladors estan limitats pel coneixement que poden extreure, que dep猫n de l鈥檃plicaci贸 i del model de programaci贸. La tercera contribuci贸 de la tesi 茅s la generaci贸 d鈥檜n graf de depend猫ncies enriquit que pot ser interpretat pel sistema en temps d鈥檈xecuci贸 de manera que el cost de resoldre les depend猫ncies sigui m铆nim. Amb les anteriors contribucions com a base per a determinar la seguretat funcional de OpenMP, la darrera contribuci贸 de la tesi consisteix en adaptar OpenMP a sistemes cr铆tics, explorant dues direccions: 1) indicar com OpenMP es pot utilitzar de forma segura en un domini com, i 2) integrar OpenMP en Ada, un llenguatge molt utilitzat en el domini de seguretat.Postprint (published version

    Hardware runtime management for task-based programming models

    Get PDF
    Task-based programming models allow programmers to express applications as a collection of tasks with dependences. They are simple to use and greatly improve programmability by using software runtimes to exploit task parallelism and heterogeneity over multi-core, many-core and heterogeneous platforms. In these programming models, the runtimes guarantee correct execution order by managing tasks using task-dependence graphs (TDGs). These runtimes are powerful enough to provide high performance with coarse-grained tasks although they impose overheads on the application execution to maintain all the information they need to do their work. However, as the current trend in processor architectures keeps including more cores and heterogeneity (in fact complexity) in the systems, coarse-grained parallelism is not enough to feed all the underlying resources. Instead, fine-grained tasks are preferable as they are able to expose higher parallelism in applications but the overheads introduced by the software runtimes under these conditions prevent an efficient exploitation of fine-grained parallelism. The two most critical runtime overheads are task dependence graph management and task scheduling to heterogeneous systems. We propose a hardware architecture Picos, consisting of a hardware task dependence manager including nested task support, and a heterogeneous task scheduler, to accelerate the critical runtime functions for task-based programming models. With Picos, we aim at extending the benefit of these programming models into exploiting fine-grained task parallelism and heterogeneity. As a proof-of-concept, Three prototypes of Picos have been designed in VHDL and implemented in a System-on-chip platform consisting of regular ARM SMP cores and an integrated FPGA. They also have been analyzed with real benchmarks with OmpSs running and Linux on the platform. The first prototype is a hardware task dependence manager, which has been implemented in a Xilinx Zynq 7000 series SoCs. It is connected to a 2-core ARM Cortex A9 processor, with bare-metal OS integration. With 24 simulated workers, and running real task-dependence analysis in Picos, it scales up to 21x speedup. The second prototype Picos++ extended Picos with an exciting new feature for nested task support in hardware. To the best of our knowledge, this is the first time that such a feature has been support fully in hardware task dependence managers. This prototype is fully integrated in not only hardware, but also with a State-of-the-Art parallel programming model, and with Linux. The third prototype includes both a hardware task dependence manager and a heterogeneous task scheduler. The heterogeneous task scheduler receives ready tasks from the task-dependence manager and then schedule them to hardware execution units that have the estimated earliest finish time. It is implemented in a Xilinx Zynq Ultrascale+ MPSoC chip. In a system with 4 threads and up to 15 HW accelerators, it achieves up to 16.2x speedup for real benchmarks, and saves up to 90% of energy.Los modelos de programaci贸n basados en tareas permiten a los programadores expresar las aplicaciones como una colecci贸n de tareas con dependencias entre ellas. Dichos modelos son simples de usar y mejoran enormemente la programabilidad. Para ello se valen del uso de una runtime que en tiempo de ejecuci贸n ayuda a explotar el paralelismo de las tareas cuando se ejecutan en plataformas multi-cores, many-cores y heterog茅neas. En estos modelos de programaci贸n los runtimes garantizan la ejecuci贸n de las tareas en el orden correcto mediante el uso de gr谩ficos de dependencias entre tareas (TDG). Actualmente, los runtimes son lo suficientemente potentes para proporcionar un alto rendimiento con tareas de granularidad gruesa a pesar de que para mantener toda la informaci贸n que necesitan para hacer su trabajo, introducen un sobrecoste importante en la ejecuci贸n de las aplicaciones. El problema viene dado por la tendencia actual en arquitectura de computadores a seguir incluyendo m谩s n煤cleos y heterogeneidad (de hecho, complejidad) en los sistemas de procesado con lo que el paralelismo de granularidad gruesa no es suficiente para alimentar todos los recursos. En estos entornos complejos las tareas de granularidad fina son preferibles ya que son capaces de exponer un mayor paralelismo de las aplicaciones. Sin embargo, con tareas de granularidad fina, los sobrecostes introducidos por los runtimes software son mayores debido a la necesidad de manejar muchas m谩s tareas m谩s r谩pido. En general los mayores sobrecostes introducidos por los runtimes son: la administraci贸n de los grafos de dependencias que relacionan las tareas y la gesti贸n de las tareas en sistemas heterog茅neos. Proponemos una arquitectura hardware, llamada Picos, que consiste en un administrador de dependencias entre tareas incluyendo soporte para tareas anidadas y planificaci贸n de tareas heterog茅neas. La funci贸n principal de dicha arquitectura es acelerar las funciones cr铆ticas de los runtimes para modelos de programaci贸n basados en tareas. Con Picos, se pretende extender el beneficio de estos modelos de programaci贸n para explotar el paralelismo y la heterogeneidad ejecutando tareas de granularidad fina. Como prueba de concepto, tres prototipos de Picos han sido dise帽ado en VHDL e implementado en una plataforma System-on-chip que consta de varios n煤cleos ARM integrados junto con una FPGA, y ademas analizados con ejecuciones reales con OmpSs y con Linux. El primer prototipo es un administrador hardware de tareas con dependencias, que se ha implementado en un SoC Xilinx Zynq serie 7000. Est谩 conectado a un procesador ARM Cortex A9 de 2 n煤cleos, e integrado con el SO. Con 24 n煤cleos simulados y realizando el an谩lisis real de las dependencias entre tareas en Picos, obtiene hasta un 21x sobre las mismas ejecuciones usando el entorno software. El segundo prototipo, Picos++, ampli贸 Picos incorporando el soporte para la gesti贸n de tareas anidadas en hardware. Hasta donde llega nuestro conocimiento, esta es la primera vez que dicha caracter铆stica ha sido propuesta y/o incorporada en un administrador hardware de dependencias entre tareas. El segundo prototipo est谩 completamente integrado en el sistema, no solo en hardware, sino tambi茅n con el modelo de programaci贸n paralelo y con el sistema operativo. El tercer prototipo, incluye un administrador y planificador de tareas heterog茅neas. El planificador de tareas heterog茅neas recibe dichas tareas listas del administrador de dependencias entre tareas y las programa en la unidad de ejecuci贸n de hardware adecuada que tenga el tiempo de finalizaci贸n estimado m谩s corto. Este prototipo se ha implementado en un chip MPSoC Xilinx Zynq Ultrascale+. En dicho sistema con cuatro n煤cleos ARM y hasta 15 aceleradores HW funcionales, logra una aceleraci贸n de hasta 16.2x, y ahorra hasta el 90% de la energ铆a con respecto al software

    Hardware runtime management for task-based programming models

    Get PDF
    Task-based programming models allow programmers to express applications as a collection of tasks with dependences. They are simple to use and greatly improve programmability by using software runtimes to exploit task parallelism and heterogeneity over multi-core, many-core and heterogeneous platforms. In these programming models, the runtimes guarantee correct execution order by managing tasks using task-dependence graphs (TDGs). These runtimes are powerful enough to provide high performance with coarse-grained tasks although they impose overheads on the application execution to maintain all the information they need to do their work. However, as the current trend in processor architectures keeps including more cores and heterogeneity (in fact complexity) in the systems, coarse-grained parallelism is not enough to feed all the underlying resources. Instead, fine-grained tasks are preferable as they are able to expose higher parallelism in applications but the overheads introduced by the software runtimes under these conditions prevent an efficient exploitation of fine-grained parallelism. The two most critical runtime overheads are task dependence graph management and task scheduling to heterogeneous systems. We propose a hardware architecture Picos, consisting of a hardware task dependence manager including nested task support, and a heterogeneous task scheduler, to accelerate the critical runtime functions for task-based programming models. With Picos, we aim at extending the benefit of these programming models into exploiting fine-grained task parallelism and heterogeneity. As a proof-of-concept, Three prototypes of Picos have been designed in VHDL and implemented in a System-on-chip platform consisting of regular ARM SMP cores and an integrated FPGA. They also have been analyzed with real benchmarks with OmpSs running and Linux on the platform. The first prototype is a hardware task dependence manager, which has been implemented in a Xilinx Zynq 7000 series SoCs. It is connected to a 2-core ARM Cortex A9 processor, with bare-metal OS integration. With 24 simulated workers, and running real task-dependence analysis in Picos, it scales up to 21x speedup. The second prototype Picos++ extended Picos with an exciting new feature for nested task support in hardware. To the best of our knowledge, this is the first time that such a feature has been support fully in hardware task dependence managers. This prototype is fully integrated in not only hardware, but also with a State-of-the-Art parallel programming model, and with Linux. The third prototype includes both a hardware task dependence manager and a heterogeneous task scheduler. The heterogeneous task scheduler receives ready tasks from the task-dependence manager and then schedule them to hardware execution units that have the estimated earliest finish time. It is implemented in a Xilinx Zynq Ultrascale+ MPSoC chip. In a system with 4 threads and up to 15 HW accelerators, it achieves up to 16.2x speedup for real benchmarks, and saves up to 90% of energy.Los modelos de programaci贸n basados en tareas permiten a los programadores expresar las aplicaciones como una colecci贸n de tareas con dependencias entre ellas. Dichos modelos son simples de usar y mejoran enormemente la programabilidad. Para ello se valen del uso de una runtime que en tiempo de ejecuci贸n ayuda a explotar el paralelismo de las tareas cuando se ejecutan en plataformas multi-cores, many-cores y heterog茅neas. En estos modelos de programaci贸n los runtimes garantizan la ejecuci贸n de las tareas en el orden correcto mediante el uso de gr谩ficos de dependencias entre tareas (TDG). Actualmente, los runtimes son lo suficientemente potentes para proporcionar un alto rendimiento con tareas de granularidad gruesa a pesar de que para mantener toda la informaci贸n que necesitan para hacer su trabajo, introducen un sobrecoste importante en la ejecuci贸n de las aplicaciones. El problema viene dado por la tendencia actual en arquitectura de computadores a seguir incluyendo m谩s n煤cleos y heterogeneidad (de hecho, complejidad) en los sistemas de procesado con lo que el paralelismo de granularidad gruesa no es suficiente para alimentar todos los recursos. En estos entornos complejos las tareas de granularidad fina son preferibles ya que son capaces de exponer un mayor paralelismo de las aplicaciones. Sin embargo, con tareas de granularidad fina, los sobrecostes introducidos por los runtimes software son mayores debido a la necesidad de manejar muchas m谩s tareas m谩s r谩pido. En general los mayores sobrecostes introducidos por los runtimes son: la administraci贸n de los grafos de dependencias que relacionan las tareas y la gesti贸n de las tareas en sistemas heterog茅neos. Proponemos una arquitectura hardware, llamada Picos, que consiste en un administrador de dependencias entre tareas incluyendo soporte para tareas anidadas y planificaci贸n de tareas heterog茅neas. La funci贸n principal de dicha arquitectura es acelerar las funciones cr铆ticas de los runtimes para modelos de programaci贸n basados en tareas. Con Picos, se pretende extender el beneficio de estos modelos de programaci贸n para explotar el paralelismo y la heterogeneidad ejecutando tareas de granularidad fina. Como prueba de concepto, tres prototipos de Picos han sido dise帽ado en VHDL e implementado en una plataforma System-on-chip que consta de varios n煤cleos ARM integrados junto con una FPGA, y ademas analizados con ejecuciones reales con OmpSs y con Linux. El primer prototipo es un administrador hardware de tareas con dependencias, que se ha implementado en un SoC Xilinx Zynq serie 7000. Est谩 conectado a un procesador ARM Cortex A9 de 2 n煤cleos, e integrado con el SO. Con 24 n煤cleos simulados y realizando el an谩lisis real de las dependencias entre tareas en Picos, obtiene hasta un 21x sobre las mismas ejecuciones usando el entorno software. El segundo prototipo, Picos++, ampli贸 Picos incorporando el soporte para la gesti贸n de tareas anidadas en hardware. Hasta donde llega nuestro conocimiento, esta es la primera vez que dicha caracter铆stica ha sido propuesta y/o incorporada en un administrador hardware de dependencias entre tareas. El segundo prototipo est谩 completamente integrado en el sistema, no solo en hardware, sino tambi茅n con el modelo de programaci贸n paralelo y con el sistema operativo. El tercer prototipo, incluye un administrador y planificador de tareas heterog茅neas. El planificador de tareas heterog茅neas recibe dichas tareas listas del administrador de dependencias entre tareas y las programa en la unidad de ejecuci贸n de hardware adecuada que tenga el tiempo de finalizaci贸n estimado m谩s corto. Este prototipo se ha implementado en un chip MPSoC Xilinx Zynq Ultrascale+. En dicho sistema con cuatro n煤cleos ARM y hasta 15 aceleradores HW funcionales, logra una aceleraci贸n de hasta 16.2x, y ahorra hasta el 90% de la energ铆a con respecto al software.Postprint (published version
    corecore