command_buffer_conversion_pass.cc
imports tsl/platform/platform.himports xla/ffi/ffi_registry.h
SHA-2561818f83be1c7b5515dfd50dda260e8e415457c86580ca9478fc1f5761da84141
MaleculeH(Db)Md(In₄)
Evidence
1/* Copyright 2025 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/command_buffer_conversion_pass.h"
17
18#include <algorithm>
19#include <cassert>
20#include <cstddef>
21#include <cstdint>
22#include <iterator>
23#include <memory>
24#include <optional>
25#include <string>
26#include <utility>
27#include <vector>
28
29#include "absl/algorithm/container.h"
30#include "absl/base/nullability.h"
31#include "absl/container/flat_hash_set.h"
32#include "absl/log/log.h"
33#include "absl/status/status.h"
34#include "absl/status/statusor.h"
35#include "absl/strings/str_cat.h"
36#include "absl/strings/str_join.h"
37#include "absl/types/span.h"
38#include "xla/backends/gpu/runtime/command_buffer_cmd_emitter.h"
39#include "xla/backends/gpu/runtime/command_buffer_thunk.h"
40#include "xla/backends/gpu/runtime/command_executor.h"
41#include "xla/backends/gpu/runtime/conditional_thunk.h"
42#include "xla/backends/gpu/runtime/custom_call_thunk.h"
43#include "xla/backends/gpu/runtime/device_to_device_copy_thunk.h"
44#include "xla/backends/gpu/runtime/dynamic_memcpy_thunk.h"
45#include "xla/backends/gpu/runtime/ragged_all_to_all_thunk.h"
46#include "xla/backends/gpu/runtime/sequential_thunk.h"
47#include "xla/backends/gpu/runtime/thunk.h"
48#include "xla/backends/gpu/runtime/thunk_pass_pipeline.h"
49#include "xla/backends/gpu/runtime/while_thunk.h"
50#include "xla/ffi/ffi_registry.h"
51#include "xla/hlo/ir/hlo_module.h"
52#include "xla/stream_executor/device_description.h"
53#include "xla/stream_executor/semantic_version.h"
54#include "xla/tsl/platform/errors.h"
55#include "xla/tsl/platform/statusor.h"
56#include "xla/util.h"
57#include "xla/xla.pb.h"
58#include "tsl/platform/platform.h"
83:39… _devices};
84
85 // Erase command buffer cmd types that are not supported by the gpu runtime.
86 static constexpr auto kRequireConditionals = {DebugOpti …
323:27… , if we call this function on async-start_a in the
324// following sequence:
325//
326// async_start_a
⋯5 lines
433:68… w_thunks,
434 bool& changed) {
435 // If we don't have enough thunks to form a command buffer, we just add
436 // them to the new thunks sequence as is. …