gussmith23 / glenside

A pure, low-level tensor program representation enabling tensor program optimization via program rewriting. See the web demo at https://gussmith23.github.io/glenside-web-demo/
71 stars 10 forks source link
equality-saturation machine-learning program-rewriting

Glenside

Build and test Check formatting

Check out the web demo!

Glenside is a pure, low-level tensor program representation which enables tensor program optimization via program rewriting, using rewriting frameworks such as the egg equality saturation library. If you are interested in transforming and optimizing tensor kernels (e.g. fusing kernels, exploring data layouts, or mapping to custom hardware), then Glenside is of interest to you! See the web demo for concrete examples. See our MAPS 2021 paper to understand why Glenside exists and how it can be used. Finally, see the docs for technical documentation.

Quickstart

Fastest way to verify that this code actually does something is to build the Docker image and run the tests:

git clone <this repo>
cd <this repo>
docker build --tag glenside .
docker run -it glenside cargo test

...and "soon" I will add interactive web demos and pretty visualizations!

Dependencies

Glenside optionally depends on TVM and CPLEX. To disable these optional dependencies, use the --no-default-features flag with cargo, e.g. cargo test --no-default-features.

CPLEX

Glenside uses the CPLEX ILP solver. It isn't actually used in the core of Glenside anymore, and needs to be removed or cordoned off, but for now, to get Glenside fully working, you need CPLEX. To set up CPLEX, follow these steps:

  1. Get access to CPLEX. Students and academics can do so by making an account through their academic program. Download and install CPLEX on your machine.
  2. Set environment variables. Set $CPLEX_LIB to the location of the newly-installed CPLEX library on your machine. For me on OSX, it resides in /Applications/CPLEX_Studio1210/cplex/lib/x86-64_osx/static_pic/.

Publications