Skip to content

Commit ef00962

Browse files
authored
Removes deprecated ITEX_TILE_AS_DEVICE environment variable. (#2717)
1 parent ad56cc2 commit ef00962

File tree

3 files changed

+1
-64
lines changed

3 files changed

+1
-64
lines changed

itex/core/devices/gpu/itex_gpu_runtime.cc

+1-33
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ class DevicePool {
115115
static std::vector<ITEX_GPUDevice> devices;
116116

117117
std::call_once(init_device_flag, []() {
118-
std::vector<ITEX_GPUDevice> root_devices;
119118
// Get root device list from platform list.
120119
auto platform_list = sycl::platform::get_platforms();
121120
for (const auto& platform : platform_list) {
@@ -131,43 +130,12 @@ class DevicePool {
131130
auto device_list = platform.get_devices();
132131
for (const auto& device : device_list) {
133132
if (device.is_gpu()) {
134-
root_devices.push_back(device);
133+
devices.push_back(device);
135134
}
136135
}
137136
}
138137
}
139138

140-
if (TileAsDevice()) {
141-
// If ITEX_TILE_AS_DEVICE is true.
142-
// Create sub devices from root devices:
143-
// If succ, add sub devices into devices list
144-
// If fail, add root devices into devices list
145-
constexpr auto partition_by_affinity =
146-
sycl::info::partition_property::partition_by_affinity_domain;
147-
constexpr auto next_partitionable =
148-
sycl::info::partition_affinity_domain::next_partitionable;
149-
for (const auto& root_device : root_devices) {
150-
std::vector<ITEX_GPUDevice> sub_devices;
151-
auto max_sub_devices =
152-
root_device
153-
.get_info<sycl::info::device::partition_max_sub_devices>();
154-
if (max_sub_devices == 0) {
155-
ITEX_LOG(INFO) << "number of sub-devices is zero, expose root "
156-
"device.";
157-
devices.push_back(root_device);
158-
} else {
159-
sub_devices = root_device.create_sub_devices<partition_by_affinity>(
160-
next_partitionable);
161-
devices.insert(devices.end(), sub_devices.begin(),
162-
sub_devices.end());
163-
}
164-
}
165-
} else {
166-
// If ITEX_TILE_AS_DEVICE is false.
167-
// Only set root device as device list.
168-
devices = std::move(root_devices);
169-
}
170-
171139
size_t num_device = devices.size();
172140

173141
if (num_device <= 0) {

itex/core/devices/xpu_device_util.h

-28
Original file line numberDiff line numberDiff line change
@@ -84,32 +84,4 @@ void DeviceMemcpy(void* dst, const void* src, size_t size, void* stream) {
8484

8585
} // namespace itex
8686

87-
// ITEX_TILE_AS_DEVICE
88-
// True (default behaviour): Tile as an individual device in device list
89-
// False: Only root device as an individual device in
90-
// device list
91-
inline bool TileAsDevice() {
92-
bool tile_as_device;
93-
if (std::getenv(std::string("ITEX_ENABLE_TILE_AS_DEVICE").c_str())) {
94-
ITEX_CHECK_OK(itex::ReadBoolFromEnvVar("ITEX_ENABLE_TILE_AS_DEVICE", true,
95-
&tile_as_device));
96-
ITEX_LOG(WARNING)
97-
<< "`ITEX_ENABLE_TILE_AS_DEVICE` will be deprecated, "
98-
"please use `ZE_FLAT_DEVICE_HIERARCHY` instead, refering to "
99-
"https://spec.oneapi.io/level-zero/latest/core/"
100-
"PROG.html#device-hierarchy.";
101-
} else if (std::getenv(std::string("ITEX_TILE_AS_DEVICE").c_str())) {
102-
ITEX_CHECK_OK(
103-
itex::ReadBoolFromEnvVar("ITEX_TILE_AS_DEVICE", true, &tile_as_device));
104-
ITEX_LOG(WARNING)
105-
<< "`ITEX_TILE_AS_DEVICE` will be deprecated, "
106-
"please use `ZE_FLAT_DEVICE_HIERARCHY` instead, refering to "
107-
"https://spec.oneapi.io/level-zero/latest/core/"
108-
"PROG.html#device-hierarchy.";
109-
} else {
110-
tile_as_device = true;
111-
}
112-
return tile_as_device;
113-
}
114-
11587
#endif // ITEX_CORE_DEVICES_XPU_DEVICE_UTIL_H_

itex/core/graph/xpu_graph.cc

-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ void InitGlobalSetting(const OptimizerConfigFlags& config) {
4747
{"ITEX_REMAPPER", config.enable_remapper},
4848
{"ITEX_LAYOUT_OPT", config.enable_layout_opt},
4949
{"ITEX_AUTO_MIXED_PRECISION", config.enable_auto_mixed_precision},
50-
#ifndef INTEL_CPU_ONLY
51-
{"ITEX_TILE_AS_DEVICE", TileAsDevice},
52-
#endif
5350
{"ITEX_CACHE_ONEDNN_OBJECT", false},
5451
{"_ITEX_ONEDNN_GRAPH_ALL_TYPE", config.enable_onednn_graph_all_type},
5552
{"_ITEX_ONEDNN_GRAPH_COMPILER_BACKEND",

0 commit comments

Comments
 (0)