"hloenv"
Project description
HloEnv
HloEnv is an environment based on Accelerated Linear Algebra (XLA) for deep learning compiler optimization research. HloEnv transforms all graph rewrites into a common representation, providing a flexible interface to control and modify existing graph optimization passes. In this representation, an XLA pass is converted into a set of sequential rewrite decisions.
HloEnv has the following major features:
-
The alternative graph representation
HloEnv frames the graph optimization problem as a sequential rewrite decision problem, serving as a single-player game engine. See always_pick_first and uniform_policy for examples of interacting with HloEnv and optimizing a HLO computation grpah.
-
Python interface for full XLA optimization passes and pipelines
HloEnv provides a Python interface to control and modify existing graph optimization passes. See general_fusion_pipeline for an example of our customized XLA optimization pipeline.
The design of HloEnv points to a potential future where deep learning compiler engineers only need to develop and maintain a simple set of rewrite rules. The complicated heuristics are left to machine learning-generated optimization strategies that generalize to both new deep learning models and new deep learning hardware.
Citations
HloEnv is described in details in the following paper:
@inproceedings{HloEnv2022,
author = {Chin Yang Oh, Kunhao Zheng, Bingyi Kang, Xinyi Wan, Zhongwen Xu, Shuicheng Yan, Min Lin, Yangzihao Wang},
title = {HloEnv: A Graph Rewrite Environment for Deep Learning Compiler Optimization Research},
booktitle = {Workshop on ML for Systems at NeurIPS 2022},
year = {2022},
series = {NeurIPS '22},
month = dec,
}
Docs
The full documentation for HloEnv can be found at this link.
Quick Start
Install the pre-built HloEnv wheel from PyPI:
python3 -m pip install hloenv
To run examples, you need to install the following dependencies in your python package:
- TensorFlow==2.9.0
- NumPy
Build HloEnv
To build HloEnv and evaluate HLO graph runtime, you need to install the following dependencies:
- Bazel
- liblapack-dev
- CUDA
To clone HloEnv and install Tensorflow, run the following command:
git clone git@github.com:sail-sg/hloenv.git
cd hloenv
python -m venv hloenv-env
source hloenv-env/bin/activate
python3 -m pip install tensorflow==2.9.0
When met the minimum requirement, building HloEnv Python Wheels can be very simple.
In the root directory of HloEnv, run the following command:
make build
Will build the wheels file and put it under the folder dist.
make install
Will install the freshly built Python Wheels and all the dependencies.
HLO Dataset
You can find the unoptimized HLO text files harvested from JAX implemented repositories on GitHub here
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file hloenv-0.0.0-cp38-cp38-manylinux_2_6_x86_64.whl
.
File metadata
- Download URL: hloenv-0.0.0-cp38-cp38-manylinux_2_6_x86_64.whl
- Upload date:
- Size: 3.6 kB
- Tags: CPython 3.8, manylinux: glibc 2.6+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/5.0.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f154ed1dc9eb373a7f7be59d99a1b8513746e7ae32f23f64a44b9fb760c813c9 |
|
MD5 | dd6d78eb1948ec6ece1290cf99c33e0e |
|
BLAKE2b-256 | cf6424077ebaf43decd093f496aa0132acb442d219eac1ac1f90ae3526bc2f90 |