-
-
Notifications
You must be signed in to change notification settings - Fork 293
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
Adding Single-Trigger cells? #2970
Comments
#1079 would be another solution to this for us. The problem isn't necessarily that $LONG_COMPUTATION is rerun, but rather that it is blocking the evaluation of everything else. It looks like a lot of work to implement that though. |
I don't think parallelizing evaluation will help for the use case I mentioned. If it's really something expensive, like running MCMC for minutes or spawning off SLURM workers that will cost you compute credit, you also don't want many parallel evaluations in the background, you want to control (re-)evaluation. Another use case would we data-acquisition - here you also don't want to start another measurement with your lab system every time you change some things the |
I decided to use some of my free time to try adding the feature. I have never delved into Pluto repo, so I cannot estimate the time needed. I will however share my thoughts before starting: Details of the feature
Accessing the featureI see two potential ways for the user to access the feature:
I prefer the hook-like feature because this allows for more flexibility and composability with other hooks. For example, it would allow staleness to be decided based upon dependency equality, like use_memo, avoiding needlessly marking a cell as stale when we modify a dependency and then go back to its previous value You could also create a cache of outputs, marking a cell as stale when the cache does not yet contain a precomputed value. We could create hooks in PlutoHooks for common use cases. |
Thanks so much @SimonLafran ! |
Following up on a conversation with @fonsp at JuliaCon I'm creating this issue based on an older discussion:
Using Pluto for use cases the include long(er) running computations is currently a bit tricky:
(In the following, I use "above" and "below" in the sense in dependency-order, not notebook layout cell-order.)
If some Pluto cells have run times on the order of minutes (e.g. statistical inference, machine learning training, etc.), and those (typicall few) cells depends on several input/configuration/parameter values "above", then the cell will be triggered again and again while users fiddle with those "inputs". This can make their system really slow, drain their battery, or (when run on large systems that use accounting) come with resource costs in terms of compute credits or possibly actual money (e.g. when the cells spawns workers on on-demand cloud-resources).
We've had the ability to disable cells temporarily for a while now, which can come in handy. But it doesn't really address the "a few very expensive cells" scenario - one has to manually disable and re-enable the right cells again and again, and while they are disabled everything "below" is grayed out.
Could we add "single-shot" cells to Pluto? They would behave similar to cells that immediately disable themselves after they've been run. But in contrast to actually disabled cells, the content "below" would not be grayed out immediately - not until is becomes invalid - i.e. until the "one-shot" cell should be run again because the values "above" have changed. When that happens, the "one-shot" cell could be marked red, get a big "play" button overlay, or something like that, and everything "below" would be grayed-out - clearly showing that what's "below" is not consistent with what's "above" anymore.
I think this would be in keeping with Pluto philosophy - this is not about adding Jupyter-like cells, it's more like the "single-trigger" mode on an oscilloscope (we already have "continuous trigger" and "trigger off", so to speak).
@Pangoraw came up with a partial workaround based @use_memo and @SimonLafran recently posted a macro-based approach to this (thanks!!), but it can't mark dependent cells as outdated. Having this as a Pluto built-in feature would be great, in my opionion.
The text was updated successfully, but these errors were encountered: