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

[SPMD] use UNKNOWN as default sharded data sharding type only for auto-sharding #6846

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

yeounoh
Copy link
Contributor

@yeounoh yeounoh commented Mar 28, 2024

Using UNKNOWN as default sharded data sharding type degraded SPMD inference performance. I added a comment to do a follow-up investigation, to see if we can completely move to Unknown for non-auto-sharding route as well.

Test plan:

  • llama2 inference performance check
  • auto-sharding llama2 & gemma checks

@yeounoh yeounoh self-assigned this Mar 28, 2024
@yeounoh yeounoh added the DO_NOT_MERGE_YET For PRs which cannot be merged, despite tests passing label Mar 28, 2024
@yeounoh yeounoh changed the title [SPMD] use UNKNOWN for implicitly replicated only for auto-sharding [SPMD] use UNKNOWN as default sharded data sharding type only for auto-sharding Mar 28, 2024
@yeounoh yeounoh force-pushed the spmd_inference_perf_regression branch 3 times, most recently from 938ced4 to 251d285 Compare March 28, 2024 21:59
@yeounoh yeounoh requested a review from JackCaoG March 28, 2024 22:22
@wonjoolee95
Copy link
Collaborator

wonjoolee95 commented Mar 28, 2024

I can confirm that with this PR, the LLaMa 2 inference numbers are back to pre-regression levels, cc @yeounoh

Comment on lines +252 to +255
ShardingSpecPtr current_sharding = sharding_spec();
if (!current_sharding || overwrite ||
current_sharding->sharding.type() == xla::OpSharding::REPLICATED ||
current_sharding->sharding.type() == xla::OpSharding::UNKNOWN) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is just a clean up right? I don't see any functionality change but want to double check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a clean-up

@yeounoh yeounoh force-pushed the spmd_inference_perf_regression branch from 251d285 to da66da3 Compare March 28, 2024 23:42
@yeounoh yeounoh removed the DO_NOT_MERGE_YET For PRs which cannot be merged, despite tests passing label Mar 29, 2024
@yeounoh yeounoh merged commit c1db875 into master Mar 29, 2024
18 checks passed
yeounoh added a commit that referenced this pull request Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants