Skip to content

Conversation

@copybara-service
Copy link

Count a tensor as source of factor axes candidate if the factor sharding of the tensor is a strict prefix of the candidate axes because dynamic-slice is free.

In addition to that a tensor is already counted as source of factor axes candidate if the factor sharding of the tensor is a (not necessarily strict) prefix of the candidate axes.

For example; Given [i//{x}] + [i//{x, y}] = [i//{x, y, z}], FactorAxesCandidate (i// {x,y}) has the following sources:
BEFORE: LHS, RHS
AFTER: LHS, RHS, RESULT

Given [i][k//{x}] @ [k][j//{x}] = [i//{x}][j],
BEFORE:

  • FactorAxesCandidate (i//{x}) has the following sources: RESULT
  • FactorAxesCandidate (j//{x}) has the following sources: RHS
  • FactorAxesCandidate (k//{x}) has the following sources: LHS
    AFTER:
  • FactorAxesCandidate (i//{x}) has the following sources: LHS, RESULT
  • FactorAxesCandidate (j//{x}) has the following sources: RHS, RESULT
  • FactorAxesCandidate (k//{x}) has the following sources: LHS, RHS
    It implies that the largest factor, in this particular case, wins {x}.

…ing of the tensor is a strict prefix of the candidate axes because dynamic-slice is free.

In addition to that a tensor is already counted as source of factor axes candidate if the factor sharding of the tensor is a (not necessarily strict) prefix of the candidate axes.

For example; Given [i//{x}] + [i//{x, y}] = [i//{x, y, z}], FactorAxesCandidate (i// {x,y}) has the following sources:
BEFORE: LHS, RHS
AFTER:  LHS, RHS, RESULT

Given [i][k//{x}] @ [k][j//{x}] = [i//{x}][j],
BEFORE:
- FactorAxesCandidate (i//{x}) has the following sources: RESULT
- FactorAxesCandidate (j//{x}) has the following sources: RHS
- FactorAxesCandidate (k//{x}) has the following sources: LHS
AFTER:
- FactorAxesCandidate (i//{x}) has the following sources: LHS, RESULT
- FactorAxesCandidate (j//{x}) has the following sources: RHS, RESULT
- FactorAxesCandidate (k//{x}) has the following sources: LHS, RHS
It implies that the largest factor, in this particular case, wins {x}.
PiperOrigin-RevId: 832648176
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.

1 participant