Skip to content

Conversation

@rpsilva-aws
Copy link
Collaborator

Currently, the existing parameter mapping for the lowering context is not well suited for SPMD. In case of large models, it will cause a large synchronous bottleneck when transferring all device data to the host. This is caused by each ReplicateShardedData computation that gathers and reassembles each sharded data across multiple devices. This is by design, since it is expected to collect all parameters regardless of their allocation.

In this PR, we introduce a new mapping that does not invoke the sharded replication, but instead uses references to the device data. This is generally sufficient and preferred in most cases, where the user only wants to access the validate parameters (those that are not returned as -1 from tensor_parameter_id, as 'fake' parameters).

@rpsilva-aws rpsilva-aws marked this pull request as ready for review December 4, 2024 21:42
@rpsilva-aws
Copy link
Collaborator Author

Note: Conflicts with #8418. Will handle rebase order based on merge timing.

@rpsilva-aws
Copy link
Collaborator Author

@miladm miladm requested review from bhavya01 and tengyifei December 5, 2024 00:04
Copy link
Collaborator

@tengyifei tengyifei left a comment

Choose a reason for hiding this comment

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

Nice!

@tengyifei tengyifei added the tpuci label Dec 5, 2024
@tengyifei tengyifei self-requested a review December 5, 2024 23:14
@rpsilva-aws
Copy link
Collaborator Author

Replacing with #8460 to fix the merge commit, wrong local branch.

@rpsilva-aws rpsilva-aws closed this Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants