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

Contiguous pages support in Reduce Scatter read/write #12477

Merged
merged 2 commits into from
Sep 13, 2024
Merged

Conversation

avoraTT
Copy link
Contributor

@avoraTT avoraTT commented Sep 10, 2024

Ticket

Problem description

Currently, the read/write chunk functions used in reduce scatter read in pages/tiles one at a time. An optimization is to instead read n contiguous pages until the end of the row, with respect to the dimensions of the shard, tensor slice, and worker slice.

What's changed

The read/write chunk functions have been updated to use the optimized shard tensor addr generators, that return the number of contiguous pages until the end of the shard. Using this, we can now read/write in a contiguous fashion until the end of the row.

Checklist

Copy link
Contributor

@SeanNijjar SeanNijjar left a comment

Choose a reason for hiding this comment

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

Please make sure to run nightly!

@@ -127,24 +127,30 @@ inline void advance_worker_global_page_interleaved (

coord_t const &tensor_shape, // full tensor shape

bool &last_page_of_worker
bool &last_page_of_worker,
const uint32_t stride=1
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this appears to be called only in one place, can we just remove the default value and then also keep last_page_of_worker last? It's a bit of a nitpick but since last_page_of_worker is purely for debug, it'll be nice to keep it separate

@avoraTT avoraTT merged commit 1688b17 into main Sep 13, 2024
6 checks passed
@avoraTT avoraTT deleted the avora/contig_optim branch September 13, 2024 16:17
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