rccl_communicator.cc
imports tsl/platform/casts.himports xla/tsl/platform/env.h
SHA-256a00ccad8328d2fb21c597b4d63a569afe98be20fb429adbf39d2566453e112e0
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/collectives/rccl_communicator.h"
17
18#include <atomic>
19#include <cstddef>
20#include <cstdint>
21#include <memory>
22#include <optional>
23#include <string>
24#include <utility>
25#include <vector>
26
27#include "absl/base/casts.h"
28#include "absl/container/inlined_vector.h"
29#include "absl/functional/any_invocable.h"
30#include "absl/memory/memory.h"
31#include "absl/status/status.h"
32#include "absl/strings/str_cat.h"
33#include "absl/strings/str_format.h"
34#include "absl/strings/str_join.h"
35#include "absl/synchronization/mutex.h"
36#include "absl/types/span.h"
37#include "rocm/include/hip/hip_runtime.h"
38#include "rocm/rocm_config.h" // IWYU pragma: keep
39#include "xla/backends/gpu/collectives/cancellation_token.h"
40#include "xla/backends/gpu/collectives/gpu_collectives.h"
41#include "xla/backends/gpu/collectives/gpu_communicator.h"
42#include "xla/backends/gpu/collectives/rccl_errors.h"
43#include "xla/backends/gpu/collectives/single_threaded_executor.h"
44#include "xla/core/collectives/communicator.h"
45#include "xla/core/collectives/rank_id.h"
46#include "xla/core/collectives/reduction_kind.h"
47#include "xla/future.h"
48#include "xla/primitive_util.h"
49#include "xla/stream_executor/device_address.h"
50#include "xla/stream_executor/stream.h"
51#include "xla/stream_executor/stream_executor.h"
52#include "xla/tsl/concurrency/executor.h"
53#include "xla/tsl/platform/env.h"
54#include "xla/tsl/platform/errors.h"
55#include "xla/tsl/platform/logging.h"
56#include "xla/tsl/platform/statusor.h"
57#include "xla/util.h"
58#include "tsl/platform/casts.h"
131:67… Name(dtype)));
132 }
133 // For collectives that just move data around, we can use ncclFloat16 for
134 // 16-bit integer data types.
135 ret …