Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tensat Examples #4

Merged
merged 3 commits into from
Jul 8, 2023
Merged

Add Tensat Examples #4

merged 3 commits into from
Jul 8, 2023

Conversation

ezrosent
Copy link
Contributor

@ezrosent ezrosent commented Jul 6, 2023

This PR adds some examples from Tensat. The Tensat repo dynamically estimates costs of certain operators based on the hardware on which it is run. I wrote some code to "scrape" these costs and then write them to the extraction-gym format.

A couple notes on this one:

  • The "bottom-up" algorithm appeared to infinite-loop for the nasneta examples here. I dug into this a bit and found that we were spending all of the time in tree_cost: the fix is to memoize duplicate calls in tree_cost and dag_cost. Things finish pretty fast after that.
  • One lesson from that paper is that ILPs can be encoded "naively" (without any constraints around cycles) if the e-graph is pruned ahead of time. The "acyclic" examples here include the results of that process.

@mwillsey
Copy link
Member

mwillsey commented Jul 7, 2023

I'm changed the format, but hopefully you can use the convert.py script to easily convert to the new format.

@ezrosent
Copy link
Contributor Author

ezrosent commented Jul 8, 2023

Will do! Need to re-merge some of the memoization stuff but that actually looks like it'll be easier to add with the new structure. I should have it done soon.

@ezrosent
Copy link
Contributor Author

ezrosent commented Jul 8, 2023

Should be good to go!

@mwillsey mwillsey merged commit 5902665 into egraphs-good:main Jul 8, 2023
@mwillsey
Copy link
Member

mwillsey commented Nov 2, 2023

@ezrosent do you recall the pruning process? #14 notices some cycles present in even the _acyclic variants.

@ezrosent
Copy link
Contributor Author

ezrosent commented Nov 3, 2023

I just used https://github.com/uwplse/tensat + the sample code for exporting egg to the extraction-gym format. I don't think I modified tensat at all.

Maybe some of the cycle pruning happens during extraction in tensat? It's also possible that I invoked the tool incorrectly (though the acyclic variants are smaller here, so something is happening at least).

@ezrosent
Copy link
Contributor Author

ezrosent commented Nov 3, 2023

I can try and dig up the specific setup I had that generated this (old windows machine with an nvidia GPU), but in the near-term, we can probably just remove the _acyclic egraphs that have cycles in them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants