add lola e2e test - #3225
Conversation
|
According to our 🤖 overlords, With that, it succeeds at finding the upper bound:
but then it just slows down to a crawl a bit later:
Specifically, it's our old friend |
|
Interestingly, even if you wait the full 20+ min for the compile, it produces an incorrect/invalid IR: |
|
With #3226, it does now compile successfully (in 20 minutes) and run, but the results are wrong! EDIT2: The more interesting issue is: why does this tiny quad-activation model bootstrap at all? And the answer is because there's apparently a really deep layout conversion network being materialised? |
asraa
left a comment
There was a problem hiding this comment.
you could increase the level-budget to avoid bootstrap
Looking at it, there should be no need to bootstrap - the conversion could be pushed into the plaintext encode for free, but it's not picked up by our system. Working on a fix for that now :) |
ae07adc to
62b8664
Compare
|
I rebased and cleaned up the churn a bit (the bootstrap fix, for example, while discovered because of Lola, isn't even necessary anymore after we stopped the deep layout conversion from being materialised) |
|
I changed the way the bounding box is computed. It now scans the rows to check if there is a relation that allows to deduce a bounding box immediately for each variable. I think this is mostly the case. It falls back to the previous (expensive) way to compute this if a row giving an immediate bound is not available. Caveat: there could be cases where many inequalities, when taken together, give a tighter bounding box for a variable, in which case this new way would give the looser bound. |
|
So, I love the change in c8efe4b, the idea of eagerly repacking a layout conversion from the vector input to a matrix input is awesome. However, we already implemented the underlying plaintext-repacking logic as part of the "hoisting" idea: hoisting the output layout conversion through to the input and (essentially) permuting the columns of the matrix to match. heir/lib/Utils/Layout/Hoisting.h Lines 13 to 24 in 13f16c8 Is it too much to ask to find the core subset of logic that applies to both situations, and refactor appropriately? The two implementations look eerily similar to me, though I am reviewing this code while drinking sake and my reasoning may be clouded as such. |
j2kun
left a comment
There was a problem hiding this comment.
Looks great, lots of nice improvements here. Just a few comments.
|
Also, if the lola test is still failing, I think it would be good to pull some of these incremental improvements out into separate PRs and we can get them merged. |
I pulled two commits into their own PR and expanded them. Once we agree on these two pieces of work, I can rebase and drop the corresponding commits from this branch. |
|
With the other two PRs green lit, I don't think much else is going on here other than adding the test. Let me know if I should squash, or if you would like to see some more changes |
|
Rebase and squash and let's see what's left. |
a7ae561 to
7179ef2
Compare
7179ef2 to
ff23246
Compare
Rebased, and it still needs both the fold-dense-resources and simplex-in-materialize-layout changes to compile (I tried w/o either, or just one, and all got stuck in heir-opt for 30+ min before I killed them). There's an (I assume) unrelated CI failure, but if the test were to run on CI, it'd have also failed after rebasing because the accuracy was still off (convolution init bug, fix cherry-picked over from our fork) EDIT: to be discussed at office hours, but I guess I'll open three new PRs for those three changes/fixes |
j2kun
left a comment
There was a problem hiding this comment.
LGTM! Can you squash and we'll get it in?
* add e2e test for Orion-style LoLA model * add more debug output * materializeLayout: use Simplex::computeIntegerBounds instead of IntegerRelation::getConstantBound64 * AssignLayout: also fold for dense resources * layout propagation: pack the conv init (bias) into the kernel's result layout
22df3df to
8c26ed9
Compare
@j2kun Done! |
This is the model that kept blowing up for us :)
The PR CI passes trivially because the test is "large" and not run, but it currently fails in
--convert-to-ciphertext-semantics, choking on this:https://github.com/google/heir/blob/main/lib/Transforms/ConvertToCiphertextSemantics/TypeConversion.cpp#L28-L29
I added some debug output, so here is what it's actually trying to do: