Skip to content

[PJRT] Don't use futures on ExecuteSharded output buffers - #4503

Merged
will-cromar merged 1 commit into
masterfrom
wcromar/buffer-future-regression
Jan 25, 2023
Merged

will-cromar merged 1 commit into
masterfrom
wcromar/buffer-future-regression

Conversation

@will-cromar

Copy link
Copy Markdown
Collaborator

Setting callbacks on each output buffer (see #4400) led to a significant performance regression on both TPU v3 and TPU v4. Remove those callbacks entirely.

Instead, only use the returned_future of ExecuteSharded when not using PJRT C API. This means the ExecuteTime metric will be broken with the PJRT C API until our next pin update, when we can remove this condition.

Tested with both PJRT_DEVICE=TPU and PJRT_DEVICE=TPU_C_API. Both get performance similar to before #4400.

@will-cromar
will-cromar requested a review from JackCaoG January 24, 2023 23:47
@will-cromar
will-cromar force-pushed the wcromar/buffer-future-regression branch from dcdfd7b to c1572e8 Compare January 25, 2023 05:12

@JackCaoG JackCaoG left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@will-cromar
will-cromar merged commit b5d6be8 into master Jan 25, 2023
ManfeiBai pushed a commit that referenced this pull request Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants