-
Notifications
You must be signed in to change notification settings - Fork 163
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] Compute Pool 2 #3076
Draft
colin-ho
wants to merge
13
commits into
main
Choose a base branch
from
colin/compute-pool-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[FEAT] Compute Pool 2 #3076
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
colin-ho
added a commit
that referenced
this pull request
Oct 23, 2024
Create a multithreaded compute runtime for swordfish compute tasks. Switch query runtime to be single threaded, and use IO pool for scan task streams. Additionally, adds in a `tokio_select` together with the `tokio::signal::ctrlc` and main async execution loop so that queries can be cancelled. ``` import os import daft import numpy import time import psutil current_process = psutil.Process(os.getpid()) daft.set_execution_config(enable_native_executor=True, default_morsel_size=1) dfs = [ iter( daft.from_pydict({"a": numpy.random.rand(10)}).with_column( "plus_one", daft.col("a") + 1 ) ) for _ in range(10) ] while True: for i, df in enumerate(dfs): time.sleep(0.1) try: print("threads: ", current_process.num_threads()) print(next(df)) except StopIteration: dfs.pop(i) if not dfs: break ``` If you run this script you can see that the number of threads increases by only 1 per dataframe. TODO: - replace rayon with this -> #3076 --------- Co-authored-by: Colin Ho <[email protected]> Co-authored-by: Colin Ho <[email protected]> Co-authored-by: Colin Ho <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a global tokio runtime for compute . Follow on from #2986