tf-nightly-cpu 2.20.0.dev20250220__cp312-cp312-win_amd64.whl → 2.20.0.dev20250221__cp312-cp312-win_amd64.whl
Sign up to get free protection for your applications and to get access to all the features.
- tensorflow/_api/v2/compat/v1/summary/__init__.py +2 -2
- tensorflow/_api/v2/compat/v1/tpu/experimental/embedding/__init__.py +2 -2
- tensorflow/_api/v2/compat/v2/summary/__init__.py +10 -10
- tensorflow/_api/v2/compat/v2/summary/experimental/__init__.py +4 -4
- tensorflow/_api/v2/compat/v2/tpu/experimental/embedding/__init__.py +2 -2
- tensorflow/_api/v2/summary/__init__.py +10 -10
- tensorflow/_api/v2/summary/experimental/__init__.py +4 -4
- tensorflow/_api/v2/tpu/experimental/embedding/__init__.py +2 -2
- tensorflow/compiler/mlir/stablehlo/stablehlo_extension.pyd +0 -0
- tensorflow/compiler/tf2tensorrt/_pywrap_py_utils.pyd +0 -0
- tensorflow/compiler/tf2xla/ops/_xla_ops.so +0 -0
- tensorflow/include/external/llvm-project/mlir/include/mlir/Analysis/DataFlow/IntegerRangeAnalysis.h +12 -0
- tensorflow/include/external/stablehlo/_virtual_includes/stablehlo_pass_utils/stablehlo/transforms/PassUtils.h +7 -0
- tensorflow/include/external/stablehlo/_virtual_includes/stablehlo_passes/stablehlo/transforms/PassUtils.h +7 -0
- tensorflow/include/external/stablehlo/stablehlo/transforms/PassUtils.h +7 -0
- tensorflow/include/tensorflow/compiler/xla/backends/cpu/codegen/kernel_api_ir_builder.h +3 -2
- tensorflow/include/tensorflow/compiler/xla/backends/cpu/runtime/kernel_thunk.h +9 -3
- tensorflow/include/tensorflow/compiler/xla/backends/cpu/runtime/work_queue.h +81 -18
- tensorflow/include/tensorflow/compiler/xla/codegen/kernel_spec.h +24 -7
- tensorflow/include/tensorflow/compiler/xla/hlo/ir/hlo_casting_utils.h +0 -44
- tensorflow/include/tensorflow/compiler/xla/mlir_hlo/_virtual_includes/stablehlo_extension_pass_inc_gen/stablehlo_ext/transforms/passes.h.inc +149 -4
- tensorflow/include/tensorflow/compiler/xla/mlir_hlo/stablehlo_ext/transforms/passes.h.inc +149 -4
- tensorflow/include/tensorflow/compiler/xla/pjrt/distributed/client.h +5 -0
- tensorflow/include/tensorflow/compiler/xla/pjrt/gpu/se_gpu_pjrt_client.h +1 -92
- tensorflow/include/tensorflow/compiler/xla/pjrt/gpu/se_gpu_topology_description.h +126 -0
- tensorflow/include/tensorflow/compiler/xla/pjrt/pjrt_stream_executor_client.h +1 -49
- tensorflow/include/tensorflow/compiler/xla/pjrt/pjrt_stream_executor_device_description.h +75 -0
- tensorflow/include/tensorflow/compiler/xla/pjrt/plugin/xla_cpu/cpu_execute_options.h +57 -0
- tensorflow/include/tensorflow/compiler/xla/pjrt/plugin/xla_cpu/cpu_topology.h +4 -0
- tensorflow/include/tensorflow/compiler/xla/service/constant_value.h +1 -0
- tensorflow/include/tensorflow/compiler/xla/service/hlo_module_util.h +52 -1
- tensorflow/include/tensorflow/compiler/xla/service/hlo_proto_util.h +0 -12
- tensorflow/include/tensorflow/compiler/xla/tsl/framework/convolution/eigen_spatial_convolutions-inl.h +5 -5
- tensorflow/include/tensorflow/core/kernels/eigen_attention.h +4 -4
- tensorflow/include/tensorflow/core/kernels/eigen_backward_cuboid_convolutions.h +6 -6
- tensorflow/include/tensorflow/core/kernels/eigen_backward_spatial_convolutions.h +10 -8
- tensorflow/include/tensorflow/core/kernels/eigen_cuboid_convolution.h +6 -6
- tensorflow/include/tensorflow/core/kernels/eigen_pooling.h +12 -12
- tensorflow/include/tensorflow/core/public/release_version.h +39 -0
- tensorflow/include/tensorflow/core/public/version.h +112 -127
- tensorflow/include/tensorflow/python/eager/pywrap_tfe.h +1 -1
- tensorflow/include/xla/backends/cpu/codegen/kernel_api_ir_builder.h +3 -2
- tensorflow/include/xla/backends/cpu/runtime/kernel_thunk.h +9 -3
- tensorflow/include/xla/backends/cpu/runtime/work_queue.h +81 -18
- tensorflow/include/xla/codegen/kernel_spec.h +24 -7
- tensorflow/include/xla/hlo/ir/hlo_casting_utils.h +0 -44
- tensorflow/include/xla/mlir_hlo/_virtual_includes/stablehlo_extension_pass_inc_gen/stablehlo_ext/transforms/passes.h.inc +149 -4
- tensorflow/include/xla/mlir_hlo/stablehlo_ext/transforms/passes.h.inc +149 -4
- tensorflow/include/xla/pjrt/distributed/client.h +5 -0
- tensorflow/include/xla/pjrt/gpu/se_gpu_pjrt_client.h +1 -92
- tensorflow/include/xla/pjrt/gpu/se_gpu_topology_description.h +126 -0
- tensorflow/include/xla/pjrt/pjrt_stream_executor_client.h +1 -49
- tensorflow/include/xla/pjrt/pjrt_stream_executor_device_description.h +75 -0
- tensorflow/include/xla/pjrt/plugin/xla_cpu/cpu_execute_options.h +57 -0
- tensorflow/include/xla/pjrt/plugin/xla_cpu/cpu_topology.h +4 -0
- tensorflow/include/xla/service/constant_value.h +1 -0
- tensorflow/include/xla/service/hlo_module_util.h +52 -1
- tensorflow/include/xla/service/hlo_proto_util.h +0 -12
- tensorflow/include/xla/tsl/framework/convolution/eigen_spatial_convolutions-inl.h +5 -5
- tensorflow/lite/experimental/microfrontend/python/ops/_audio_microfrontend_op.so +0 -0
- tensorflow/lite/python/analyzer_wrapper/_pywrap_analyzer_wrapper.pyd +0 -0
- tensorflow/lite/python/interpreter_wrapper/_pywrap_tensorflow_interpreter_wrapper.pyd +0 -0
- tensorflow/lite/python/optimize/_pywrap_tensorflow_lite_calibration_wrapper.pyd +0 -0
- tensorflow/python/_pywrap_dtensor_device.pyd +0 -0
- tensorflow/python/_pywrap_mlir.pyd +0 -0
- tensorflow/python/_pywrap_parallel_device.pyd +0 -0
- tensorflow/python/_pywrap_quantize_training.pyd +0 -0
- tensorflow/python/_pywrap_tensorflow_internal.pyd +0 -0
- tensorflow/python/_pywrap_tfcompile.pyd +0 -0
- tensorflow/python/_pywrap_tfe.pyd +0 -0
- tensorflow/python/client/_pywrap_debug_events_writer.pyd +0 -0
- tensorflow/python/client/_pywrap_device_lib.pyd +0 -0
- tensorflow/python/client/_pywrap_events_writer.pyd +0 -0
- tensorflow/python/client/_pywrap_tf_session.pyd +0 -0
- tensorflow/python/compat/compat.py +1 -1
- tensorflow/python/data/experimental/service/_pywrap_server_lib.pyd +0 -0
- tensorflow/python/data/experimental/service/_pywrap_utils_exp.pyd +0 -0
- tensorflow/python/eager/imperative_grad.py +5 -5
- tensorflow/python/eager/polymorphic_function/atomic_function.py +1 -1
- tensorflow/python/eager/polymorphic_function/compiler_ir.py +1 -1
- tensorflow/python/eager/polymorphic_function/polymorphic_function.py +45 -41
- tensorflow/python/eager/tape.py +2 -2
- tensorflow/python/framework/_dtypes.pyd +0 -0
- tensorflow/python/framework/_op_def_library_pybind.pyd +0 -0
- tensorflow/python/framework/_op_def_registry.pyd +0 -0
- tensorflow/python/framework/_proto_comparators.pyd +0 -0
- tensorflow/python/framework/_pywrap_python_op_gen.pyd +0 -0
- tensorflow/python/framework/_test_metrics_util.pyd +0 -0
- tensorflow/python/grappler/_pywrap_tf_cluster.pyd +0 -0
- tensorflow/python/grappler/_pywrap_tf_item.pyd +0 -0
- tensorflow/python/grappler/_pywrap_tf_optimizer.pyd +0 -0
- tensorflow/python/lib/core/_pywrap_py_func.pyd +0 -0
- tensorflow/python/lib/io/_pywrap_file_io.pyd +0 -0
- tensorflow/python/lib/io/_pywrap_record_io.pyd +0 -0
- tensorflow/python/ops/summary_ops_v2.py +5 -1
- tensorflow/python/platform/_pywrap_tf2.pyd +0 -0
- tensorflow/python/profiler/internal/_pywrap_profiler.pyd +0 -0
- tensorflow/python/profiler/internal/_pywrap_profiler_plugin.pyd +0 -0
- tensorflow/python/saved_model/pywrap_saved_model.pyd +0 -0
- tensorflow/python/tpu/_pywrap_sparse_core_layout.pyd +0 -0
- tensorflow/python/tpu/_pywrap_tpu_embedding.pyd +0 -0
- tensorflow/python/tpu/tpu_embedding_v3.py +14 -7
- tensorflow/python/util/_pywrap_checkpoint_reader.pyd +0 -0
- tensorflow/python/util/_pywrap_kernel_registry.pyd +0 -0
- tensorflow/python/util/_pywrap_stat_summarizer.pyd +0 -0
- tensorflow/python/util/_pywrap_tfprof.pyd +0 -0
- tensorflow/python/util/_pywrap_transform_graph.pyd +0 -0
- tensorflow/python/util/_pywrap_utils.pyd +0 -0
- tensorflow/python/util/_tf_stack.pyd +0 -0
- tensorflow/tools/pip_package/setup.py +2 -2
- {tf_nightly_cpu-2.20.0.dev20250220.dist-info → tf_nightly_cpu-2.20.0.dev20250221.dist-info}/METADATA +1 -1
- {tf_nightly_cpu-2.20.0.dev20250220.dist-info → tf_nightly_cpu-2.20.0.dev20250221.dist-info}/RECORD +115 -108
- {tf_nightly_cpu-2.20.0.dev20250220.dist-info → tf_nightly_cpu-2.20.0.dev20250221.dist-info}/WHEEL +0 -0
- {tf_nightly_cpu-2.20.0.dev20250220.dist-info → tf_nightly_cpu-2.20.0.dev20250221.dist-info}/entry_points.txt +0 -0
- {tf_nightly_cpu-2.20.0.dev20250220.dist-info → tf_nightly_cpu-2.20.0.dev20250221.dist-info}/top_level.txt +0 -0
@@ -52,9 +52,9 @@ limitations under the License.
|
|
52
52
|
#include "xla/pjrt/pjrt_client.h"
|
53
53
|
#include "xla/pjrt/pjrt_common.h"
|
54
54
|
#include "xla/pjrt/pjrt_compiler.h"
|
55
|
-
#include "xla/pjrt/pjrt_device_description.h"
|
56
55
|
#include "xla/pjrt/pjrt_executable.h"
|
57
56
|
#include "xla/pjrt/pjrt_future.h"
|
57
|
+
#include "xla/pjrt/pjrt_stream_executor_device_description.h"
|
58
58
|
#include "xla/pjrt/tracked_device_buffer.h"
|
59
59
|
#include "xla/pjrt/transpose.h"
|
60
60
|
#include "xla/pjrt/utils.h"
|
@@ -77,54 +77,6 @@ limitations under the License.
|
|
77
77
|
|
78
78
|
namespace xla {
|
79
79
|
|
80
|
-
class PjRtStreamExecutorDeviceDescription : public PjRtDeviceDescription {
|
81
|
-
public:
|
82
|
-
explicit PjRtStreamExecutorDeviceDescription(int id, std::string device_kind,
|
83
|
-
int process_index = 0)
|
84
|
-
: id_(id),
|
85
|
-
process_index_(process_index),
|
86
|
-
device_kind_(std::move(device_kind)) {}
|
87
|
-
|
88
|
-
int id() const override { return id_; }
|
89
|
-
|
90
|
-
int process_index() const override { return process_index_; }
|
91
|
-
|
92
|
-
absl::string_view device_kind() const override { return device_kind_; }
|
93
|
-
|
94
|
-
absl::string_view ToString() const override { return to_string_; }
|
95
|
-
|
96
|
-
absl::string_view DebugString() const override { return debug_string_; }
|
97
|
-
|
98
|
-
absl::Span<int const> coords() const { return absl::MakeSpan(coords_); }
|
99
|
-
|
100
|
-
const absl::flat_hash_map<std::string, PjRtDeviceAttribute>& Attributes()
|
101
|
-
const override {
|
102
|
-
return attributes_;
|
103
|
-
}
|
104
|
-
|
105
|
-
void SetAttributes(
|
106
|
-
absl::flat_hash_map<std::string, PjRtDeviceAttribute> attributes) {
|
107
|
-
attributes_ = std::move(attributes);
|
108
|
-
}
|
109
|
-
|
110
|
-
void SetDebugString(std::string debug_string) {
|
111
|
-
debug_string_ = std::move(debug_string);
|
112
|
-
}
|
113
|
-
|
114
|
-
void SetToString(std::string to_string) { to_string_ = std::move(to_string); }
|
115
|
-
|
116
|
-
void SetCoords(std::array<int, 1> coords) { coords_ = coords; }
|
117
|
-
|
118
|
-
private:
|
119
|
-
const int id_;
|
120
|
-
const int process_index_;
|
121
|
-
const std::string device_kind_;
|
122
|
-
std::string debug_string_ = "<unknown SE device>";
|
123
|
-
std::string to_string_ = "<unknown SE device>";
|
124
|
-
absl::flat_hash_map<std::string, PjRtDeviceAttribute> attributes_;
|
125
|
-
std::array<int, 1> coords_;
|
126
|
-
};
|
127
|
-
|
128
80
|
class PjRtStreamExecutorDevice : public PjRtDevice {
|
129
81
|
public:
|
130
82
|
explicit PjRtStreamExecutorDevice(
|
@@ -0,0 +1,75 @@
|
|
1
|
+
/* Copyright 2025 The OpenXLA Authors.
|
2
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
+
you may not use this file except in compliance with the License.
|
4
|
+
You may obtain a copy of the License at
|
5
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
6
|
+
Unless required by applicable law or agreed to in writing, software
|
7
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
8
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
9
|
+
See the License for the specific language governing permissions and
|
10
|
+
limitations under the License.
|
11
|
+
==============================================================================*/
|
12
|
+
#ifndef XLA_PJRT_PJRT_STREAM_EXECUTOR_DEVICE_DESCRIPTION_H_
|
13
|
+
#define XLA_PJRT_PJRT_STREAM_EXECUTOR_DEVICE_DESCRIPTION_H_
|
14
|
+
|
15
|
+
#include <array>
|
16
|
+
#include <string>
|
17
|
+
#include <utility>
|
18
|
+
|
19
|
+
#include "absl/container/flat_hash_map.h"
|
20
|
+
#include "absl/strings/string_view.h"
|
21
|
+
#include "absl/types/span.h"
|
22
|
+
#include "xla/pjrt/pjrt_device_description.h"
|
23
|
+
|
24
|
+
namespace xla {
|
25
|
+
|
26
|
+
class PjRtStreamExecutorDeviceDescription : public PjRtDeviceDescription {
|
27
|
+
public:
|
28
|
+
explicit PjRtStreamExecutorDeviceDescription(int id, std::string device_kind,
|
29
|
+
int process_index = 0)
|
30
|
+
: id_(id),
|
31
|
+
process_index_(process_index),
|
32
|
+
device_kind_(std::move(device_kind)) {}
|
33
|
+
|
34
|
+
int id() const override { return id_; }
|
35
|
+
|
36
|
+
int process_index() const override { return process_index_; }
|
37
|
+
|
38
|
+
absl::string_view device_kind() const override { return device_kind_; }
|
39
|
+
|
40
|
+
absl::string_view ToString() const override { return to_string_; }
|
41
|
+
|
42
|
+
absl::string_view DebugString() const override { return debug_string_; }
|
43
|
+
|
44
|
+
absl::Span<int const> coords() const { return absl::MakeSpan(coords_); }
|
45
|
+
|
46
|
+
const absl::flat_hash_map<std::string, PjRtDeviceAttribute>& Attributes()
|
47
|
+
const override {
|
48
|
+
return attributes_;
|
49
|
+
}
|
50
|
+
|
51
|
+
void SetAttributes(
|
52
|
+
absl::flat_hash_map<std::string, PjRtDeviceAttribute> attributes) {
|
53
|
+
attributes_ = std::move(attributes);
|
54
|
+
}
|
55
|
+
|
56
|
+
void SetDebugString(std::string debug_string) {
|
57
|
+
debug_string_ = std::move(debug_string);
|
58
|
+
}
|
59
|
+
|
60
|
+
void SetToString(std::string to_string) { to_string_ = std::move(to_string); }
|
61
|
+
|
62
|
+
void SetCoords(std::array<int, 1> coords) { coords_ = coords; }
|
63
|
+
|
64
|
+
private:
|
65
|
+
const int id_;
|
66
|
+
const int process_index_;
|
67
|
+
const std::string device_kind_;
|
68
|
+
std::string debug_string_ = "<unknown SE device>";
|
69
|
+
std::string to_string_ = "<unknown SE device>";
|
70
|
+
absl::flat_hash_map<std::string, PjRtDeviceAttribute> attributes_;
|
71
|
+
std::array<int, 1> coords_;
|
72
|
+
};
|
73
|
+
} // namespace xla
|
74
|
+
|
75
|
+
#endif // XLA_PJRT_PJRT_STREAM_EXECUTOR_DEVICE_DESCRIPTION_H_
|
@@ -0,0 +1,57 @@
|
|
1
|
+
/* Copyright 2025 The OpenXLA Authors.
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
14
|
+
==============================================================================*/
|
15
|
+
|
16
|
+
#ifndef XLA_PJRT_PLUGIN_XLA_CPU_CPU_EXECUTE_OPTIONS_H_
|
17
|
+
#define XLA_PJRT_PLUGIN_XLA_CPU_CPU_EXECUTE_OPTIONS_H_
|
18
|
+
|
19
|
+
#include <optional>
|
20
|
+
|
21
|
+
#include "xla/backends/cpu/collectives/cpu_collectives.h"
|
22
|
+
#include "xla/pjrt/pjrt_executable.h"
|
23
|
+
|
24
|
+
namespace xla {
|
25
|
+
|
26
|
+
// ExecuteContext for XLA:CPU PjRtLoadedExecutable::Execute calls.
|
27
|
+
class CpuExecuteContext : public ExecuteContext {
|
28
|
+
public:
|
29
|
+
~CpuExecuteContext() override = default;
|
30
|
+
|
31
|
+
// If specified, override the process ID specified in
|
32
|
+
// `CpuClientOptions::process_id` for a particular call of
|
33
|
+
// PjRtLoadedExecutable::Execute.
|
34
|
+
//
|
35
|
+
// TODO(hyeontaek): Look for a collectives-agnostic way and combine this
|
36
|
+
// option with `ExecuteOptions::multi_slice_config`.
|
37
|
+
std::optional<int>& process_index() { return process_index_; }
|
38
|
+
std::optional<int> process_index() const { return process_index_; }
|
39
|
+
|
40
|
+
// If specified, override CPU collectives specified in
|
41
|
+
// `CpuClientOptions::collectives` for a particular call of
|
42
|
+
// PjRtLoadedExecutable::Execute. Must remain valid until the execution
|
43
|
+
// finishes.
|
44
|
+
//
|
45
|
+
// TODO(hyeontaek): Look for a collectives-agnostic way and combine this
|
46
|
+
// option with `ExecuteOptions::multi_slice_config`.
|
47
|
+
cpu::CpuCollectives*& collectives() { return collectives_; }
|
48
|
+
cpu::CpuCollectives* collectives() const { return collectives_; }
|
49
|
+
|
50
|
+
private:
|
51
|
+
std::optional<int> process_index_;
|
52
|
+
cpu::CpuCollectives* collectives_ = nullptr;
|
53
|
+
};
|
54
|
+
|
55
|
+
} // namespace xla
|
56
|
+
|
57
|
+
#endif // XLA_PJRT_PLUGIN_XLA_CPU_CPU_EXECUTE_OPTIONS_H_
|
@@ -69,6 +69,10 @@ inline int UnpackCpuProcessIndex(PjRtGlobalDeviceId global_device_id) {
|
|
69
69
|
return global_device_id.value() / kMaxCpuDevicesPerProcess;
|
70
70
|
}
|
71
71
|
|
72
|
+
inline int UnpackCpuLocalDeviceId(PjRtGlobalDeviceId global_device_id) {
|
73
|
+
return global_device_id.value() % kMaxCpuDevicesPerProcess;
|
74
|
+
}
|
75
|
+
|
72
76
|
} // namespace xla
|
73
77
|
|
74
78
|
#endif // XLA_PJRT_PLUGIN_XLA_CPU_CPU_TOPOLOGY_H_
|
@@ -19,16 +19,67 @@ limitations under the License.
|
|
19
19
|
#include <functional>
|
20
20
|
#include <memory>
|
21
21
|
#include <optional>
|
22
|
+
#include <string>
|
22
23
|
|
23
|
-
#include "absl/
|
24
|
+
#include "absl/log/check.h"
|
25
|
+
#include "absl/log/log.h"
|
24
26
|
#include "absl/status/statusor.h"
|
27
|
+
#include "absl/strings/string_view.h"
|
25
28
|
#include "absl/types/span.h"
|
29
|
+
#include "xla/hlo/ir/hlo_module.h"
|
30
|
+
#include "xla/hlo/parser/hlo_parser.h"
|
26
31
|
#include "xla/service/compiler.h"
|
27
32
|
#include "xla/service/hlo_module_config.h"
|
28
33
|
#include "xla/shape.h"
|
34
|
+
#include "xla/util.h"
|
29
35
|
|
30
36
|
namespace xla {
|
31
37
|
|
38
|
+
// Converts an HloModule from the given hlo textual IR string (in
|
39
|
+
// HloModule::ToString format).
|
40
|
+
absl::StatusOr<std::unique_ptr<HloModule>> CreateModuleFromString(
|
41
|
+
absl::string_view hlo_string,
|
42
|
+
const DebugOptions& debug_options = DebugOptions::default_instance());
|
43
|
+
|
44
|
+
// Creates an HloModule from the given proto.
|
45
|
+
absl::StatusOr<std::unique_ptr<HloModule>> CreateModuleFromProto(
|
46
|
+
const HloModuleProto& proto,
|
47
|
+
const DebugOptions& debug_options = DebugOptions::default_instance());
|
48
|
+
|
49
|
+
// Create an HLO state from serialized representation. In addition to
|
50
|
+
// creating the proto with HloModule::CreateFromProto(...) it also
|
51
|
+
// uses HloVerifier to ensure basic invariants are held.
|
52
|
+
// The HLO module could be a pre-optimizations (default) or post-optimizations
|
53
|
+
// module, which affects how the HLO module is verified, e.g., mixed-precision
|
54
|
+
// is allowed in post-optimizations HLOs.
|
55
|
+
absl::StatusOr<std::unique_ptr<HloModule>> CreateModuleFromProto(
|
56
|
+
const HloModuleProto& proto, const HloModuleConfig& module_config,
|
57
|
+
bool is_module_post_optimizations = false);
|
58
|
+
|
59
|
+
// Reads the proto file in xla.HloProto format, creates and returns the
|
60
|
+
// HloModule.
|
61
|
+
absl::StatusOr<std::unique_ptr<HloModule>> ReadModuleFromBinaryProtoFile(
|
62
|
+
absl::string_view filename,
|
63
|
+
const DebugOptions& debug_options = DebugOptions::default_instance());
|
64
|
+
|
65
|
+
// Reads the proto file in xla.HloModule format, creates and returns the
|
66
|
+
// HloModule.
|
67
|
+
absl::StatusOr<std::unique_ptr<HloModule>> ReadModuleFromModuleBinaryProtofile(
|
68
|
+
absl::string_view filename, const DebugOptions& debug_options);
|
69
|
+
|
70
|
+
// Reads the HLO text dump file in HloModule::ToString format, creates and
|
71
|
+
// returns the HloModule.
|
72
|
+
absl::StatusOr<std::unique_ptr<HloModule>> ReadModuleFromHloTextFile(
|
73
|
+
absl::string_view filename,
|
74
|
+
const DebugOptions& debug_options = DebugOptions::default_instance(),
|
75
|
+
const HloParserOptions& options = HloParserOptions());
|
76
|
+
|
77
|
+
// Reads the proto file in xla.HloProto format, creates and returns the
|
78
|
+
// HloModule.
|
79
|
+
absl::StatusOr<std::unique_ptr<HloModule>> ReadModuleFromTextProtoFile(
|
80
|
+
absl::string_view hlo_file,
|
81
|
+
const DebugOptions& debug_options = DebugOptions::default_instance());
|
82
|
+
|
32
83
|
// Creates an HloModuleConfig for a given program shape and arguments.
|
33
84
|
// If execution_options does not set num_replicas, default_num_replicas is used.
|
34
85
|
// num_threads is optional; if not given, intra_op_parallelism_threads not set.
|
@@ -18,8 +18,6 @@ limitations under the License.
|
|
18
18
|
#ifndef XLA_SERVICE_HLO_PROTO_UTIL_H_
|
19
19
|
#define XLA_SERVICE_HLO_PROTO_UTIL_H_
|
20
20
|
|
21
|
-
#include <string>
|
22
|
-
|
23
21
|
#include "absl/status/status.h"
|
24
22
|
#include "xla/hlo/ir/hlo_module.h"
|
25
23
|
#include "xla/service/buffer_assignment.h"
|
@@ -35,16 +33,6 @@ HloProto MakeHloProto(const HloModule& module,
|
|
35
33
|
// will not be included in the output.
|
36
34
|
HloProto MakeHloProto(const HloModule& module);
|
37
35
|
|
38
|
-
// Create an HLO state from serialized representation. In addition to
|
39
|
-
// creating the proto with HloModule::CreateFromProto(...) it also
|
40
|
-
// uses HloVerifier to ensure basic invariants are held.
|
41
|
-
// The HLO module could be a pre-optimizations (default) or post-optimizations
|
42
|
-
// module, which affects how the HLO module is verified, e.g., mixed-precision
|
43
|
-
// is allowed in post-optimizations HLOs.
|
44
|
-
absl::StatusOr<std::unique_ptr<HloModule>> CreateModuleFromProto(
|
45
|
-
const HloModuleProto& proto, const HloModuleConfig& module_config,
|
46
|
-
bool is_module_post_optimizations = false);
|
47
|
-
|
48
36
|
// Returns the shapes of the parameters of the entry computation. Shape pointers
|
49
37
|
// refer to shapes inside of the given HloProto.
|
50
38
|
absl::StatusOr<std::vector<const ShapeProto*>> EntryComputationParameterShapes(
|
@@ -1604,12 +1604,12 @@ SpatialConvolution(const Input& input, const Kernel& kernel,
|
|
1604
1604
|
Index padding_left = 0, Index padding_right = 0) {
|
1605
1605
|
typedef typename internal::traits<Input>::Index TensorIndex;
|
1606
1606
|
typedef typename internal::traits<Input>::Scalar InputScalar;
|
1607
|
-
TensorRef<Tensor<InputScalar, internal::traits<Input>::NumDimensions,
|
1608
|
-
|
1607
|
+
TensorRef<const Tensor<InputScalar, internal::traits<Input>::NumDimensions,
|
1608
|
+
internal::traits<Input>::Layout, TensorIndex> >
|
1609
1609
|
in(input);
|
1610
|
-
TensorRef<Tensor<typename internal::traits<Kernel>::Scalar,
|
1611
|
-
|
1612
|
-
|
1610
|
+
TensorRef<const Tensor<typename internal::traits<Kernel>::Scalar,
|
1611
|
+
internal::traits<Kernel>::NumDimensions,
|
1612
|
+
internal::traits<Kernel>::Layout, TensorIndex> >
|
1613
1613
|
kern(kernel);
|
1614
1614
|
|
1615
1615
|
EIGEN_STATIC_ASSERT(
|
@@ -68,8 +68,8 @@ struct GlimpseExtractionOp {
|
|
68
68
|
template <typename Input>
|
69
69
|
DSizes<Index, 4> dimensions(const Input& input) const {
|
70
70
|
typedef typename internal::traits<Input>::Index IndexType;
|
71
|
-
typedef TensorRef<Tensor<typename internal::traits<Input>::Scalar, 4,
|
72
|
-
|
71
|
+
typedef TensorRef<const Tensor<typename internal::traits<Input>::Scalar, 4,
|
72
|
+
internal::traits<Input>::Layout, IndexType> >
|
73
73
|
Ref;
|
74
74
|
Ref in(input);
|
75
75
|
|
@@ -86,8 +86,8 @@ struct GlimpseExtractionOp {
|
|
86
86
|
EIGEN_DEVICE_FUNC void eval(const Input& input, Output& output,
|
87
87
|
const Device& device) const {
|
88
88
|
typedef typename internal::traits<Input>::Index IndexType;
|
89
|
-
typedef TensorRef<Tensor<typename internal::traits<Input>::Scalar, 4,
|
90
|
-
|
89
|
+
typedef TensorRef<const Tensor<typename internal::traits<Input>::Scalar, 4,
|
90
|
+
internal::traits<Input>::Layout, IndexType> >
|
91
91
|
Ref;
|
92
92
|
Ref in(input);
|
93
93
|
const Index num_channels = in.dimension(0);
|
@@ -394,13 +394,13 @@ CuboidConvolutionBackwardKernel(
|
|
394
394
|
const DenseIndex stridePlanes = 1, const DenseIndex strideRows = 1,
|
395
395
|
const DenseIndex strideCols = 1) {
|
396
396
|
typedef typename internal::traits<Input>::Index TensorIndex;
|
397
|
-
TensorRef<Tensor<typename internal::traits<Input>::Scalar,
|
398
|
-
|
399
|
-
|
397
|
+
TensorRef<const Tensor<typename internal::traits<Input>::Scalar,
|
398
|
+
internal::traits<Input>::NumDimensions,
|
399
|
+
internal::traits<Input>::Layout, TensorIndex>>
|
400
400
|
in(input);
|
401
|
-
TensorRef<Tensor<typename internal::traits<OutputBackward>::Scalar,
|
402
|
-
|
403
|
-
|
401
|
+
TensorRef<const Tensor<typename internal::traits<OutputBackward>::Scalar,
|
402
|
+
internal::traits<OutputBackward>::NumDimensions,
|
403
|
+
internal::traits<OutputBackward>::Layout, TensorIndex>>
|
404
404
|
out(output_backward);
|
405
405
|
|
406
406
|
EIGEN_STATIC_ASSERT(internal::traits<Input>::Layout ==
|
@@ -100,11 +100,12 @@ SpatialConvolutionBackwardInput(
|
|
100
100
|
const DenseIndex row_in_stride = 1, const DenseIndex col_in_stride = 1) {
|
101
101
|
typedef typename internal::traits<OutputBackward>::Index TensorIndex;
|
102
102
|
typedef typename internal::traits<OutputBackward>::Scalar OutScalar;
|
103
|
-
TensorRef<Tensor<typename internal::traits<Kernel>::Scalar,
|
104
|
-
|
105
|
-
|
103
|
+
TensorRef<const Tensor<typename internal::traits<Kernel>::Scalar,
|
104
|
+
internal::traits<Kernel>::NumDimensions,
|
105
|
+
internal::traits<Kernel>::Layout, TensorIndex>>
|
106
106
|
kern(kernel);
|
107
|
-
TensorRef<
|
107
|
+
TensorRef<
|
108
|
+
const Tensor<OutScalar, internal::traits<OutputBackward>::NumDimensions,
|
108
109
|
internal::traits<OutputBackward>::Layout, TensorIndex>>
|
109
110
|
out(output_backward);
|
110
111
|
|
@@ -385,11 +386,12 @@ SpatialConvolutionBackwardKernel(
|
|
385
386
|
const DenseIndex row_in_stride = 1, const DenseIndex col_in_stride = 1) {
|
386
387
|
typedef typename internal::traits<Input>::Index TensorIndex;
|
387
388
|
typedef typename internal::traits<OutputBackward>::Scalar OutScalar;
|
388
|
-
TensorRef<Tensor<typename internal::traits<Input>::Scalar,
|
389
|
-
|
390
|
-
|
389
|
+
TensorRef<const Tensor<typename internal::traits<Input>::Scalar,
|
390
|
+
internal::traits<Input>::NumDimensions,
|
391
|
+
internal::traits<Input>::Layout, TensorIndex>>
|
391
392
|
in(input);
|
392
|
-
TensorRef<
|
393
|
+
TensorRef<
|
394
|
+
const Tensor<OutScalar, internal::traits<OutputBackward>::NumDimensions,
|
393
395
|
internal::traits<OutputBackward>::Layout, TensorIndex>>
|
394
396
|
out(output_backward);
|
395
397
|
|
@@ -1843,13 +1843,13 @@ CuboidConvolution(const Input& input, const Kernel& kernel,
|
|
1843
1843
|
const Index strideCols = 1,
|
1844
1844
|
const PaddingType padding_type = PADDING_SAME) {
|
1845
1845
|
typedef typename internal::traits<Input>::Index TensorIndex;
|
1846
|
-
TensorRef<Tensor<typename internal::traits<Input>::Scalar,
|
1847
|
-
|
1848
|
-
|
1846
|
+
TensorRef<const Tensor<typename internal::traits<Input>::Scalar,
|
1847
|
+
internal::traits<Input>::NumDimensions,
|
1848
|
+
internal::traits<Input>::Layout, TensorIndex> >
|
1849
1849
|
in(input);
|
1850
|
-
TensorRef<Tensor<typename internal::traits<Kernel>::Scalar,
|
1851
|
-
|
1852
|
-
|
1850
|
+
TensorRef<const Tensor<typename internal::traits<Kernel>::Scalar,
|
1851
|
+
internal::traits<Kernel>::NumDimensions,
|
1852
|
+
internal::traits<Kernel>::Layout, TensorIndex> >
|
1853
1853
|
kern(kernel);
|
1854
1854
|
|
1855
1855
|
EIGEN_STATIC_ASSERT(
|
@@ -55,9 +55,9 @@ SpatialMaxPooling(const Input& input, DenseIndex patchRows,
|
|
55
55
|
YOU_MADE_A_PROGRAMMING_MISTAKE);
|
56
56
|
|
57
57
|
typedef typename internal::traits<Input>::Index TensorIndex;
|
58
|
-
TensorRef<Tensor<typename internal::traits<Input>::Scalar,
|
59
|
-
|
60
|
-
|
58
|
+
TensorRef<const Tensor<typename internal::traits<Input>::Scalar,
|
59
|
+
internal::traits<Input>::NumDimensions,
|
60
|
+
internal::traits<Input>::Layout, TensorIndex>>
|
61
61
|
in(input);
|
62
62
|
|
63
63
|
const DenseIndex patchRowsEff =
|
@@ -148,9 +148,9 @@ CuboidMaxPooling(const Input& input, DenseIndex patchPlanes,
|
|
148
148
|
static const bool isColMajor = (internal::traits<Input>::Layout == ColMajor);
|
149
149
|
|
150
150
|
typedef typename internal::traits<Input>::Index TensorIndex;
|
151
|
-
TensorRef<Tensor<typename internal::traits<Input>::Scalar,
|
152
|
-
|
153
|
-
|
151
|
+
TensorRef<const Tensor<typename internal::traits<Input>::Scalar,
|
152
|
+
internal::traits<Input>::NumDimensions,
|
153
|
+
internal::traits<Input>::Layout, TensorIndex>>
|
154
154
|
in(input);
|
155
155
|
|
156
156
|
static const int idxPlanes = isColMajor ? 1 : 3;
|
@@ -383,9 +383,9 @@ SpatialAvgPooling(const Input& input, DenseIndex patchRows,
|
|
383
383
|
YOU_MADE_A_PROGRAMMING_MISTAKE);
|
384
384
|
|
385
385
|
typedef typename internal::traits<Input>::Index TensorIndex;
|
386
|
-
TensorRef<Tensor<typename internal::traits<Input>::Scalar,
|
387
|
-
|
388
|
-
|
386
|
+
TensorRef<const Tensor<typename internal::traits<Input>::Scalar,
|
387
|
+
internal::traits<Input>::NumDimensions,
|
388
|
+
internal::traits<Input>::Layout, TensorIndex>>
|
389
389
|
in(input);
|
390
390
|
|
391
391
|
const DenseIndex patchRowsEff =
|
@@ -475,9 +475,9 @@ CuboidAvgPooling(const Input& input, DenseIndex patchPlanes,
|
|
475
475
|
static const bool isColMajor = (internal::traits<Input>::Layout == ColMajor);
|
476
476
|
|
477
477
|
typedef typename internal::traits<Input>::Index TensorIndex;
|
478
|
-
TensorRef<Tensor<typename internal::traits<Input>::Scalar,
|
479
|
-
|
480
|
-
|
478
|
+
TensorRef<const Tensor<typename internal::traits<Input>::Scalar,
|
479
|
+
internal::traits<Input>::NumDimensions,
|
480
|
+
internal::traits<Input>::Layout, TensorIndex>>
|
481
481
|
in(input);
|
482
482
|
|
483
483
|
static const int idxPlanes = isColMajor ? 1 : 3;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
14
|
+
==============================================================================*/
|
15
|
+
|
16
|
+
#ifndef TENSORFLOW_CORE_PUBLIC_RELEASE_VERSION_H_
|
17
|
+
#define TENSORFLOW_CORE_PUBLIC_RELEASE_VERSION_H_
|
18
|
+
|
19
|
+
// TensorFlow uses semantic versioning, see http://semver.org/.
|
20
|
+
|
21
|
+
// Also update tensorflow/tensorflow.bzl and
|
22
|
+
// tensorflow/tools/pip_package/setup.py
|
23
|
+
#define TF_MAJOR_VERSION 2
|
24
|
+
#define TF_MINOR_VERSION 20
|
25
|
+
#define TF_PATCH_VERSION 0
|
26
|
+
|
27
|
+
// TF_VERSION_SUFFIX is non-empty for pre-releases (e.g. "-alpha", "-alpha.1",
|
28
|
+
// "-beta", "-rc", "-rc.1")
|
29
|
+
#define TF_VERSION_SUFFIX "-dev20250221"
|
30
|
+
|
31
|
+
#define _TF_STR_HELPER(x) #x
|
32
|
+
#define _TF_STR(x) _TF_STR_HELPER(x)
|
33
|
+
|
34
|
+
// e.g. "0.5.0" or "0.6.0-alpha".
|
35
|
+
#define TF_VERSION_STRING \
|
36
|
+
(_TF_STR(TF_MAJOR_VERSION) "." _TF_STR(TF_MINOR_VERSION) "." _TF_STR( \
|
37
|
+
TF_PATCH_VERSION) TF_VERSION_SUFFIX)
|
38
|
+
|
39
|
+
#endif // TENSORFLOW_CORE_PUBLIC_RELEASE_VERSION_H_
|