Skip to content

sheaf-lang/sheaf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

577 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sheaf-logo

Sheaf is a functional language for machine learning. Inspired by Clojure, it compiles to StableHLO and runs on GPU via IREE.

Sheaf ships as a single native binary with zero runtime dependencies, for Linux (x86_64, aarch64) and macOS.

Quick start

See the Quick Start guide for installation and first steps.

Goals

  • Clojure paradigm: homoiconicity, immutability, minimalist syntax
  • Native hardware performance: compiles to StableHLO, executes via IREE on CUDA, Metal GPU and CPU
  • JIT compilation: pure functions are automatically compiled and dispatched to the best available device
  • Reverse-mode autodiff: automatic differentiation on the expression graph, before compilation

Sample code

(defn transformer-block [x layer-p config]
  (as-> x h
    (-> h
        (layer-norm (get layer-p :ln1) 2)
        (multi-head-attention layer-p config)
        (first)
        (+ h))
    (-> h
        (layer-norm (get layer-p :ln2) 2)
        (mlp (get layer-p :mlp))
        (+ h)))) ;; residual

Links

About

A functional language for machine learning. Inspired by Clojure, compiled to native GPU code.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages