ragged_all_to_all_thunk.cc
imports tsl/platform/casts.himports xla/tsl/platform/errors.h
SHA-256b2559eae18968f8620dd3c986cd55e9da20ea0e45280e4896d63dd31dde452a6
MaleculeMd(In₄)
Evidence
1/* Copyright 2024 The OpenXLA Authors.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is …
11:42… IND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#include "xla/backends/gpu/runtime/ragged_all_to_all_thunk.h"
17
18#include <cstdint>
19#include <memory>
20#include <optional>
21#include <string>
22#include <utility>
23#include <vector>
24
25#include "absl/algorithm/container.h"
26#include "absl/container/flat_hash_map.h"
27#include "absl/container/inlined_vector.h"
28#include "absl/container/node_hash_map.h"
29#include "absl/log/check.h"
30#include "absl/log/log.h"
31#include "absl/status/status.h"
32#include "absl/strings/str_format.h"
33#include "absl/strings/string_view.h"
34#include "absl/strings/substitute.h"
35#include "absl/synchronization/mutex.h"
36#include "absl/types/span.h"
37#include "xla/backends/gpu/collectives/gpu_clique_key.h"
38#include "xla/backends/gpu/collectives/gpu_collectives.h"
39#include "xla/backends/gpu/collectives/gpu_communicator.h"
40#include "xla/backends/gpu/runtime/collective_kernel_api.h"
41#include "xla/backends/gpu/runtime/collective_thunk.h"
42#include "xla/backends/gpu/runtime/ragged_all_to_all.h"
43#include "xla/backends/gpu/runtime/thunk.h"
44#include "xla/backends/gpu/transforms/collectives/collective_ops_utils.h"
45#include "xla/core/collectives/communicator.h"
46#include "xla/core/collectives/rank_id.h"
47#include "xla/future.h"
48#include "xla/hlo/ir/hlo_instruction.h"
49#include "xla/hlo/ir/hlo_instructions.h"
50#include "xla/service/buffer_assignment.h"
51#include "xla/service/rendezvous.h"
52#include "xla/shape.h"
53#include "xla/shape_util.h"
54#include "xla/status_macros.h"
55#include "xla/stream_executor/device_address.h"
56#include "xla/stream_executor/device_address_handle.h"
57#include "xla/stream_executor/event.h"
58#include "xla/stream_executor/gpu/multi_gpu_barrier_kernel.h"
111:12… sl::OkStatus();
112}
113
114// Runs AllToAll on a buffer that contains ragged tensor metadata.
115absl::Status RunAllToAllOnIndexBuffer(
116 const se::DeviceAdd …
149:19… ents into the stream to ensure that all devices have reached
150// the start event before the kernel starts.
151absl::StatusOr<std::shared_ptr<std::vector …