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

Improve readers by parallelizing I/O and compute operations #5401

Open
wants to merge 47 commits into
base: dev
Choose a base branch
from

Conversation

ypatia
Copy link
Member

@ypatia ypatia commented Dec 6, 2024

Today when a reader issues the I/O request to VFS, we block waiting for all I/O to finish before moving to unfiltering. We then block again waiting for unfiltering to be done for all tiles and then continue to processing the results.

This PR is removing the need to wait for all I/O to be done, and uses async tasks to signal when a tile is done reading so that it can proceed to unfiltering, and when a tile is done unfiltering so that it can proceed to result processing before copying to the user buffers.


TYPE: IMPROVEMENT
DESC: Improve readers by parallelizing I/O and compute operations

ypatia and others added 30 commits November 29, 2024 15:28
This removes the read from waiting on all I/O operations and instead
moves the I/O task to be owned by the datablock itself. If the I/O
threadpool task is valid, we block on data access. This lets I/O and
compute be interleaved by only blocking on data when its ready to be
processed and allows for better background data loading.
This allows for copying the task/future an enabled multiple threads to
check the status of the task in a thread-safe manner.
…checking.

While the ThreadPool::SharedTask is designed to be used by multiple
threads, its designed for copying. The data structure itself is not
thread safe.

A recursive mutext is needed because some functions like load_chunk_data
call back into filtered_data() and would deadlock. This could be handled by
also release the locking in load_chunk_data(), but a recursive_mutex is
used for better safety against deadlocks.
This is needed because we need to access the data buffer from inside the
unfiltering task to unfilter into. We can't block on unfiltering being
done from inside the unfiltering task so we need different accessors
which let us bypass the check on if the unfiltering task is completed.
This is needed because zip_coordinates is called from the unfilter task
itself.
@ypatia ypatia marked this pull request as ready for review December 7, 2024 15:05
@ypatia ypatia closed this Dec 7, 2024
@ypatia ypatia reopened this Dec 7, 2024
@ypatia ypatia marked this pull request as draft December 7, 2024 15:09
@ypatia ypatia marked this pull request as ready for review December 9, 2024 08:32
Base automatically changed from yt/sc-59606/threadpool_with_tasks to dev December 9, 2024 08:36
@ypatia ypatia marked this pull request as draft December 9, 2024 10:06
@ypatia ypatia force-pushed the yt/sc-59605/dont_block_io branch from 73a2245 to 88c0ecb Compare December 18, 2024 09:53
@ypatia ypatia force-pushed the yt/sc-59605/dont_block_io branch from b1d8be7 to d391375 Compare December 18, 2024 15:30
@ypatia ypatia force-pushed the yt/sc-59605/dont_block_io branch from ed9b334 to 446700a Compare December 19, 2024 13:11
@ypatia ypatia changed the title WIP: Improve readers by parallelizing I/O and compute operations Improve readers by parallelizing I/O and compute operations Dec 20, 2024
@ypatia ypatia marked this pull request as ready for review December 20, 2024 07:59
@ypatia ypatia requested review from Shelnutt2 and rroelke December 20, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants