这是indexloc提供的服务,不要输入任何密码
Skip to content

Introduce AllGatherDynamicSliceShuffledOffsetSimplifier, a new HLO pass that collapse dynamic-slice(all-gather) with shuffled offset into collective-permute. #97287

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

Merged
merged 1 commit into from
Jul 22, 2025

Conversation

copybara-service[bot]
Copy link

Introduce AllGatherDynamicSliceShuffledOffsetSimplifier, a new HLO pass that collapse dynamic-slice(all-gather) with shuffled offset into collective-permute.

The simplifier targets a specific pattern:

  • All-gather flattened-id Mode: The all-gather must use use_global_device_ids=true.
  • Partitioning: The pass is designed for SPMD models with num_partitions > 1 and num_replicas = 1. The slice offset is indexed by partition-id().
  • Sharding and Slicing on same dimension:: The dynamic-slice must also slice along that same dimension, matching the all-gather operand's dimension size.
  • Offset Traversal Calculation: The pass can trace the offset lookup through bitcast, reshape, copy, and convert instructions.

@copybara-service copybara-service bot force-pushed the exported_pr_782916446 branch 5 times, most recently from 2cd582c to 5e9658e Compare July 22, 2025 00:07
…pass that collapse dynamic-slice(all-gather) with shuffled offset into collective-permute.

The simplifier targets a specific pattern:
*   **All-gather flattened-id Mode:** The `all-gather` must use `use_global_device_ids=true`.
*   **Partitioning:** The pass is designed for SPMD models with `num_partitions > 1` and `num_replicas = 1`. The slice offset is indexed by `partition-id()`.
*   **Sharding and Slicing on same dimension:**: The `dynamic-slice` must also slice along that same dimension, matching the `all-gather` operand's dimension size.
*   **Offset Traversal Calculation:** The pass can trace the offset lookup through `bitcast`, `reshape`, `copy`, and `convert` instructions.

PiperOrigin-RevId: 785634123
@copybara-service copybara-service bot force-pushed the exported_pr_782916446 branch from 5e9658e to 31b031c Compare July 22, 2025 00:35
@copybara-service copybara-service bot merged commit 31b031c into master Jul 22, 2025
@copybara-service copybara-service bot deleted the exported_pr_782916446 branch July 22, 2025 00:35
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