Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ void get_cur_stream_info(const int stream_id,
!ecore_used) { // Latency mode and enable hyper threading in hybrid cores machine
stream_type = STREAM_WITH_CORE_TYPE;
core_type = MAIN_CORE_PROC;
} else if (proc_type_table.size() > 1 && numa_node_id >= 0) {
} else if (proc_type_table.size() > 1 && numa_node_id >= 0 &&
// Both commands "numactl" and "docker run --cpuset-cpus" can restrict the use of numa nodes.
// Some situation of numa_node_id differs from the original numa_node_id may cause oneTBB to crash
// when binding cores with numa node id. So not binding cores with numa node id in this case.
numa_node_id == get_org_numa_id(numa_node_id)) {
stream_type = STREAM_WITH_NUMA_ID;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/inference/src/dev/threading/executor_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void ExecutorManagerImpl::clear(const std::string& id) {

void ExecutorManagerImpl::execute_task_by_streams_executor(ov::hint::SchedulingCoreType core_type,
ov::threading::Task task) {
ov::threading::IStreamsExecutor::Config streamsConfig("StreamsExecutor", 1, 1, core_type);
ov::threading::IStreamsExecutor::Config streamsConfig("StreamsExecutor", 1, 1, core_type, false, true);
if (!streamsConfig.get_streams_info_table().empty()) {
auto taskExecutor = std::make_shared<ov::threading::CPUStreamsExecutor>(streamsConfig);
std::vector<Task> tasks{std::move(task)};
Expand Down
47 changes: 34 additions & 13 deletions src/inference/src/os/cpu_map_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,38 @@ namespace ov {
class CPU {
public:
CPU();
~CPU(){};
~CPU() {};
void cpu_debug() {
#ifdef ENABLE_OPENVINO_DEBUG
OPENVINO_DEBUG("[ threading ] cpu_mapping_table:");
for (size_t i = 0; i < _cpu_mapping_table.size(); i++) {
OPENVINO_DEBUG(_cpu_mapping_table[i][CPU_MAP_PROCESSOR_ID] , " ",
_cpu_mapping_table[i][CPU_MAP_NUMA_NODE_ID], " ",
_cpu_mapping_table[i][CPU_MAP_SOCKET_ID], " ", _cpu_mapping_table[i][CPU_MAP_CORE_ID],
" ", _cpu_mapping_table[i][CPU_MAP_CORE_TYPE], " ",
_cpu_mapping_table[i][CPU_MAP_GROUP_ID], " ",
OPENVINO_DEBUG(_cpu_mapping_table[i][CPU_MAP_PROCESSOR_ID],
" ",
_cpu_mapping_table[i][CPU_MAP_NUMA_NODE_ID],
" ",
_cpu_mapping_table[i][CPU_MAP_SOCKET_ID],
" ",
_cpu_mapping_table[i][CPU_MAP_CORE_ID],
" ",
_cpu_mapping_table[i][CPU_MAP_CORE_TYPE],
" ",
_cpu_mapping_table[i][CPU_MAP_GROUP_ID],
" ",
_cpu_mapping_table[i][CPU_MAP_USED_FLAG]);
}
OPENVINO_DEBUG("[ threading ] org_proc_type_table:");
for (size_t i = 0; i < _proc_type_table.size(); i++) {
OPENVINO_DEBUG(_proc_type_table[i][ALL_PROC], " ", _proc_type_table[i][MAIN_CORE_PROC], " ",
_proc_type_table[i][EFFICIENT_CORE_PROC], " ",
_proc_type_table[i][HYPER_THREADING_PROC], " ", _proc_type_table[i][PROC_NUMA_NODE_ID],
" ", _proc_type_table[i][PROC_SOCKET_ID]);
OPENVINO_DEBUG(_proc_type_table[i][ALL_PROC],
" ",
_proc_type_table[i][MAIN_CORE_PROC],
" ",
_proc_type_table[i][EFFICIENT_CORE_PROC],
" ",
_proc_type_table[i][HYPER_THREADING_PROC],
" ",
_proc_type_table[i][PROC_NUMA_NODE_ID],
" ",
_proc_type_table[i][PROC_SOCKET_ID]);
}
#endif
}
Expand All @@ -53,7 +67,6 @@ class CPU {
std::map<int, int> _numaid_mapping_table;
std::mutex _cpu_mutex;
int _socket_idx = 0;

};

CPU& cpu_info();
Expand All @@ -62,14 +75,14 @@ CPU& cpu_info();
/**
* @brief Parse nodes information to update _sockets, proc_type_table and cpu_mapping_table on Linux
* @param[in] node_info_table nodes information for this platform.
* @param[in] _numa_nodes total number for nodes in system
* @param[out] _numa_nodes total number for nodes in system
* @param[out] _sockets total number for sockets in system
* @param[out] _proc_type_table summary table of number of processors per type
* @param[out] _cpu_mapping_table CPU mapping table for each processor
* @return
*/
void parse_node_info_linux(const std::vector<std::string> node_info_table,
const int& _numa_nodes,
int& _numa_nodes,
int& _sockets,
std::vector<std::vector<int>>& _proc_type_table,
std::vector<std::vector<int>>& _cpu_mapping_table);
Expand Down Expand Up @@ -121,15 +134,23 @@ void parse_freq_info_linux(const std::vector<std::vector<std::string>> system_in
/**
* @brief update proc_type_table and cpu_mapping_table for vaild processors.
* @param[in] phy_core_list CPU cores id list for physical core of Intel Performance-cores.
* @param[in] numa_node_per_socket number of numa node per socket.
* @param[out] _sockets total number for sockets in system
* @param[out] _numa_nodes total number for numa nodes in system
* @param[out] _cores total number for physical CPU cores in system
* @param[out] _numaid_mapping_table mapping table of numa node id
* @param[out] _socketid_mapping_table mapping table of socket id
* @param[out] _proc_type_table summary table of number of processors per type
* @param[out] _cpu_mapping_table CPU mapping table for each processor
* @return
*/
void update_valid_processor_linux(const std::vector<int> phy_core_list,
const int numa_node_per_socket,
int& _sockets,
int& _numa_nodes,
int& _cores,
std::map<int, int>& _numaid_mapping_table,
std::map<int, int>& _socketid_mapping_table,
std::vector<std::vector<int>>& _proc_type_table,
std::vector<std::vector<int>>& _cpu_mapping_table);

Expand Down
Loading
Loading