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

wrap as_complete with async #1350

Merged
merged 3 commits into from
Sep 24, 2024
Merged

Conversation

liupgd
Copy link
Contributor

@liupgd liupgd commented Sep 24, 2024

Originally as_complete is not defined with async, the asyncio.Semaphore is created in main thread not in asynci.run. This will cause 'There is no event loop' error when:

  1. len(coros) is more than max_workers;
  2. run 'evalute' function at the second time and nest_asyncio is not applied.

Originally as_complete is not defined with async, the asyncio.Semaphore is created in main thread not in asynci.run. This will cause 'There is no event loop' error when: 
1. len(coros) is more than max_workers; 
2. run 'evalute' function at the second time and nest_asyncio is not applied.
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Sep 24, 2024
add await to as_completed test code in test_executor_in_jupyter.ipynb
@jjmachan
Copy link
Member

@liupgd thanks a lot for putting this PR together 🙂

let me just benchmark it on my end too before merging it in

@jjmachan jjmachan merged commit 5ad4943 into explodinggradients:main Sep 24, 2024
15 checks passed
@jjmachan
Copy link
Member

thanks a lot @liupgd ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants