Add allreduce runtime support for nvshmem reduction on-stream api by Tixxx · Pull Request #21973 · openxla/xla · GitHub
Skip to content

Add allreduce runtime support for nvshmem reduction on-stream api#21973

Closed
Tixxx wants to merge 3 commits into
openxla:mainfrom
Tixxx:tixxx/nvshmem_ar
Closed

Add allreduce runtime support for nvshmem reduction on-stream api#21973
Tixxx wants to merge 3 commits into
openxla:mainfrom
Tixxx:tixxx/nvshmem_ar

Conversation

@Tixxx

@Tixxx Tixxx commented Jan 28, 2025

Copy link
Copy Markdown
Contributor

This pr adds runtime support for nvshmem reduction on-stream api.
It adds a new backend config to instruction the emitter to lower to nvshmem with corresponding collective thunks that call nvshmem reduction api.

@google-cla

google-cla Bot commented Jan 28, 2025

Copy link
Copy Markdown

@Tixxx Tixxx force-pushed the tixxx/nvshmem_ar branch 2 times, most recently from 11f965b to 74f118c Compare January 28, 2025 19:15
is_nvshmem_collective = backend_config.backend() == CollectiveBackendConfig::NVSHMEM;
}
return (alias->instruction()->opcode() == HloOpcode::kCustomCall &&
alias->instruction()->custom_call_target() == "mosaic_gpu") || is_nvshmem_collective;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why are mosaic_gpu custom calls in the same category as nvshmem ops?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is from the allocator branch. We use nvshmem allocator for mosaic gpu calls or native nvshmem collectives. I think instead of using mosaic_gpu custom call, the pallas kernel will use a more specific custom call name so this will change after it's changed in the other pr and rebase on that.

