feature: Adding hook for applying OpenVino-related AIL

Related-To: NEO-12747

Signed-off-by: Chodor, Jaroslaw <jaroslaw.chodor@intel.com>
This commit is contained in:
Chodor, Jaroslaw
2024-12-20 17:29:21 +00:00
committed by Compute-Runtime-Automation
parent b1bcfe668c
commit 5619da6238
24 changed files with 156 additions and 48 deletions

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2021-2024 Intel Corporation
# Copyright (C) 2021-2025 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -11,6 +11,7 @@ set(NEO_CORE_AIL
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}ail_configuration_extra.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ail_configuration_base.inl
${CMAKE_CURRENT_SOURCE_DIR}/ail_configuration_tgllp_and_later.inl
${CMAKE_CURRENT_SOURCE_DIR}/ail_ov_comp_wa.h
)
set_property(GLOBAL PROPERTY NEO_CORE_AIL ${NEO_CORE_AIL})

View File

@@ -32,6 +32,7 @@ namespace NEO {
extern const char legacyPlatformName[];
struct HardwareInfo;
struct RuntimeCapabilityTable;
enum class AILEnumeration : uint32_t {
@@ -62,7 +63,7 @@ class AILConfiguration {
MOCKABLE_VIRTUAL bool initProcessExecutableName();
virtual void apply(RuntimeCapabilityTable &runtimeCapabilityTable);
virtual void apply(HardwareInfo &hwInfo);
virtual void modifyKernelIfRequired(std::string &kernel) = 0;
@@ -95,7 +96,7 @@ class AILConfiguration {
virtual uint32_t getMicrosecondResolution() = 0;
protected:
virtual void applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) = 0;
virtual void applyExt(HardwareInfo &hwInfo) = 0;
std::string processName;
bool sourcesContain(const std::string &sources, std::string_view contentToFind) const;
@@ -124,7 +125,7 @@ class AILConfigurationHw : public AILConfiguration {
return ailConfiguration;
}
void applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) override;
void applyExt(HardwareInfo &hwInfo) override;
void modifyKernelIfRequired(std::string &kernel) override;
bool isContextSyncFlagRequired() override;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2024 Intel Corporation
* Copyright (C) 2022-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -16,7 +16,7 @@ inline void AILConfigurationHw<product>::modifyKernelIfRequired(std::string &ker
}
template <PRODUCT_FAMILY product>
inline void AILConfigurationHw<product>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
inline void AILConfigurationHw<product>::applyExt(HardwareInfo &hwInfo) {
}
template <PRODUCT_FAMILY product>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2024 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -50,17 +50,17 @@ const uint32_t microsecondAdjustment = 1000;
AILConfigurationCreateFunctionType ailConfigurationFactory[IGFX_MAX_PRODUCT];
void AILConfiguration::apply(RuntimeCapabilityTable &runtimeCapabilityTable) {
void AILConfiguration::apply(HardwareInfo &hwInfo) {
auto search = applicationMap.find(processName);
if (search != applicationMap.end()) {
for (size_t i = 0; i < search->second.size(); ++i) {
switch (search->second[i]) {
case AILEnumeration::enableFp64:
runtimeCapabilityTable.ftrSupportsFP64 = true;
hwInfo.capabilityTable.ftrSupportsFP64 = true;
break;
case AILEnumeration::enableLegacyPlatformName:
runtimeCapabilityTable.preferredPlatformName = legacyPlatformName;
hwInfo.capabilityTable.preferredPlatformName = legacyPlatformName;
break;
default:
break;
@@ -68,7 +68,7 @@ void AILConfiguration::apply(RuntimeCapabilityTable &runtimeCapabilityTable) {
}
}
applyExt(runtimeCapabilityTable);
applyExt(hwInfo);
}
} // namespace NEO

View File

@@ -0,0 +1,15 @@
/*
* Copyright (C) 2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
namespace NEO {
struct HardwareInfo;
bool applyOpenVinoCompatibilityWaIfNeeded(HardwareInfo &hwInfo);
} // namespace NEO

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2021 Intel Corporation
# Copyright (C) 2021-2025 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -7,6 +7,7 @@
set(NEO_CORE_AIL_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/ail_configuration_linux.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ail_ov_comp_wa_linux.cpp
)
set_property(GLOBAL PROPERTY NEO_CORE_AIL_LINUX ${NEO_CORE_AIL_LINUX})

View File

@@ -0,0 +1,15 @@
/*
* Copyright (C) 2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
namespace NEO {
struct HardwareInfo;
bool applyOpenVinoCompatibilityWaIfNeeded(HardwareInfo &hwInfo) {
return false;
}
} // namespace NEO

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2021 Intel Corporation
# Copyright (C) 2021-2025 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -7,6 +7,7 @@
set(NEO_CORE_AIL_WINDOWS
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/ail_configuration_windows.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/ail_ov_comp_wa_windows.cpp
)
set_property(GLOBAL PROPERTY NEO_CORE_AIL_WINDOWS ${NEO_CORE_AIL_WINDOWS})

View File

@@ -0,0 +1,15 @@
/*
* Copyright (C) 2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
namespace NEO {
struct HardwareInfo;
bool applyOpenVinoCompatibilityWaIfNeeded(HardwareInfo &hwInfo) {
return false;
}
} // namespace NEO

View File

@@ -6,6 +6,7 @@
*/
#include "shared/source/ail/ail_configuration_base.inl"
#include "shared/source/ail/ail_ov_comp_wa.h"
#include <map>
#include <vector>
@@ -15,6 +16,11 @@ static EnableAIL<IGFX_PTL> enableAILPTL;
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapPTL = {};
template <>
void AILConfigurationHw<IGFX_PTL>::applyExt(HardwareInfo &hwInfo) {
applyOpenVinoCompatibilityWaIfNeeded(hwInfo);
}
template class AILConfigurationHw<IGFX_PTL>;
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2024 Intel Corporation
* Copyright (C) 2023-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -22,13 +22,13 @@ std::map<std::string_view, std::vector<AILEnumeration>> applicationMapARL = {{"s
static EnableAIL<IGFX_ARROWLAKE> enableAILARL;
template <>
void AILConfigurationHw<IGFX_ARROWLAKE>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
void AILConfigurationHw<IGFX_ARROWLAKE>::applyExt(HardwareInfo &hwInfo) {
auto search = applicationMapARL.find(processName);
if (search != applicationMapARL.end()) {
for (size_t i = 0; i < search->second.size(); ++i) {
switch (search->second[i]) {
case AILEnumeration::disableDirectSubmission:
runtimeCapabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_CCS].engineSupported = false;
hwInfo.capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_CCS].engineSupported = false;
default:
break;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2024 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -57,7 +57,7 @@ bool AILConfigurationHw<IGFX_DG2>::useLegacyValidationLogic() {
}
template <>
inline void AILConfigurationHw<IGFX_DG2>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
inline void AILConfigurationHw<IGFX_DG2>::applyExt(HardwareInfo &hwInfo) {
auto search = applicationsForceRcsDg2.find(processName);
if (search != applicationsForceRcsDg2.end()) {
shouldForceRcs = true;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2024 Intel Corporation
* Copyright (C) 2022-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -28,13 +28,13 @@ constexpr std::array<std::string_view, 3> applicationsLegacyValidationPathMtl =
"blender", "bforartists", "cycles"};
template <>
void AILConfigurationHw<gfxProduct>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
void AILConfigurationHw<gfxProduct>::applyExt(HardwareInfo &hwInfo) {
auto search = applicationMapMTL.find(processName);
if (search != applicationMapMTL.end()) {
for (size_t i = 0; i < search->second.size(); ++i) {
switch (search->second[i]) {
case AILEnumeration::disableDirectSubmission:
runtimeCapabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_CCS].engineSupported = false;
hwInfo.capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_CCS].engineSupported = false;
default:
break;
}