-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add interpreter for AllGatherOp #1727
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghpvnist
added
Interpreter
Migrate to MHLO
PR that needs to be migrated to MLIR-HLO
labels
Aug 9, 2023
ghpvnist
force-pushed
the
all_gather
branch
5 times, most recently
from
August 12, 2023 07:05
94fc83c
to
16e0cec
Compare
burmako
suggested changes
Aug 18, 2023
burmako
approved these changes
Aug 18, 2023
penagos
pushed a commit
to penagos/stablehlo
that referenced
this pull request
Sep 21, 2023
We have the following constraints in the spec: ``` (I1) `operand`: tensor or per-tensor quantized tensor. (I2) `all_gather_dim`: constant of type `si64`. (I3) `replica_groups`: 2-dimensional tensor constant of type `si64`. (I4) `channel_id`: constant of type `si64`. (I5) `use_global_device_ids`: constant of type `i1`. (C1) `0 <= all_gather_dim < rank(operand)`. (C2) `is_unique(replica_groups)`. (C3) `size(replica_groups)` is defined as: * `num_replicas` if `cross_replica` is used. * `num_replicas` if `cross_replica_and_partition` is used. * `num_processes` if `flattened_ids` is used. (C4) `0 <= replica_groups < size(replica_groups)`. (C5) If `use_global_device_ids = true`, then `channel_id > 0`. (C6) `type(result) = type(operand)` except: * `dim(result, all_gather_dim) = dim(operand, all_gather_dim) * dim(process_groups, 1)`. ``` These constraints will be comprehensively covered by the following tests: ``` I1: a) `operand` is not a tensor. (Covered by ODS). I2: a) `all_gather_dim` is not a constant of type `si64`. (Covered by ODS). I3: a) `replica_groups` is not a 2-dimensional tensor constant. I3: b) `element_type(replica_groups) != si64`. (Covered by ODS). I4: a) `channel_id` is not a constant of type `si64`. (Covered by ODS). I5: a) `use_global_device_ids` is not a constant of type `i1`. (Covered by ODS). C1: a) `all_gather_dim < 0`. C1: b) `all_gather_dim >= rank(operand)`. C2: a) `is_unique(replica_groups) = false`. C3: a) `size(replica_groups)` is defined as: * `num_replicas` if `cross_replica` is used. * `num_replicas` if `cross_replica_and_partition` is used. * `num_processes` if `flattened_ids` is used. C4: a) `replica_groups < 0`. C4: b) `replica_groups >= size(replica_groups)`. C5: a) `use_global_device_ids = true` and `channel_id <= 0`. C6: a) `type(result) != type(operand)` except: * `dim(result, all_gather_dim) = dim(operand, all_gather_dim) * dim(process_groups, 1)`. ``` If we drop the "Covered by ODS" pieces, this will leave us with the following test cases: ``` I3: a) `replica_groups` is not a 2-dimensional tensor constant. C1: a) `all_gather_dim < 0`. C1: b) `all_gather_dim >= rank(operand)`. C2: a) `is_unique(replica_groups) = false`. C3: a) `size(replica_groups)` is defined as: * `num_replicas` if `cross_replica` is used. * `num_replicas` if `cross_replica_and_partition` is used. * `num_processes` if `flattened_ids` is used. C4: a) `replica_groups < 0`. C4: b) `replica_groups >= size(replica_groups)`. C5: a) `use_global_device_ids = true` and `channel_id <= 0`. C6: a) `type(result) != type(operand)` except: * `dim(result, all_gather_dim) = dim(operand, all_gather_dim) * dim(process_groups, 1)`. ``` Notes: * C3a verification is infeasible since `num_replicas` and `num_partitions` are not known statically. * C4b verification is infeasible since `size(replica_groups)` is not known statically. closes openxla#1118
penagos
pushed a commit
to penagos/stablehlo
that referenced
this pull request
Sep 21, 2023
We have the following constraints in the spec: ``` (I1) `operand`: tensor or per-tensor quantized tensor. (I2) `all_gather_dim`: constant of type `si64`. (I3) `replica_groups`: 2-dimensional tensor constant of type `si64`. (I4) `channel_id`: constant of type `si64`. (I5) `use_global_device_ids`: constant of type `i1`. (C1) `0 <= all_gather_dim < rank(operand)`. (C2) `is_unique(replica_groups)`. (C3) `size(replica_groups)` is defined as: * `num_replicas` if `cross_replica` is used. * `num_replicas` if `cross_replica_and_partition` is used. * `num_processes` if `flattened_ids` is used. (C4) `0 <= replica_groups < size(replica_groups)`. (C5) If `use_global_device_ids = true`, then `channel_id > 0`. (C6) `type(result) = type(operand)` except: * `dim(result, all_gather_dim) = dim(operand, all_gather_dim) * dim(process_groups, 1)`. ``` These constraints will be comprehensively covered by the following tests: ``` I1: a) `operand` is not a tensor. (Covered by ODS). I2: a) `all_gather_dim` is not a constant of type `si64`. (Covered by ODS). I3: a) `replica_groups` is not a 2-dimensional tensor constant. I3: b) `element_type(replica_groups) != si64`. (Covered by ODS). I4: a) `channel_id` is not a constant of type `si64`. (Covered by ODS). I5: a) `use_global_device_ids` is not a constant of type `i1`. (Covered by ODS). C1: a) `all_gather_dim < 0`. C1: b) `all_gather_dim >= rank(operand)`. C2: a) `is_unique(replica_groups) = false`. C3: a) `size(replica_groups)` is defined as: * `num_replicas` if `cross_replica` is used. * `num_replicas` if `cross_replica_and_partition` is used. * `num_processes` if `flattened_ids` is used. C4: a) `replica_groups < 0`. C4: b) `replica_groups >= size(replica_groups)`. C5: a) `use_global_device_ids = true` and `channel_id <= 0`. C6: a) `type(result) != type(operand)` except: * `dim(result, all_gather_dim) = dim(operand, all_gather_dim) * dim(process_groups, 1)`. ``` If we drop the "Covered by ODS" pieces, this will leave us with the following test cases: ``` I3: a) `replica_groups` is not a 2-dimensional tensor constant. C1: a) `all_gather_dim < 0`. C1: b) `all_gather_dim >= rank(operand)`. C2: a) `is_unique(replica_groups) = false`. C3: a) `size(replica_groups)` is defined as: * `num_replicas` if `cross_replica` is used. * `num_replicas` if `cross_replica_and_partition` is used. * `num_processes` if `flattened_ids` is used. C4: a) `replica_groups < 0`. C4: b) `replica_groups >= size(replica_groups)`. C5: a) `use_global_device_ids = true` and `channel_id <= 0`. C6: a) `type(result) != type(operand)` except: * `dim(result, all_gather_dim) = dim(operand, all_gather_dim) * dim(process_groups, 1)`. ``` Notes: * C3a verification is infeasible since `num_replicas` and `num_partitions` are not known statically. * C4b verification is infeasible since `size(replica_groups)` is not known statically. closes openxla#1118
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have the following constraints in the spec:
These constraints will be comprehensively covered by the following tests:
If we drop the "Covered by ODS" pieces, this will leave us with the following test cases:
Notes:
num_replicas
andnum_partitions
are not known statically.size(replica_groups)
is not known statically.closes #1118