@Tixxx Tixxx force-pushed the tixxx/nvshmem_ar branch 4 times, most recently from 36e5e7d to 52701d0 Compare February 8, 2025 00:37
Comment thread xla/service/gpu/runtime/nvshmem_api.cc Outdated
Comment thread xla/pjrt/gpu/nvshmem_gpu_collectives_test.cc
num_elements);
break;
}
case PrimitiveType::F16: {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should F32 also be here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tried to add F32 here and it leads to the deadlock. Apparently this reproduces only with NVSHMEM_TEAM_WORLD, when I'm passing NVSHMEMX_TEAM_NODE everything works fine. Not sure what's the under hood issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried reproing with multihost runner and setting ncshmem api to use world team but for 4 ranks it went through. Do you have a repro that i can run?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I rebased this PR at XLA head (if it would be useful I can share a patch or rebased PR). And I don't see an F32 issue at least using nvcc and compiled with cmake nvshmem. I'll investigate if this is an internal issue.

Comment thread xla/pjrt/gpu/nvshmem_gpu_collectives_test.cc
Comment thread xla/service/gpu/runtime/nvshmem_all_reduce_thunk.cc Outdated
Comment thread xla/service/gpu/runtime/nvshmem_collective_thunk.h Outdated
@PatriosTheGreat PatriosTheGreat added the kokoro:force-run Forces CI to rerun label Mar 3, 2025
@Tixxx Tixxx force-pushed the tixxx/nvshmem_ar branch 5 times, most recently from 51bab9f to 2d5d68e Compare March 11, 2025 15:28
Tixxx added 2 commits April 28, 2025 04:17
Added more fixes on top of base branch, needs one last rebase

consolidate nccl and nvshmem helper functions to avoid clash
@Tixxx Tixxx force-pushed the tixxx/nvshmem_ar branch 2 times, most recently from 688cf31 to 7a29429 Compare April 28, 2025 05:41
@Tixxx Tixxx marked this pull request as ready for review April 28, 2025 05:42
@Tixxx Tixxx requested a review from PatriosTheGreat April 28, 2025 05:42

@PatriosTheGreat PatriosTheGreat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please split this PR to 4 smaller PRs? This would simplify review process and potential rollbacks-relands

The following PRs can be extracted

  1. Nvshmem.symbols changes
  2. Adding nvshmem backend_config property and runtime usage (compile_module_to_llvm_ir.cc/memory assignment changes).
  3. Nvshmem runtime implementation (nvshmem_communicator with all_reduce logic)
  4. GPU emitter NVSHMEM changes (the nvshmem thunks emitting logic)

Comment thread xla/tsl/cuda/nvshmem.symbols
Comment thread xla/service/gpu/gpu_memory_space_assignment.h
Comment thread xla/pjrt/gpu/se_gpu_pjrt_client_test.cc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please implement this similar to how currently nccl all reduce is implemented?
For this nvshmem_communicator should be created similar to nccl_communicator and all collective operations should be implemented there. This should be the only target which depends on nvshmem internal libraries.

copybara-service Bot pushed a commit that referenced this pull request Jun 5, 2025
Imported from GitHub PR #23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from #21973.
Copybara import of the project:

--
08deddb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fe by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f674569 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adb by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d06383 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=#23829 from sfvaroglu:sevin/nvshmem_backend f682e03
PiperOrigin-RevId: 764806040
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jun 5, 2025
Imported from GitHub PR openxla/xla#23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from openxla/xla#21973.
Copybara import of the project:

--
08deddb9283d20fbc1c53bc6f5e19ca32f562154 by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a4f77b3eefe03733dee9ccfd1aabc31f47 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82e0ab2ab2ed78664dbd6cedcb1356e220b by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada179952d9b84a143a6c1d16200eedb96c9 by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fefacb0ddd1810435ea11baa9f09d040a37 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45e1f7d0c7131762ec47f6dce790b60b50f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f6745690b6cbd82f48486ef58b43165d9cb926e1 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a765bb35fb77c762806bf51f36f8031977 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adbb1879407854b7027d484ffdbfcbd5844d by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21539fb2329d080195d613da390abf30a78 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a4daed393221e1aa6deab0b347de57d64e by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebbd98594c2bb9daa791534f12afb55dc62d by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d0638349447c0670fe9abaa507b6706302f597f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03bd790f337ab28c82bf805f1443b38683c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#23829 from sfvaroglu:sevin/nvshmem_backend f682e03bd790f337ab28c82bf805f1443b38683c
PiperOrigin-RevId: 764806040
copybara-service Bot pushed a commit that referenced this pull request Jun 5, 2025
Imported from GitHub PR #23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from #21973.
Copybara import of the project:

--
08deddb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fe by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f674569 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adb by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d06383 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=#23829 from sfvaroglu:sevin/nvshmem_backend f682e03
PiperOrigin-RevId: 764806040
copybara-service Bot pushed a commit that referenced this pull request Jun 5, 2025
Imported from GitHub PR #23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from #21973.
Copybara import of the project:

--
08deddb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fe by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f674569 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adb by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d06383 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51c
PiperOrigin-RevId: 764806040
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jun 5, 2025
Imported from GitHub PR openxla/xla#23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from openxla/xla#21973.
Copybara import of the project:

--
08deddb9283d20fbc1c53bc6f5e19ca32f562154 by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a4f77b3eefe03733dee9ccfd1aabc31f47 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82e0ab2ab2ed78664dbd6cedcb1356e220b by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada179952d9b84a143a6c1d16200eedb96c9 by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fefacb0ddd1810435ea11baa9f09d040a37 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45e1f7d0c7131762ec47f6dce790b60b50f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f6745690b6cbd82f48486ef58b43165d9cb926e1 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a765bb35fb77c762806bf51f36f8031977 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adbb1879407854b7027d484ffdbfcbd5844d by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21539fb2329d080195d613da390abf30a78 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a4daed393221e1aa6deab0b347de57d64e by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebbd98594c2bb9daa791534f12afb55dc62d by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d0638349447c0670fe9abaa507b6706302f597f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03bd790f337ab28c82bf805f1443b38683c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51cf853db44553cbef0710e0791a25af8534 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51cf853db44553cbef0710e0791a25af8534
PiperOrigin-RevId: 764806040
copybara-service Bot pushed a commit that referenced this pull request Jun 5, 2025
Imported from GitHub PR #23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from #21973.
Copybara import of the project:

--
08deddb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fe by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f674569 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adb by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d06383 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51c
PiperOrigin-RevId: 767677333
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jun 5, 2025
Imported from GitHub PR openxla/xla#23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from openxla/xla#21973.
Copybara import of the project:

--
08deddb9283d20fbc1c53bc6f5e19ca32f562154 by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a4f77b3eefe03733dee9ccfd1aabc31f47 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82e0ab2ab2ed78664dbd6cedcb1356e220b by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada179952d9b84a143a6c1d16200eedb96c9 by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fefacb0ddd1810435ea11baa9f09d040a37 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45e1f7d0c7131762ec47f6dce790b60b50f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f6745690b6cbd82f48486ef58b43165d9cb926e1 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a765bb35fb77c762806bf51f36f8031977 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adbb1879407854b7027d484ffdbfcbd5844d by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21539fb2329d080195d613da390abf30a78 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a4daed393221e1aa6deab0b347de57d64e by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebbd98594c2bb9daa791534f12afb55dc62d by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d0638349447c0670fe9abaa507b6706302f597f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03bd790f337ab28c82bf805f1443b38683c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51cf853db44553cbef0710e0791a25af8534 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51cf853db44553cbef0710e0791a25af8534
PiperOrigin-RevId: 767677333
copybara-service Bot pushed a commit that referenced this pull request Jun 5, 2025
Imported from GitHub PR #23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from #21973.
Copybara import of the project:

--
08deddb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fe by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f674569 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adb by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d06383 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51c
PiperOrigin-RevId: 767677333
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jun 5, 2025
Imported from GitHub PR openxla/xla#23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from openxla/xla#21973.
Copybara import of the project:

--
08deddb9283d20fbc1c53bc6f5e19ca32f562154 by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a4f77b3eefe03733dee9ccfd1aabc31f47 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82e0ab2ab2ed78664dbd6cedcb1356e220b by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada179952d9b84a143a6c1d16200eedb96c9 by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fefacb0ddd1810435ea11baa9f09d040a37 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45e1f7d0c7131762ec47f6dce790b60b50f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f6745690b6cbd82f48486ef58b43165d9cb926e1 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a765bb35fb77c762806bf51f36f8031977 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adbb1879407854b7027d484ffdbfcbd5844d by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21539fb2329d080195d613da390abf30a78 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a4daed393221e1aa6deab0b347de57d64e by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebbd98594c2bb9daa791534f12afb55dc62d by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d0638349447c0670fe9abaa507b6706302f597f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03bd790f337ab28c82bf805f1443b38683c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51cf853db44553cbef0710e0791a25af8534 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51cf853db44553cbef0710e0791a25af8534
PiperOrigin-RevId: 767677333
copybara-service Bot pushed a commit that referenced this pull request Jun 6, 2025
Imported from GitHub PR #23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from #21973.
Copybara import of the project:

--
08deddb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fe by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f674569 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adb by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d06383 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51c
PiperOrigin-RevId: 764806040
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jun 6, 2025
Imported from GitHub PR openxla/xla#23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from openxla/xla#21973.
Copybara import of the project:

--
08deddb9283d20fbc1c53bc6f5e19ca32f562154 by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a4f77b3eefe03733dee9ccfd1aabc31f47 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82e0ab2ab2ed78664dbd6cedcb1356e220b by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada179952d9b84a143a6c1d16200eedb96c9 by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fefacb0ddd1810435ea11baa9f09d040a37 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45e1f7d0c7131762ec47f6dce790b60b50f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f6745690b6cbd82f48486ef58b43165d9cb926e1 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a765bb35fb77c762806bf51f36f8031977 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adbb1879407854b7027d484ffdbfcbd5844d by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21539fb2329d080195d613da390abf30a78 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a4daed393221e1aa6deab0b347de57d64e by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebbd98594c2bb9daa791534f12afb55dc62d by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d0638349447c0670fe9abaa507b6706302f597f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03bd790f337ab28c82bf805f1443b38683c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51cf853db44553cbef0710e0791a25af8534 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51cf853db44553cbef0710e0791a25af8534
PiperOrigin-RevId: 764806040
copybara-service Bot pushed a commit that referenced this pull request Jun 6, 2025
Imported from GitHub PR #23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from #21973.
Copybara import of the project:

--
08deddb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fe by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f674569 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adb by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d06383 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51c
PiperOrigin-RevId: 764806040
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jun 6, 2025
Imported from GitHub PR openxla/xla#23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from openxla/xla#21973.
Copybara import of the project:

--
08deddb9283d20fbc1c53bc6f5e19ca32f562154 by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a4f77b3eefe03733dee9ccfd1aabc31f47 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82e0ab2ab2ed78664dbd6cedcb1356e220b by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada179952d9b84a143a6c1d16200eedb96c9 by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fefacb0ddd1810435ea11baa9f09d040a37 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45e1f7d0c7131762ec47f6dce790b60b50f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f6745690b6cbd82f48486ef58b43165d9cb926e1 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a765bb35fb77c762806bf51f36f8031977 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adbb1879407854b7027d484ffdbfcbd5844d by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21539fb2329d080195d613da390abf30a78 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a4daed393221e1aa6deab0b347de57d64e by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebbd98594c2bb9daa791534f12afb55dc62d by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d0638349447c0670fe9abaa507b6706302f597f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03bd790f337ab28c82bf805f1443b38683c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51cf853db44553cbef0710e0791a25af8534 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51cf853db44553cbef0710e0791a25af8534
PiperOrigin-RevId: 764806040
copybara-service Bot pushed a commit that referenced this pull request Jun 6, 2025
Imported from GitHub PR #23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from #21973.
Copybara import of the project:

--
08deddb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fe by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f674569 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adb by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d06383 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51c
PiperOrigin-RevId: 764806040
copybara-service Bot pushed a commit that referenced this pull request Jun 6, 2025
Imported from GitHub PR #23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from #21973.
Copybara import of the project:

--
08deddb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fe by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f674569 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adb by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d06383 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51c
PiperOrigin-RevId: 767677333
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jun 6, 2025
Imported from GitHub PR openxla/xla#23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from openxla/xla#21973.
Copybara import of the project:

--
08deddb9283d20fbc1c53bc6f5e19ca32f562154 by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a4f77b3eefe03733dee9ccfd1aabc31f47 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82e0ab2ab2ed78664dbd6cedcb1356e220b by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada179952d9b84a143a6c1d16200eedb96c9 by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fefacb0ddd1810435ea11baa9f09d040a37 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45e1f7d0c7131762ec47f6dce790b60b50f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f6745690b6cbd82f48486ef58b43165d9cb926e1 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a765bb35fb77c762806bf51f36f8031977 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adbb1879407854b7027d484ffdbfcbd5844d by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21539fb2329d080195d613da390abf30a78 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a4daed393221e1aa6deab0b347de57d64e by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebbd98594c2bb9daa791534f12afb55dc62d by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d0638349447c0670fe9abaa507b6706302f597f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03bd790f337ab28c82bf805f1443b38683c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51cf853db44553cbef0710e0791a25af8534 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51cf853db44553cbef0710e0791a25af8534
PiperOrigin-RevId: 767677333
copybara-service Bot pushed a commit that referenced this pull request Jun 6, 2025
Imported from GitHub PR #23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from #21973.
Copybara import of the project:

--
08deddb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fe by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f674569 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adb by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d06383 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

COPYBARA_INTEGRATE_REVIEW=#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51c
PiperOrigin-RevId: 767968999
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jun 6, 2025
Imported from GitHub PR openxla/xla#23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from openxla/xla#21973.
Copybara import of the project:

--
08deddb9283d20fbc1c53bc6f5e19ca32f562154 by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a4f77b3eefe03733dee9ccfd1aabc31f47 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82e0ab2ab2ed78664dbd6cedcb1356e220b by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada179952d9b84a143a6c1d16200eedb96c9 by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fefacb0ddd1810435ea11baa9f09d040a37 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45e1f7d0c7131762ec47f6dce790b60b50f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f6745690b6cbd82f48486ef58b43165d9cb926e1 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a765bb35fb77c762806bf51f36f8031977 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adbb1879407854b7027d484ffdbfcbd5844d by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21539fb2329d080195d613da390abf30a78 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a4daed393221e1aa6deab0b347de57d64e by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebbd98594c2bb9daa791534f12afb55dc62d by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d0638349447c0670fe9abaa507b6706302f597f by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03bd790f337ab28c82bf805f1443b38683c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51cf853db44553cbef0710e0791a25af8534 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes #23829

PiperOrigin-RevId: 767968999
charleshofer pushed a commit to ROCm/xla that referenced this pull request Jun 24, 2025
…NCCL

Imported from GitHub PR openxla#23829

This PR adds `CollectiveBackendAssigner` pass, which assigns either NVSHMEM or NCCL as the backend for collective operations based on:
1. Communication pattern (intranode vs internode)
2. Message size (compared against threshold_in_bytes)

Also, there is some utility code taken from openxla#21973.
Copybara import of the project:

--
08deddb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CollectiveBackendAssigner pass for NVSHMEM vs. NCCL

--
d505d8a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
8341b82 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove NvshmemCollectives-based device/process logic

--
5f2aada by Sevin Varoglu <svaroglu@nvidia.com>:

Mark gpu_compiler.cc as cuda-only

--
6b7e6fe by Sevin Varoglu <svaroglu@nvidia.com>:

Remove cuda-only

--
69bdb45 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove nvshmem_collectives from CollectiveBackendAssigner

--
f674569 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove unnecessary params

--
7cb298a by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
5c39adb by Sevin Varoglu <svaroglu@nvidia.com>:

Add tags

--
d31af21 by Sevin Varoglu <svaroglu@nvidia.com>:

Incorporate review feedback

--
1448d6a by Sevin Varoglu <svaroglu@nvidia.com>:

Add unit tests

--
1f4bebb by Sevin Varoglu <svaroglu@nvidia.com>:

Add CM cases to collective_ops_utils_test.cc

--
5d06383 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove e2e test

--
f682e03 by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla_test

--
ae7b51c by Sevin Varoglu <svaroglu@nvidia.com>:

Remove xla/pjrt/gpu:gpu_topology

Merging this change closes openxla#23829

COPYBARA_INTEGRATE_REVIEW=openxla#23829 from sfvaroglu:sevin/nvshmem_backend ae7b51c
PiperOrigin-RevId: 767968999
copybara-service Bot pushed a commit that referenced this pull request Jul 14, 2025
Imported from GitHub PR #25914

Split from this [pr](#21973)
3: Add nvshmem runtime thunks
4. communicator changes have been moved to this(#26255)
5. Base nvshmem thunk has been moved to (#26568).
Copybara import of the project:

--
e1121d1 by TJ Xu <tjx@nvidia.com>:

Add nvshmem communicator and runtime thunks
added thunk lowering and e2e test

--
18a4624 by TJ Xu <tjx@nvidia.com>:

Addressed comments and remove duplicate methond in nvshmem ar thunk

--
7f0c590 by TJ Xu <tjx@nvidia.com>:

Rebase on the communicator and base thunk pr

--
d5ba27a by TJ Xu <tjx@nvidia.com>:

add barrier at the end of executable execution to avoid clashing with nccl init

Merging this change closes #25914

FUTURE_COPYBARA_INTEGRATE_REVIEW=#25914 from Tixxx:tixxx/nvshmem_ar_thunk d5ba27a
PiperOrigin-RevId: 782801128
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jul 14, 2025
Imported from GitHub PR openxla/xla#25914

Split from this [pr](openxla/xla#21973)
3: Add nvshmem runtime thunks
4. communicator changes have been moved to this(openxla/xla#26255)
5. Base nvshmem thunk has been moved to (openxla/xla#26568).
Copybara import of the project:

--
e1121d162de8b6b09a1d44af54f88fc75a0a08ae by TJ Xu <tjx@nvidia.com>:

Add nvshmem communicator and runtime thunks
added thunk lowering and e2e test

--
18a4624c80a0a2a53fbfc2ced72ec725bb52a28d by TJ Xu <tjx@nvidia.com>:

Addressed comments and remove duplicate methond in nvshmem ar thunk

--
7f0c5905c972e1157afae4e7429e43961af1d4d6 by TJ Xu <tjx@nvidia.com>:

Rebase on the communicator and base thunk pr

--
d5ba27abdc1c721b6f1e3c1b664dd07c8dce1887 by TJ Xu <tjx@nvidia.com>:

add barrier at the end of executable execution to avoid clashing with nccl init

Merging this change closes #25914

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#25914 from Tixxx:tixxx/nvshmem_ar_thunk d5ba27abdc1c721b6f1e3c1b664dd07c8dce1887
PiperOrigin-RevId: 782801128
copybara-service Bot pushed a commit that referenced this pull request Jul 14, 2025
Imported from GitHub PR #25914

Split from this [pr](#21973)
3: Add nvshmem runtime thunks
4. communicator changes have been moved to this(#26255)
5. Base nvshmem thunk has been moved to (#26568).
Copybara import of the project:

--
e1121d1 by TJ Xu <tjx@nvidia.com>:

Add nvshmem communicator and runtime thunks
added thunk lowering and e2e test

--
18a4624 by TJ Xu <tjx@nvidia.com>:

Addressed comments and remove duplicate methond in nvshmem ar thunk

--
7f0c590 by TJ Xu <tjx@nvidia.com>:

Rebase on the communicator and base thunk pr

--
d5ba27a by TJ Xu <tjx@nvidia.com>:

add barrier at the end of executable execution to avoid clashing with nccl init

Merging this change closes #25914

FUTURE_COPYBARA_INTEGRATE_REVIEW=#25914 from Tixxx:tixxx/nvshmem_ar_thunk d5ba27a
PiperOrigin-RevId: 782811158
copybara-service Bot pushed a commit to tensorflow/tensorflow that referenced this pull request Jul 14, 2025
Imported from GitHub PR openxla/xla#25914

Split from this [pr](openxla/xla#21973)
3: Add nvshmem runtime thunks
4. communicator changes have been moved to this(openxla/xla#26255)
5. Base nvshmem thunk has been moved to (openxla/xla#26568).
Copybara import of the project:

--
e1121d162de8b6b09a1d44af54f88fc75a0a08ae by TJ Xu <tjx@nvidia.com>:

Add nvshmem communicator and runtime thunks
added thunk lowering and e2e test

--
18a4624c80a0a2a53fbfc2ced72ec725bb52a28d by TJ Xu <tjx@nvidia.com>:

Addressed comments and remove duplicate methond in nvshmem ar thunk

--
7f0c5905c972e1157afae4e7429e43961af1d4d6 by TJ Xu <tjx@nvidia.com>:

Rebase on the communicator and base thunk pr

--
d5ba27abdc1c721b6f1e3c1b664dd07c8dce1887 by TJ Xu <tjx@nvidia.com>:

add barrier at the end of executable execution to avoid clashing with nccl init

Merging this change closes #25914

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#25914 from Tixxx:tixxx/nvshmem_ar_thunk d5ba27abdc1c721b6f1e3c1b664dd07c8dce1887
PiperOrigin-RevId: 782811158
copybara-service Bot pushed a commit that referenced this pull request Jul 14, 2025
Imported from GitHub PR #25914

Split from this [pr](#21973)
3: Add nvshmem runtime thunks
4. communicator changes have been moved to this(#26255)
5. Base nvshmem thunk has been moved to (#26568).
Copybara import of the project:

--
e1121d1 by TJ Xu <tjx@nvidia.com>:

Add nvshmem communicator and runtime thunks
added thunk lowering and e2e test

--
18a4624 by TJ Xu <tjx@nvidia.com>:

Addressed comments and remove duplicate methond in nvshmem ar thunk

--
7f0c590 by TJ Xu <tjx@nvidia.com>:

Rebase on the communicator and base thunk pr

--
d5ba27a by TJ Xu <tjx@nvidia.com>:

add barrier at the end of executable execution to avoid clashing with nccl init

Merging this change closes #25914

FUTURE_COPYBARA_INTEGRATE_REVIEW=#25914 from Tixxx:tixxx/nvshmem_ar_thunk d5ba27a
PiperOrigin-RevId: 782811158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kokoro:force-run Forces CI to rerun

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants