-
Notifications
You must be signed in to change notification settings - Fork 948
feature: improve async / executor functionality #2070
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
Open
ahgraber
wants to merge
9
commits into
explodinggradients:main
Choose a base branch
from
ahgraber:feature/async-executor
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.
Conversation
This file contains hidden or 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
This helps separate async features from executor and engine modules, and will prevent circular imports in these modules.
Introduces a new ProgressBarManager class to manage progress bars for both batch and non-batch execution. This includes methods for creating single and nested progress bars, as well as updating batch progress bars, improving user experience during long-running tasks.
- Refactored `run` function from repeated async, executor, and engine logic. - Changed `as_completed` from async to a regular function for better compatibility. - Added `process_futures` to handle futures with optional progress tracking.
- Refactored Executor to utilize new async_utils and ProgressBarManager for improved composition - Refactored run_async_tasks to utilize ProgressBarManager for improved progress tracking. - Modified tests to validate the new behavior functions
- Introduced a locking mechanism to ensure thread-safe job processing. - Added `_jobs_processed` attribute to maintain consistent job indexing across multiple runs. - Implemented `clear_jobs` method to reset job indices. - Updated tests to verify exception handling and job indexing after clearing jobs. - Adjusted Jupyter notebook tests for consistency in results retrieval.
…sted Transformation or Parallel procedures - The apply_transforms() function has been updated to handle different types of transformations recursively: If transforms is a list, it recursively applies each transform in the list. If transforms is a Parallel instance, it recursively applies the transformations contained within the Parallel object. If transforms is a BaseGraphTransformation, it generates an execution plan (a list of coroutines), gets a description, and then runs the coroutines asynchronously using run_async_tasks(). If transforms is none of the above, it raises a ValueError indicating an invalid type. - Move apply_nest_asyncio to async_utils for better organization - Updated the Parallel class to support transformations with improved type hints. - Added unit tests
I know this one is a big review - everything's interrelated enough that I had a hard time splitting it up, but I could try to refactor into smaller pulls if necessary. |
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.
This helps separate async features from executor and engine modules, and will prevent circular imports in these modules.
Introduces a new ProgressBarManager class to manage progress bars for both batch and non-batch execution. This includes methods for creating single and nested progress bars, as well as updating batch progress bars, improving user experience during long-running tasks.
run
function from repeated async, executor, and engine logic.as_completed
from async to a regular function for better compatibility.process_futures
to handle futures with optional progress tracking._jobs_processed
attribute to maintain consistent job indexing across multiple runs.clear_jobs
method to reset job indices.If transforms is a list, it recursively applies each transform in the list.
If transforms is a Parallel instance, it recursively applies the transformations contained within the Parallel object.
If transforms is a BaseGraphTransformation, it generates an execution plan (a list of coroutines), gets a description, and then runs the coroutines asynchronously using run_async_tasks().
If transforms is none of the above, it raises a ValueError indicating an invalid type.