statusfailed / catgrad

a categorical deep learning compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

e-graph dictionaries

chadbrewbaker opened this issue · comments

It would be nice to have a more comprehensive dictionary of e-graph rules for FinOrd and combinatorial species.

My shelved PR for egg that needs dusted off and finished. I implemented most of the combinatorial species bijections from Brent Yorgey's papers and most FinOrd rules from Jr. High algebra. https://github.com/chadbrewbaker/egg/blob/finset/tests/finset.rs

Willsey's thesis has code for generating these equality saturation dictionaries: https://digital.lib.washington.edu/researchworks/bitstream/handle/1773/47423/Willsey_washington_0250E_22746.pdf?sequence=1

His Ruler code for generating equality saturation lists: https://github.com/uwplse/ruler

His equality saturation compiler for tensors https://github.com/uwplse/tensat

Great 217 line implementation of combinatorial species. My minds eye has an APL like intermediate language for functions over small finite sets you can lift into for automation. https://github.com/akc/spe/blob/master/Math/Spe.hs

I haven't taken a look at the hypergraph implementation at all, but I did want to mention that I have been working on Python bindings for the egglog library, which is the successor to the egg library.

If you have any Qs about it happy to help in any way I can, I have been interested in trying out this sort of thing using it for a while, so it's exciting to see this library!

I think it would be interesting to do an optimization step using egglog on the compiled reverse pass. I haven't implemented hypergraph rewriting yet, so I don't do it on the combinatorial structure.
FYI, the actual datastructure code lives here: https://github.com/statusfailed/open-hypergraphs/
so might want to move this discussion there!