99 research outputs found
Evidence Normalization in System FC (Invited Talk)
System FC is an explicitly typed language that serves as the target language for Haskell source programs. System FC is based on System F with the addition of erasable but explicit type equality proof witnesses. Equality proof witnesses are generated from type inference performed on source Haskell programs. Such witnesses may be very large objects, which causes performance degradation in later stages of compilation, and makes it hard to debug the results of type inference and subsequent program transformations. In this paper we present an equality proof simplification algorithm, implemented in GHC, which greatly reduces the size of the target System FC programs
Boxy Types: Inference for Higher-Rank Types and Impredicativity
Languages with rich type systems are beginning to employ a blend of type inference and type checking, so that the type inference engine is guided by programmer-supplied type annotations. In this paper we show, for the first time, how to combine the virtues of two well-established ideas: unification-based inference, and bidirectional propagation of type annotations. The result is a type system that conservatively extends Hindley-Milner, and yet supports both higher-rank types and impredicativity
A Reflection on Types
The ability to perform type tests at runtime blurs the line between statically-typed and dynamically-checked languages. Recent developments in Haskell’s type system allow even programs that use reflection to themselves be statically typed, using a type-indexed runtime representation of types called \{}\textit{TypeRep}. As a result we can build dynamic types as an ordinary, statically-typed library, on top of \{}\textit{TypeRep} in an open-world context
Memory-efficient array redistribution through portable collective communication
Modern large-scale deep learning workloads highlight the need for parallel
execution across many devices in order to fit model data into hardware
accelerator memories. In these settings, array redistribution may be required
during a computation, but can also become a bottleneck if not done efficiently.
In this paper we address the problem of redistributing multi-dimensional array
data in SPMD computations, the most prevalent form of parallelism in deep
learning. We present a type-directed approach to synthesizing array
redistributions as sequences of MPI-style collective operations. We prove
formally that our synthesized redistributions are memory-efficient and perform
no excessive data transfers. Array redistribution for SPMD computations using
collective operations has also been implemented in the context of the XLA SPMD
partitioner, a production-grade tool for partitioning programs across
accelerator systems. We evaluate our approach against the XLA implementation
and find that our approach delivers a geometric mean speedup of ,
with maximum speedups as a high as , while offering provable memory
guarantees, making our system particularly appealing for large-scale models.Comment: minor errata fixe
FreezeML:Complete and Easy Type Inference for First-Class Polymorphism
ML is remarkable in providing statically typed polymorphism without the
programmer ever having to write any type annotations. The cost of this
parsimony is that the programmer is limited to a form of polymorphism in which
quantifiers can occur only at the outermost level of a type and type variables
can be instantiated only with monomorphic types.
Type inference for unrestricted System F-style polymorphism is undecidable in
general. Nevertheless, the literature abounds with a range of proposals to
bridge the gap between ML and System F.
We put forth a new proposal, FreezeML, a conservative extension of ML with
two new features. First, let- and lambda-binders may be annotated with
arbitrary System F types. Second, variable occurrences may be frozen,
explicitly disabling instantiation. FreezeML is equipped with type-preserving
translations back and forth between System F and admits a type inference
algorithm, an extension of algorithm W, that is sound and complete and which
yields principal types.Comment: 48 pages, 23 Figures. Accepted for PLDI 202
Closed Type Families with Overlapping Equations
Open, type-level functions are a recent innovation in Haskell that move Haskell towards the expressiveness of dependent types, while retaining the look and feel of a practical programming language. This paper shows how to increase expressiveness still further, by adding closed type functions whose equations may overlap, and may have non-linear patterns over an open type universe. Although practically useful and simple to implement, these features go be- yond conventional dependent type theory in some respects, and have a subtle metatheory
Closed Type Families With Overlapping Equations (Extended Version)
Open, type-level functions are a recent innovation in Haskell that move Haskell towards the expressiveness of dependent types, while retaining the look and feel of a practical programming language. This paper shows how to increase expressiveness still further, by adding closed type functions whose equations may overlap, and may have non-linear patterns over an open type universe. Although practically useful and simple to implement, these features go beyond conventional dependent type theory in some respects, and have a subtle metatheory
- …