fix: Remove patchtokens fallback AIL

Related-To: NEO-12358
Signed-off-by: Jaroslaw Warchulski <jaroslaw.warchulski@intel.com>
This commit is contained in:
Jaroslaw Warchulski
2024-09-12 14:47:25 +00:00
committed by Compute-Runtime-Automation
parent f6a89bbc03
commit 05250e7460
6 changed files with 2 additions and 82 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2023 Intel Corporation * Copyright (C) 2018-2024 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -78,11 +78,6 @@ T *Program::create(
} }
program = new T(pContext, false, pContext->getDevices()); program = new T(pContext, false, pContext->getDevices());
if (ail) {
if (ail->isFallbackToPatchtokensRequired(combinedString)) {
pContext->setContextAsNonZebin();
}
}
program->sourceCode.swap(combinedString); program->sourceCode.swap(combinedString);
program->createdFrom = CreatedFrom::source; program->createdFrom = CreatedFrom::source;
} }

View File

@@ -702,27 +702,6 @@ HWTEST2_F(MinimumProgramFixture, givenEmptyAilWhenCreateProgramWithSourcesThenSo
pProgram->release(); pProgram->release();
} }
HWTEST2_F(MinimumProgramFixture, givenEmptyAilWhenCreateProgramWithSourcesAndWithDummyKernelThenDoNotMarkApplicationContextAsNonZebin, IsAtLeastSkl) {
auto pDevice = pContext->getDevice(0);
auto rootDeviceEnvironment = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex].get();
rootDeviceEnvironment->ailConfiguration.reset(nullptr);
const char *dummyKernelSources[] = {"kernel void _(){}"}; // if detected - should trigger fallback to CTNI
size_t knownSourceSize = strlen(dummyKernelSources[0]);
auto pProgram = Program::create<MockProgram>(
pContext,
1,
dummyKernelSources,
&knownSourceSize,
retVal);
ASSERT_NE(nullptr, pProgram);
ASSERT_EQ(CL_SUCCESS, retVal);
EXPECT_FALSE(pProgram->getContext().checkIfContextIsNonZebin());
pProgram->release();
}
TEST_F(MinimumProgramFixture, givenApplicationContextMarkedAsNonZebinWhenBuildingProgramThenInternalOptionsShouldContainDisableZebinOption) { TEST_F(MinimumProgramFixture, givenApplicationContextMarkedAsNonZebinWhenBuildingProgramThenInternalOptionsShouldContainDisableZebinOption) {
const char *kernelSources[] = {"some source code"}; const char *kernelSources[] = {"some source code"};
size_t knownSourceSize = strlen(kernelSources[0]); size_t knownSourceSize = strlen(kernelSources[0]);
@@ -749,38 +728,6 @@ TEST_F(MinimumProgramFixture, givenApplicationContextMarkedAsNonZebinWhenBuildin
pProgram->release(); pProgram->release();
} }
HWTEST2_F(MinimumProgramFixture, givenAILReturningTrueForFallbackRequirementWhenBuildingProgramThenMarkContextAsNonZebin, IsAtLeastSkl) {
class MockAIL : public AILConfigurationHw<productFamily> {
public:
bool isFallbackToPatchtokensRequired(const std::string &kernelSources) override {
return true;
}
};
auto pDevice = pContext->getDevice(0);
auto rootDeviceEnvironment = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex].get();
rootDeviceEnvironment->ailConfiguration.reset(new MockAIL());
ASSERT_FALSE(pContext->checkIfContextIsNonZebin());
const char *kernelSources[] = {"some source code"};
size_t knownSourceSize = strlen(kernelSources[0]);
MockProgram *pProgram = nullptr;
pProgram = Program::create<SucceedingGenBinaryProgram>(
pContext,
1,
kernelSources,
&knownSourceSize,
retVal);
ASSERT_NE(nullptr, pProgram);
ASSERT_EQ(CL_SUCCESS, retVal);
retVal = pProgram->build(pProgram->getDevices(), "");
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_TRUE(pContext->checkIfContextIsNonZebin());
pProgram->release();
}
TEST_F(ProgramFromSourceTest, GivenSpecificParamatersWhenBuildingProgramThenSuccessOrCorrectErrorCodeIsReturned) { TEST_F(ProgramFromSourceTest, GivenSpecificParamatersWhenBuildingProgramThenSuccessOrCorrectErrorCodeIsReturned) {
KernelBinaryHelper kbHelper(binaryFileName, true); KernelBinaryHelper kbHelper(binaryFileName, true);
auto device = pPlatform->getClDevice(0); auto device = pPlatform->getClDevice(0);

View File

@@ -65,8 +65,6 @@ class AILConfiguration {
virtual void modifyKernelIfRequired(std::string &kernel) = 0; virtual void modifyKernelIfRequired(std::string &kernel) = 0;
virtual bool isFallbackToPatchtokensRequired(const std::string &kernelSources) = 0;
virtual bool isContextSyncFlagRequired() = 0; virtual bool isContextSyncFlagRequired() = 0;
virtual bool isBufferPoolEnabled() = 0; virtual bool isBufferPoolEnabled() = 0;
@@ -103,7 +101,6 @@ class AILConfigurationHw : public AILConfiguration {
void applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) override; void applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) override;
void modifyKernelIfRequired(std::string &kernel) override; void modifyKernelIfRequired(std::string &kernel) override;
bool isFallbackToPatchtokensRequired(const std::string &kernelSources) override;
bool isContextSyncFlagRequired() override; bool isContextSyncFlagRequired() override;
bool isBufferPoolEnabled() override; bool isBufferPoolEnabled() override;
bool useLegacyValidationLogic() override; bool useLegacyValidationLogic() override;

View File

@@ -15,20 +15,6 @@ template <PRODUCT_FAMILY product>
inline void AILConfigurationHw<product>::modifyKernelIfRequired(std::string &kernel) { inline void AILConfigurationHw<product>::modifyKernelIfRequired(std::string &kernel) {
} }
// To avoid a known oneDNN issue in ZEBin handling,
// fall back to legacy (patchtoken) format when dummy kernel used by nGen is detected.
// Only this specific kernel with that exact source code will be affected.
template <PRODUCT_FAMILY product>
inline bool AILConfigurationHw<product>::isFallbackToPatchtokensRequired(const std::string &kernelSources) {
std::string_view dummyKernelSource{"kernel void _(){}"};
if (sourcesContain(kernelSources, dummyKernelSource)) {
return true;
}
return false;
}
template <PRODUCT_FAMILY product> template <PRODUCT_FAMILY product>
inline void AILConfigurationHw<product>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) { inline void AILConfigurationHw<product>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
} }

View File

@@ -18,10 +18,6 @@ class MockAILConfiguration : public AILConfiguration {
} }
void modifyKernelIfRequired(std::string &kernel) override {} void modifyKernelIfRequired(std::string &kernel) override {}
bool isFallbackToPatchtokensRequired(const std::string &kernelSources) override {
return false;
}
bool contextSyncFlagReturn = false; bool contextSyncFlagReturn = false;
bool isContextSyncFlagRequired() override { bool isContextSyncFlagRequired() override {
return contextSyncFlagReturn; return contextSyncFlagReturn;

View File

@@ -1,5 +1,5 @@
# #
# Copyright (C) 2021-2023 Intel Corporation # Copyright (C) 2021-2024 Intel Corporation
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
# #
@@ -7,7 +7,6 @@
target_sources(neo_shared_tests PRIVATE target_sources(neo_shared_tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/ail_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ail_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ail_tests_base.cpp
) )
add_subdirectories() add_subdirectories()