#Cache function calls per-client to avoid...

1 messages ยท Page 1 of 1 (latest)

crystal gulch
#

fwiw, this benchmark is the most intentionally brutal one with a load of modules calling other modules in a quadratic fanout.

#

i also love that we broke it almost immediately after merging while i've been slowly baking discord notifications for failure in the background XD

#

confirmed the oomkill with a passing run on f920f96f and a failing one on 3a28d13c

#

cc @silk mural too here, since i think there are sacrifices here to the make-secrets-work gods and i know we both reviewed that PR... there are a couple ways to proceed:

#
  1. dig on this and find another less memory intensive way of caching across clients to support many-module situations like this
  2. accept that this test is overly brutal, tone it down to be less nested modules (currently 6 layers, gonna try 5)
crystal gulch
crystal gulch
#

5 also ooms locally for me, 16g of memory, but 4 works

#

i think it's also visibly slower? tryna put numbers to that now

gilded prawn
#

That makes perfect sense in retrospect, I guess there's a pretty obvious fix by just having the function calls cached-per-session but ensuring the secret transfer always runs. It should be easy to add support for that to dagql via some optional callback that just runs once per-client after the actual function call.

The only question is how to do that in a non-kludgy way but worst case a little kludge for now would be fine to get a fix in. I suspect dagql is going to undergo lots of renovation in the near future anyways as part of the caching stuff so can figure out a neater way to incorporate it at that time if needed

#

@crystal gulch can you open an issue for this super quick (doesn't have to be that descriptive), just so if it doesn't make it in v0.16.0 we don't forget about it

crystal gulch
#

yep will do

#

shoulda just done that yesterday but i jumped the gun a little bit and posted while my bisect was still running lol

#

and indeed it is significantly slower with layers=4: 2m28s before and 3m39s after... possible there's some cache effect on the inner engine fucking that up

silk mural
#

I think that sounds familiar, I spent a long time on that at some point ๐Ÿ˜›

gilded prawn
#

This fix passes secret tests and lets me run BenchmarkLotsOfDeps locally successfully: https://github.com/dagger/dagger/pull/9621

Really ridiculously kludgy atm, gonna see if it has any impact on our test runtimes generally (which would indicate a possible "real-world" improvement outside that benchmark test, which is fairly extreme). If it does I'll try to sneak it into the release, otherwise will let it wait for v0.16.1 to avoid unneeded boat rocking

GitHub

Should fix #9619, can run BenchmarkLotsOfDeps locally now without excessive memory usage.
Extremely kludgy and ugly atm, would ideally like to find something a little more elegant but if not will c...

gilded prawn
#

cleaned it up a bit, still not aesthetically pleasing at all but probably at "good enough" stage, will update the description after dinner

gilded prawn
gilded prawn
#

won't really know until we've done the release and collected test run data for at least a few days, but ๐Ÿคž

crystal gulch
#

Because if thatโ€™s with 6 itโ€™s quite good

#

QUITE

crystal gulch
crystal gulch
gilded prawn
crystal gulch
#

figured, that's a huge speedup even from before the per-client caching

crystal gulch
gilded prawn
# crystal gulch <:squint:873986605990441010> damn what are you feeding your machine, freshly reb...

I reverted the fix in 16.1 because main sdk dev mysteriously started erroring out on something related to it. I have a PR out for an improved fix w/ more details https://github.com/dagger/dagger/pull/9653

GitHub

Giving #9621 another try. I ended up reverting it for v0.16.1 because, for some reason, sdk dev tests on main started consistently failing due to a problem with it seemingly out of nowhere. The pro...

crystal gulch
#

ah cool i just didn't see the revert

#

bc it's hiding in the prep commit ๐Ÿ™‚

gilded prawn
crystal gulch
#

makes sense and no worries, i have to run off to japan now anyways! see you in a week, im already excited to see the metabase graphs with that last lil speedup ๐Ÿ™‚

gilded prawn
crystal gulch
#

i'd rather be reckless and suffer the consequences ๐Ÿ˜ˆ