-
Notifications
You must be signed in to change notification settings - Fork 156
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
feat: lazy runtime #1302
feat: lazy runtime #1302
Conversation
prototype working
set staleness at graph registration set disabled-transitively at graph registration clear staleness on run
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
for cid in runner.cells_to_run: | ||
if runner.graph.is_disabled(cid): | ||
runner.graph.cells[cid].set_stale(stale=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in "detect", could this .set_stale(stale=True)
twice? probably a pre-optimization, but could force re-renders on the frontend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could ... but I think this code path won't be hit when the mode is detect
.
@@ -91,13 +91,10 @@ by your notebook's imported modules too. | |||
|
|||
Autoreloading comes in two types: | |||
|
|||
- "detect": automatically marks cells affected by module | |||
- "lazy": automatically marks cells affected by module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patched the config loader to make this backward compatible.
@pytest.fixture(params=["k", "lazy_kernel"]) | ||
def any_kernel(request: Any) -> Kernel: | ||
return request.getfixturevalue(request.param) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New fixture that runs a test twice, once with each type of kernels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.4.12-dev10 |
This PR adds a configuration to make the runtime lazy. When enabled, running a cell marks descendants cells as stale but doesn't automatically run them.
Running a cell will still never use stale inputs: if a cell has any stale ancestors, those will be run before the cell is run.
This makes working with notebooks that run expensive computations much more ergonomic, while still preserving the semantics of the DAG and the computational reproducibility afforded by it.