Skip to content
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] Enable init args for stateful UDFs #2956

Merged
merged 6 commits into from
Sep 27, 2024

Conversation

kevinzwang
Copy link
Member

No description provided.

@github-actions github-actions bot added the enhancement New feature or request label Sep 27, 2024
Copy link

codspeed-hq bot commented Sep 27, 2024

CodSpeed Performance Report

Merging #2956 will not alter performance

Comparing kevin/stateful-actor-init-args (05cb70f) with main (c5a6d88)

Summary

✅ 17 untouched benchmarks

Copy link
Contributor

@jaychia jaychia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We should also ensure the other configurations are passed along (I believe the only other one we need to think about is .with_batch_size())

set_planning_config(
config=get_context().daft_planning_config.with_config_values(enable_actor_pool_projections=request.param)
)
yield request.param
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remember to reset the config too to the old one after the yield point.

We do this for the execution context (see: daft.context.py)

@contextlib.contextmanager
def execution_config_ctx(**kwargs):
    """Context manager that wraps set_execution_config to reset the config to its original setting afternwards"""
    original_config = get_context().daft_execution_config
    try:
        set_execution_config(**kwargs)
        yield
    finally:
        set_execution_config(config=original_config)

We can probably just make one for the planning config too!

@kevinzwang
Copy link
Member Author

@jaychia the batch size is passed in already in the rust side that actually calls the stateful UDF: https://github.com/Eventual-Inc/Daft/blob/kevin/stateful-actor-init-args/src/daft-dsl/src/functions/python/udf.rs#L197

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 76.31579% with 9 lines in your changes missing coverage. Please review.

Project coverage is 78.49%. Comparing base (46c5a7e) to head (05cb70f).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
daft/runners/pyrunner.py 0.00% 6 Missing ⚠️
daft/runners/ray_runner.py 66.66% 2 Missing ⚠️
src/daft-dsl/src/functions/python/mod.rs 91.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2956      +/-   ##
==========================================
+ Coverage   76.34%   78.49%   +2.14%     
==========================================
  Files         597      597              
  Lines       71388    70091    -1297     
==========================================
+ Hits        54504    55017     +513     
+ Misses      16884    15074    -1810     
Flag Coverage Δ
78.49% <76.31%> (+2.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
daft/udf.py 95.52% <100.00%> (+1.02%) ⬆️
src/common/daft-config/src/python.rs 77.34% <100.00%> (+5.50%) ⬆️
src/daft-dsl/src/python.rs 91.10% <100.00%> (+0.91%) ⬆️
src/daft-dsl/src/functions/python/mod.rs 79.19% <91.66%> (+24.19%) ⬆️
daft/runners/ray_runner.py 80.62% <66.66%> (+4.91%) ⬆️
daft/runners/pyrunner.py 85.25% <0.00%> (+3.82%) ⬆️

... and 38 files with indirect coverage changes

@kevinzwang kevinzwang merged commit 44c09de into main Sep 27, 2024
39 of 40 checks passed
@kevinzwang kevinzwang deleted the kevin/stateful-actor-init-args branch September 27, 2024 21:38
sagiahrac pushed a commit to sagiahrac/Daft that referenced this pull request Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants