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/
68 stars 10 forks source link

Experiment with quantization rewrites #171

Open gussmith23 opened 2 years ago

gussmith23 commented 2 years ago

I think we could incorporate some quantization-like experiments in Glenside.

We could keep sample values in the analysis (like Ruler's cvec). We could then have rewrites that quantize/manipulate the program with different datatypes (e.g. 8 bit ints) and recalculate the values in the cvec. Then, we could merge only when cvecs match, i.e. when quantization is accurate enough.

This doesn't necessarily need to be done in Glenside; this idea could be implemented elsewhere.