[CPU] Removed socket id=-1 workaround on macOS (#18779)
This commit is contained in:
parent
2ed5e50bd1
commit
0ed1749ad9
@ -133,9 +133,7 @@ struct CPUStreamsExecutor::Impl {
|
|||||||
const int concurrency,
|
const int concurrency,
|
||||||
const int core_type,
|
const int core_type,
|
||||||
const int numa_node_id) {
|
const int numa_node_id) {
|
||||||
_numaNodeId = (_impl->_usedNumaNodes.size() == 1 && _impl->_usedNumaNodes.at(0) == -1)
|
_numaNodeId = std::max(0, numa_node_id);
|
||||||
? -1 // macOS
|
|
||||||
: std::max(0, numa_node_id);
|
|
||||||
_socketId = get_socket_by_numa_node(_numaNodeId);
|
_socketId = get_socket_by_numa_node(_numaNodeId);
|
||||||
if (stream_type == STREAM_WITHOUT_PARAM) {
|
if (stream_type == STREAM_WITHOUT_PARAM) {
|
||||||
_taskArena.reset(new custom::task_arena{concurrency});
|
_taskArena.reset(new custom::task_arena{concurrency});
|
||||||
|
@ -247,7 +247,7 @@ int get_num_numa_nodes() {
|
|||||||
return cpu_info()._numa_nodes;
|
return cpu_info()._numa_nodes;
|
||||||
}
|
}
|
||||||
int get_num_sockets() {
|
int get_num_sockets() {
|
||||||
return -1;
|
return cpu_info()._sockets;
|
||||||
}
|
}
|
||||||
void reserve_available_cpus(const std::vector<std::vector<int>> streams_info_table,
|
void reserve_available_cpus(const std::vector<std::vector<int>> streams_info_table,
|
||||||
std::vector<std::vector<int>>& stream_processors,
|
std::vector<std::vector<int>>& stream_processors,
|
||||||
@ -255,6 +255,12 @@ void reserve_available_cpus(const std::vector<std::vector<int>> streams_info_tab
|
|||||||
void set_cpu_used(const std::vector<int>& cpu_ids, const int used) {}
|
void set_cpu_used(const std::vector<int>& cpu_ids, const int used) {}
|
||||||
|
|
||||||
int get_socket_by_numa_node(int numa_node_id) {
|
int get_socket_by_numa_node(int numa_node_id) {
|
||||||
|
CPU& cpu = cpu_info();
|
||||||
|
for (size_t i = 0; i < cpu._proc_type_table.size(); i++) {
|
||||||
|
if (cpu._proc_type_table[i][PROC_NUMA_NODE_ID] == numa_node_id) {
|
||||||
|
return cpu._proc_type_table[i][PROC_SOCKET_ID];
|
||||||
|
}
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -176,9 +176,7 @@ ExecNetwork::GraphGuard::Lock ExecNetwork::GetGraph() const {
|
|||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock{*_mutex.get()};
|
std::lock_guard<std::mutex> lock{*_mutex.get()};
|
||||||
// disable weights caching if graph was created only once
|
// disable weights caching if graph was created only once
|
||||||
// "socketId != -1" is the WA for MacOS, will remove later
|
auto weightsCache = _cfg.streamExecutorConfig._streams != 1 ? _socketWeights[socketId] : nullptr;
|
||||||
auto weightsCache =
|
|
||||||
(_cfg.streamExecutorConfig._streams != 1 && socketId != -1) ? _socketWeights[socketId] : nullptr;
|
|
||||||
|
|
||||||
auto isQuantizedFlag =
|
auto isQuantizedFlag =
|
||||||
(_cfg.lpTransformsMode == Config::On) &&
|
(_cfg.lpTransformsMode == Config::On) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user