Browsing by Author "McCosh, Cheryl"
Now showing 1 - 10 of 10
Results Per Page
Sort Options
Item A type-based prototype compiler for telescoping languages(2009) McCosh, Cheryl; Kennedy, Ken; Cooper, Keith D.Scientists want to encode their applications in domain languages with high-level operators that reflect the way they conceptualize computations in their domains. Telescoping languages calls for automatically generating optimizing compilers for these languages by pre-compiling the underlying libraries that define them to generate multiple variants optimized for use in different possible contexts, including different argument types. The resulting compiler replaces calls to the high-level constructs with calls to the optimized variants. This approach aims to automatically derive high-performance executables from programs written in high-level domain-specific languages. TeleGen is a prototype telescoping-languages compiler that performs type-based specializations. For the purposes of this dissertation, types include any set of variable properties such as intrinsic type, size and array sparsity pattern. Type inference and specialization are cornerstones of the telescoping-languages strategy. Because optimization of library routines must occur before their full calling contexts are available, type inference gives critical information needed to determine which specialized variants to generate as well as how to best optimize each variant to achieve the highest performance. To build the prototype compiler, we developed a precise type-inference algorithm that infers all legal type tuples, or type configurations, for the program variables, including routine arguments, for all legal calling contexts. We use the type information inferred by our algorithm to drive specialization and optimization. We demonstrate the practical value of our type-inference algorithm and the type-based specialization strategy in TeleGen.Item Compiling Parallel Matlab for General Distributions Using Telescoping Languages(2006-10-31) Fletcher, Mary; Jin, Guohua; Kennedy, Ken; McCosh, CherylMatlab is one of the most popular computer languages for technical and scientific programming. However, until recently, it has been limited to running on uniprocessors. One strategy for overcoming this limitation is to introduce global distributed arrays, with those arrays distributed across the processors of a parallel machine. In this paper, we describe the compilation technology we have designed for Matlab D, a distributed-array extension of Matlab. Our approach is distinguished by a two-phase compilation technology with support for a rich collection of data distributions. By precompiling array operations and communication steps into Fortran plus MPI, the time to compile an application using those operations is significantly reduced. This paper includes preliminary results that demonstrate that this approach can dramatically improve performance, scaling well to at least 32 processors.Item Domain-Specific Type Inference for Library Generation in a Telescoping Compiler(2004-04-14) Chauhan, Arun; Kennedy, Ken; McCosh, CherylTelescoping languages is a strategy for allowing users to develop code in high-level, domain-specific languages and still achieve high performance. It uses extensive offline processing of the library defining the language. This process speculatively determines the possible uses of the library subroutines and generates variants specialized toward those uses. LibGen is a telescoping-language system for generating high-performance Fortran or C libraries with multiple specialized variants from a single version of MATLAB prototype code. LibGen uses variable types to guide specialization. Previously, we have shown that the generated code has comparable performance to hand-coded and optimized Fortran libraries and that specialization on type is important for achieving high performance. In this paper, we describe the type inference system necessary for LibGen to speculate on the possible variants of library procedures and to generate code. We develop the concept of type jump-functions, which describe the transfer of type information through and across procedures. To compute these type jump-functions, we develop a static type-inference approach that uses a constraint-based formulation and a graph-theoretical algorithm shown to be efficient under conditions met in most practical cases.Item Object-Oriented Type Inference for Telescoping Languages(2004) Allen, Eric; Kennedy, Ken; McCosh, CherylThe telescoping-languages approach achieves high performance from applications encoded as high-level scripts. The core idea is to pre-compile underlying libraries to generate multiple variants optimized for use indifferent possible contexts including different argument types. We have previously developed a type inference algorithm that enables type-based specialization. The algorithm infers types over untyped library procedures before actual inputs are known. Type inference is necessary both to determine the minimum number of variants needed to handle all possible uses of the library procedure as well as to statically determine, for each variant, which optimized implementations should be dispatched at each call location. In this paper, we extend the type inference algorithm to handle user-defined types in an object-oriented scripting language such as Python. Variants will be generated in order to eliminate dynamic dispatch where possible. This will allow for faster runtimes as well as enable more cross-method optimizations. Two problems that arise when handling user-defined types are the lack of abound on the number of types and the possibility of extensions to the type hierarchy after type inference. We address these problems and describe the type inference solution.Item Scheduling Tasks to Maximize Usage of Aggregate Variables In Place(2006-08-21) Budimlić, Zoran; Kennedy, Ken; Mahmeed, Samah; McCosh, Cheryl; Rogers , SteveWe present an algorithm for greedy in-placeness that runs in O(TlogT + Ew V + V^2) time, where T is the number of in-placeness opportunities, Ew is the aggregate number of wire successors and v is the number of virtual instruments in a program graph.Item Static Type Inference for Specialization in a Telescoping Compiler(2004-09-01) Allen, Eric; Kennedy, Ken; McCosh, Cheryl; Taha, WalidThe telescoping languages approach achieves high performance from applications encoded as high-level scripts. The core idea is to pre-compile underlying libraries to generate multiple variants optimized for use indifferent possible contexts including different argument types. This paper proposes a type inference algorithm that enables this kind of specialization. The algorithm infers types over untyped library procedures before actual inputs are known. For our Matlab compiler, the notion of type captures matrix properties such as size, sparsity pattern, and data type. Type inference is necessary both to determine the minimum number of variants needed to handle all possible uses of the library procedure as well as to statically determine, for each variant, which optimized implementations should be dispatched at each call location. A key contribution that arose from this work is a notion of mutually exclusive types. To illustrate these types, we formalize the underlying type system, constraint-collection, and solution. Finally, we prove that the algorithm is polynomial under practical conditions.Item Strategy for Compiling Parallel Matlab for General Distributions(2006-06-16) Fletcher, Mary; Jin, Guohua; Kennedy, Ken; McCosh, CherylExecuting applications in parallel can produce significant performance gains, yet the time and expertise needed for the low-level details of parallelism is often prohibitive. Additionally, many applications rely heavily on domain-specific libraries, while it is not practical to write an optimizing compiler each time a domain-specific library is developed. In order to obtain high performance parallelism from a high-level, domain-specific scripting language, we are developing a parallel Matlab compiler, called the Matlab D compiler, using a telescoping languages framework to generate Fortran with MPI from Matlab scripts. The goal of telescoping languages is to automatically generate high performance compilers for domain-specific languages written in the form of libraries. Before user-script compilation, the domain-specific library routines are precompiled and optimized to form specialized variants, which are substituted into the user script during user-script compilation. With this strategy, user scripts are compiled quickly, and the compiler produces applications with the same high performance as if the user's application were available at library compile time. To create a parallel Matlab, we augmented the language with array distribution types to create Matlab D. When declaring an array intended to be used in a parallel computation, the user specifies the desired distribution for the array. Our Matlab D compiler, leveraging HPF compiler technology, generates the data movement operations and partitions the computations automatically to obtain the parallelism implied by the distributions. Thus, users can develop applications in a high-level scripting language and obtain the high performance necessary without incurring the cost of low-level programming. This paper presents the framework of the Matlab D compiler from a telescoping languages perspective and our preliminary work on the project.Item Type-Based Specialization in a Telescoping Compiler for Matlab(2003-01-17) McCosh, CherylThis thesis develops telescoping-language technology for automatically generating high performance libraries from development code written in high-level languages, like Matlab. The generated library subroutines have pre-optimized variants based on possible uses of the library. Specifically, a specialized variant is generated for each possible type configuration on inputs to the library. This thesis develops an efficient graph-theoretical, constraint-based algorithm for inferring types in Matlab needed for translation into lower-level languages, optimization, and determination of which specialized variants to generate. The algorithm computes type jump functions, which allows it to infer types inter procedurally. To illustrate the power of the technology, this thesis develops ARGen, a system which generates code equivalent to ARPACK, a Fortran linear algebra library, from its Matlab development code. By accomplishing the type inferencing algorithm and ARGen, which uses it, this thesis provides a basis for a general system for telescoping languages.Item Type-based specialization in a telescoping compiler for Matlab(2003) McCosh, Cheryl; Kennedy, KenThis thesis develops telescoping-language technology for automatically generating high performance libraries from development code written in high-level languages, like Matlab. The generated library subroutines have pre-optimized variants based on possible uses of the library. Specifically, a specialized variant is generated for each possible type configuration on inputs to the library. This thesis develops an efficient graph-theoretical, constraint-based algorithm for inferring types in Matlab needed for translation into lower-level languages, optimization, and determination of which specialized variants to generate. The algorithm computes type jump functions, which allows it to infer types interprocedurally. To illustrate the power of the technology, this thesis develops ARGen, a system which generates code equivalent to ARPACK, a Fortran linear algebra library, from its Matlab development code. By accomplishing the type inferencing algorithm and ARGen, which uses it, this thesis provides a basis for a general system for telescoping languages.Item Type-Based Speculative Specialization in a Telescoping Compiler for MATLAB(2003-01-17) Chauhan, Arun; Kennedy, Ken; McCosh, CherylTelescoping languages is a strategy to automatically generate highly-optimized domain-specific libraries. The key idea is to create specialized variants of library procedures through extensive offline processing. This paper describes a telescoping system, called ARGen, which generates high-performance Fortran or C libraries from prototype Matlab code for the linear algebra library, ARPACK. ARGen uses variable types to guide procedure specializations on possible calling contexts. We show that type-based specializations of generated libraries can lead to more than 50% speedup. ARGen needs to infer Matlab types in order to speculate on the possible variants of library procedures, as well as to generate code. This paper develops an approach combining static and dynamic type inference that includes a graph-theoretic algorithm that is shown to be efficient under a set of conditions that are easily met for most practical cases. The ideas developed here provide a basis for building a more general telescoping system for Matlab.