1,539 research outputs found

    Automatic Optimization of Python Skeletal Parallel Programs

    Get PDF
    International audienceSkeletal parallelism is a model of parallelism where parallel constructs are provided to the programmer as usual patterns of parallel algorithms. High-level skeleton libraries often offer a global view of programs instead of the common Single Program Multiple Data view in parallel programming. A program is written as a sequential program but operates on parallel data structures. Most of the time, skeletons on a parallel data structure have counterparts on a sequential data structure. For example, the map function that applies a given function to all the elements of a sequential collection (e.g., a list) has a map skeleton counterpart that applies a sequential function to all the elements of a distributed collection. Two of the challenges a programmer faces when using a skeleton library that provides a wide variety of skeletons are: which are the skeletons to use, and how to compose them? These design decisions may have a large impact on the performance of the parallel programs. However, skeletons, especially when they do not mutate the data structure they operate on, but are rather implemented as pure functions , possess algebraic properties that allow to transform compositions of skeletons into more efficient compositions of skeletons. In this paper, we present such an automatic transformation framework for the Python skeleton library PySke and evaluate it on several example applications

    PySke: Algorithmic Skeletons for Python

    Get PDF
    International audiencePySke is a library of parallel algorithmic skeletons in Python designed for list and tree data structures. Such algorithmic skeletons are high-order functions implemented in parallel. An application developed with PySke is a composition of skeletons. To ease the write of parallel programs, PySke does not follow the Single Program Multiple Data (SPMD) paradigm but offers a global view of parallel programs to users. This approach aims at writing scalable programs easily. In addition to the library, we present experiments performed on a high-performance computing cluster (distributed memory) on a set of example applications developed with PySke

    Pricing Python Parallelism: A Dynamic Language Cost Model for Heterogeneous Platforms

    Get PDF
    Execution times may be reduced by offloading parallel loop nests to a GPU. Auto-parallelizing compilers are common for static languages, often using a cost model to determine when the GPU execution speed will outweigh the offload overheads. Nowadays scientific software is increasingly written in dynamic languages and would benefit from compute accelerators. The ALPyNA framework analyses moderately complex Python loop nests and automatically JIT compiles code for heterogeneous CPU and GPU architectures. We present the first analytical cost model for auto-parallelizing loop nests in a dynamic language on heterogeneous architectures. Predicting execution time in a language like Python is extremely challenging, since aspects like the element types, size of the iteration space, and amenability to parallelization can only be determined at runtime. Hence the cost model must be both staged, to combine compile and run-time information, and lightweight to minimize runtime overhead. GPU execution time prediction must account for factors like data transfer, block-structured execution, and starvation. We show that a comparatively simple, staged analytical model can accurately determine during execution when it is profitable to offload a loop nest. We evaluate our model on three heterogeneous platforms across 360 experiments with 12 loop-intensive Python benchmark programs. The results show small misprediction intervals and a mean slowdown of just 13.6%, relative to the optimal (oracular) offload strategy

    Efficient Implicit Parallel Patterns for Geographic Information System

    Get PDF
    International audienceWith the data growth, the need to parallelize treatments become crucial in numerous domains. But for non-specialists it is still difficult to tackle parallelism technicalities as data distribution, communications or load balancing. For the geoscience domain we propose a solution based on implicit parallel patterns. These patterns are abstract models for a class of algorithms which can be customized and automatically transformed in a parallel execution. In this paper, we describe a pattern for stencil computation and a novel pattern dealing with computation following a pre-defined order. They are particularly used in geosciences and we illustrate them with the flow direction and the flow accumulation computations

    Opportunistic acceleration of array-centric Python computation in heterogeneous environments

    Get PDF
    Dynamic scripting languages, like Python, are growing in popularity and increasingly used by non-expert programmers. These languages provide high level abstractions such as safe memory management, dynamic type handling and array bounds checking. The reduction in boilerplate code enables the concise expression of computation compared to statically typed and compiled languages. This improves programmer productivity. Increasingly, scripting languages are used by domain experts to write numerically intensive code in a variety of domains (e.g. Economics, Zoology, Archaeology and Physics). These programs are often used not just for prototyping but also in deployment. However, such managed program execution comes with a significant performance penalty arising from the interpreter having to decode and dispatch based on dynamic type checking. Modern computer systems are increasingly equipped with accelerators such as GPUs. However, the massive speedups that can be achieved by GPU accelerators come at the cost of program complexity. Directly programming a GPU requires a deep understanding of the computational model of the underlying hardware architecture. While the complexity of such devices is abstracted by programming languages specialised for heterogeneous devices such as CUDA and OpenCL, these are dialects of the low-level C systems programming language used primarily by expert programmers. This thesis presents the design and implementation of ALPyNA, a loop parallelisation and GPU code generation framework. A novel staged parallelisation approach is used to aggressively parallelise each execution instance of a loop nest. Loop dependence relationships that cannot be inferred statically are deferred for runtime analysis. At runtime, these dependences are augmented with runtime information obtained by introspection and the loop nest is parallelised. Parallel GPU kernels are customised to the runtime dependence graph, JIT compiled and executed. A systematic analysis of the execution speed of loop nests is performed using 12 standard loop intensive benchmarks. The evaluation is performed on two CPU–GPU machines. One is a server grade machine while the other is a typical desktop. ALPyNA’s GPU kernels achieve orders of magnitude speedup over the baseline interpreter execution time (up to 16435x) and large speedups (up to 179.55x) over JIT compiled CPU code. The varied performance of JIT compiled GPU code motivates the need for a sophisticated cost model to select the device providing the best speedups at runtime for varying domain sizes. This thesis describes a novel lightweight analytical cost model to determine the fastest device to execute a loop nest at runtime. The ALPyNA Cost Model (ACM) adapts to runtime dependence analysis and is parameterised on the hardware characteristics of the underlying target CPU or GPU. The cost model also takes into account the relative rate at which the interpreter is able to supply the GPU with computational work. ACM is re-targetable to other accelerator devices and only requires minimal install time profiling

    Computer aided method for 3D assessment of the lower limb alignment for orthopedic surgery planning

    Get PDF
    Tese de mestrado integrado, Engenharia Biomédica e Biofísica (Engenharia Clínica e Instrumentação Médica) Universidade de Lisboa, Faculdade de Ciências, 2017Os membros inferiores são responsáveis por fornecer suporte à totalidade do corpo humano e são essenciais nas mais variadas tarefas como estar de pé, andar e correr. Por vezes, e devido a diversos motivos, podem existir defeitos ou deformações nos membros inferiores que têm um impacto direto na qualidade de vida de uma pessoa, quer por se ver afetado o lado estético pessoal ou por condicionar significativamente a mobilidade. Uma característica da estrutura do membro inferior que é diretamente afetada por estas deformações é o seu alinhamento, isto é, a posição relativa dos ossos e articulações que compõem o membro. Graças à evolução da medicina moderna, corrigir estas deformações é agora uma prática bastante comum no campo da cirurgia ortopédica. No entanto, antes de qualquer cirurgia corretiva e até de qualquer planeamento que esta exija, a deformação tem de ser corretamente analisada, o que é feito através da chamada avaliação do alinhamento do membro inferior. Atualmente, num contexto clínico, esta avaliação é feita manualmente num espaço de trabalho bi-dimensional, normalmente utilizando apenas imagens de raios-X da perna inteira no plano anatómico frontal. Uma revisão ao estado da arte no que toca a métodos de planeamento cirúrgico dedicados ao membro inferior permite concluir que de facto existe software capaz de realizar este planeamento, mas que, no entanto, para além de terem custos elevadíssimos associados, nenhum utilizada modelos 3D como fonte de informação, o que traria imensos benefícios, especialmente ao nível da informação acerca da rotação e da inclinação dos ossos. Existem no entanto algum software a um nível mais experimental que utiliza modelos 3D para realizar a avaliação do alinhamento do membro inferior, sendo que nenhum deles passou ainda a estar disponível comercialmente. Numa perspetiva de implementar um método automático baseado em computador para realizar o planeamento pré-cirurgico da cirurgia de correção para ser utilizado em contexto clínico, foi proposto um projeto para o desenvolvimento de um novo software capaz de efetuar a avaliação do alinhamento do membro inferior em modelos 3D dos doentes. O projeto foi dividido em quatro etapas distintas que se desenrolaram ao longo de um estágio de sete meses. Na primeira etapa, o objetivo consistiu em gerar diversos modelos 3D dos membros inferiores de diferentes pacientes. Para tal, recorreu-se ao software de segmentação de imagens médicas Mimics 14.0 e utilizaram-se imagens de tomografia computorizada dos pacientes. Após o processo de segmentação, obtiveram-se os modelos 3D cuja qualidade teve de ser assegurada através de um processo de remeshing e cuja correta orientação espacial teve de ser também assegurada, já que a avaliação do alinhamento é sensível à orientação da perna. Para tal, utilizou-se o software de renderização 3D Geomagic Studio 14. Optou-se ainda por separar os modelos dos ossos nas suas porções proximal e distal, de modo a reduzir futuramente os tempos de computação. Findo todo este processo, assegurou-se que diferentes utilizadores poderiam gerar estes modelos sem grande variabilidade ou erro no resultado final através da comparação dos modelos obtidos de um mesmo paciente por três utilizadores distintos, sendo que os modelos obtidos apresentavam volumes com diferenças inferiores a 1% relativamente ao valor médio e com um baixo desvio padrão. Numa segunda etapa, os ângulos e medidas consideradas necessárias para uma avaliação adequada foram definidos, apresentando os valores esperados para estas medidas de acordo com a literatura. Assim, foi possível definir também os pontos anatómicos que são necessários para a definição destes mesmos ângulos e medidas e que portanto têm de ser encontrados pelo software. Na terceira etapa, fez-se então o desenvolvimento propriamente dito do software. Encontravam-se já disponíveis alguns métodos automáticos desenvolvidos no contexto projeto, contudo, estes métodos exigiam que o utilizador conhecesse as ferramentas do Geomagic de modo a obter algumas informações, e que depois fosse capaz de utilizar estas informações para editar os scripts de modo a que estes funcionassem para cada paciente em específico. Para além disso, apenas pontos muito específicos podiam ser encontrados. Nesse sentido, isto é, de modo a que todo o processo de encontrar os pontos anatómicos relevantes pudesse ser feito diretamente pelo utilizador, no programa, e sem exigir quaisquer conhecimentos de programação, um conjunto de técnicas foi implementado, dando ao programa uma grande componente gráfica. Para os diferentes pontos, foi necessário recorrer a diferentes metodologias, algumas desenvolvidas propositadamente para o efeito e implementadas em linguagem de programação Python "pura", e algumas adaptadas de outras já existentes e disponíveis no próprio Geomagic. Foi ainda assegurado que existiam métodos alternativos caso os métodos padrão não fossem os mais adequados devido a uma estrutura diferente da esperada dos próprios modelos 3D. De todo este processo resultou um programa que usa os modelos 3D gerados e, da maneira mais automática possível e com uma interface do utilizador fácil de usar, fornece todos os ângulos e medidas, efetuando assim a dita avaliação do alinhamento do membro inferior em 3D. Uma análise ponderada aos resultados obtidos permitiu identificar quais os pontos anatómicos que estarão a ser obtidos de maneira menos ideal e por isso a levar a alguns resultados não tão bons como o esperado. A dependência criada da seleção e limitação de certas áreas nas quais ocorre uma iteração que permite encontrar certos pontos é possivelmente a maior falha do programa desenvolvido que se torna assim demasiado sensível ao input do utilizador. Note-se, contudo, que os próprios testes apresentam algumas falhas que podem influenciar os resultados obtidos, tal como não ter sido definido um roteiro de teste que obrigasse a uma utilização uniforme por parte de todos os utilizadores, e também os diferentes níveis de experiência com o programa por parte dos utilizadores de teste. No entanto, a maioria das medidas obtidas apresenta valores constantes ao longo de diversas utilizações, igualando os valores que seriam obtidos manualmente, mas com o potencial de os obter em metade do tempo. Pode concluir-se então que, no momento, a avaliação do alinhamento 3D é possível utilizando o software desenvolvido. É possível ainda apontar algumas limitações e fazer algumas sugestões de modo a que estas sejas ultrapassadas. Algumas limitações partiram do facto da experiência a programar em Python ser bastante limitada, e outras partiram do software utilizado para fazer o desenvolvimento. Por exemplo, o método que teria sido o mais indicado para encontrar um certo número de pontos na Tibia não foi possível de implementar devido a um bug interno do software. Existe ainda muita coisa que pode ser feita no que toca ao software desenvolvido e ao objectivo final de desenvolver um método de planeamento pré-operativo: em primeiro lugar, é necessário realizar mais testes, de modo a aumentar o tamanho da amostra e o intervalo de confiança dos testes; em segundo lugar, eliminar a dependência do Geomagic para utilizar o programa seria o ideal; finalmente, de modo a completar o plano inicial, deve ser implementada a possibilidade de visualizar o resultado da cirurgia nos modelos 3D.The lower limbs are responsible for supporting the body and are essential for several tasks such as standing, walking and running. Sometimes, and due to various reasons, defects or deformities can be found on the lower limbs and this has an impact on a person’s quality-of-life. One characteristic of the structure of the lower limb that is affected by these deformities is its alignment, i.e. the relative positions of the bones and joints that it includes. Thanks to the evolution of modern medicine, fixing these deformities is now a common practice in the orthopedics' surgical field. Before any corrective surgery and its respective planning, the deformity needs to be properly analyzed, which is accomplished by the assessment of the alignment of the whole lower limb. Currently, in clinical setting, this assessment is carried out manually in the two-dimensional space, normally using wholeleg X-ray images of the anatomical frontal plane, but complex deformities can not be assessed properly in a 2D image. In a desire to create an automatic computer-based method for the preoperative planning of deformity correction and knee surgery, a project consisting of developing a new software for assessing the lower limb alignment based on 3D models was proposed. The project was comprised of four stages: In the first stage, 3D models of different patients’ lower limbs were generated using both segmentation and 3D rendering software, and it was ensured that these models could be generated by any user without significant variability/error in the final outcome; In the second stage, the exact angles and measures needed for a proper assessment were defined, as well as the anatomic landmarks required to calculate them that should then be found by the software; During the third stage, the software development took place, from which resulted a program that uses the generated 3D models and, in the most automatic way possible and with an easy-to-use interface, returns all the needed angles and measures; The final stage of the project was to ensure that the program is reliable and consistent in its results in both intraobserver and interobserver domain, and that it composes an improvement when compared with the manual procedure, while also ensuring that the results obtained by using the program match those obtained manually. A lot can still be done and improved regarding the developed software and the ultimate goal of fully developing a preoperative planning method, but, so far, the 3D alignment assessment that results from the program has been considered to perform its task properly and in an improved way when compared to the traditional technique, even though some limitations can be observed
    corecore