DARPA-ASKEM / terarium

https://app.terarium.ai
Apache License 2.0
15 stars 2 forks source link

[TASK]: return mmt from beaker #5542

Open shawnyama opened 1 week ago

shawnyama commented 1 week ago

Describe the task Since beaker has the mmt return it so we don't need to call amr-to-mmt within the operators that have tera-model

mwdchang commented 1 week ago

This is rather complicated and has several branches.

One branch encompass model-edit and stratify where each operator run yields a new AMR. Our general logic is such:

  1. Send AMR-original + edits to beaker
  2. Beaker processes the AMR as MMT, run mira-functions
  3. Beaker returns the MMT as AMR_new
  4. We send AMR_new through the amr-to-mmt that returns back the MMT representation + additional variable dependency information that we use for constructing tables and matrices

So in this instance there are between step-3 and step-4, in that we have MMT => AMR => MMT

In order to have a significant savings, we will need to modify from step 3 and onward:

  1. Beaker returns MMT as AMR_new, but also the MMT and variable dependencies
  2. We cache the MMT and variable dependencies by the AMR
  3. Before calling amr-to-mmt check if the cache exist, if it does we will just return the cache, if not we will run amr-to-mmt as before

Further complicate the matter is amr-to-mmt task is already caching its results and we'd need to consolidate the caching mechanism. It doesn't seem like the benefit will be significant enough versus the complications and the additional engineering requirement, so I think we should do this in the background/backburner but there are likely higher priority things that should take precedence.