feature: debug flag to override region count

Related-To: HSD-18040537404

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2024-11-19 13:56:27 +00:00
committed by Compute-Runtime-Automation
parent 47665280f4
commit ed20069d47
4 changed files with 26 additions and 0 deletions

View File

@@ -112,6 +112,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, OverrideMocsIndexForScratchSpace, -1, "Program p
DECLARE_DEBUG_VARIABLE(int32_t, CFEFusedEUDispatch, -1, "Set Fused EU dispatch in FrontEnd State command; values = -1: default, 0: enabled, 1: disabled")
DECLARE_DEBUG_VARIABLE(int32_t, ForceAuxTranslationMode, -1, "Override AUX Translation mode; values = -1: default, 0: none, 1: builtin, 2: blit")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideGpuAddressSpace, -1, "Set GPU address space range in bits; ignore when -1")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideRegionCount, -1, "-1: default, >=1 override region count to given value")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideMaxWorkgroupSize, -1, "Set max workgroup size; ignore when -1")
DECLARE_DEBUG_VARIABLE(int32_t, DoCpuCopyOnReadBuffer, -1, "Override CPU copy behavior for buffer reads; values = -1: default, 0: do not use CPU copy, 1: triggers CPU copy path for Read Buffer calls, only supported for some basic use cases (no blocked user events in dependencies tree)")
DECLARE_DEBUG_VARIABLE(int32_t, DoCpuCopyOnWriteBuffer, -1, "Override CPU copy behavior for buffer writes; values = -1: default, 0: do not use CPU copy, 1: triggers CPU copy path for Write Buffer calls, only supported for some basic use cases (no blocked user events in dependencies tree)")

View File

@@ -118,6 +118,9 @@ bool DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(ExecutionE
hardwareInfo->capabilityTable.slmSize = debugManager.flags.OverrideSlmSize.get();
hardwareInfo->gtSystemInfo.SLMSizeInKb = debugManager.flags.OverrideSlmSize.get();
}
if (debugManager.flags.OverrideRegionCount.get() != -1) {
hardwareInfo->featureTable.regionCount = static_cast<uint32_t>(debugManager.flags.OverrideRegionCount.get());
}
[[maybe_unused]] bool result = rootDeviceEnvironment.initAilConfiguration();
DEBUG_BREAK_IF(!result);
@@ -174,6 +177,9 @@ static bool initHwDeviceIdResources(ExecutionEnvironment &executionEnvironment,
hardwareInfo->capabilityTable.slmSize = debugManager.flags.OverrideSlmSize.get();
hardwareInfo->gtSystemInfo.SLMSizeInKb = debugManager.flags.OverrideSlmSize.get();
}
if (debugManager.flags.OverrideRegionCount.get() != -1) {
executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getMutableHardwareInfo()->featureTable.regionCount = static_cast<uint32_t>(debugManager.flags.OverrideRegionCount.get());
}
executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->initGmm();

View File

@@ -645,4 +645,5 @@ DebugUmdMaxReadWriteRetry = -1
DirectSubmissionControllerBcsTimeoutDivisor = -1
ForceZeroCopyForUseHostPtr = 0
Enable10ThreadsPerEu = -1
OverrideRegionCount = -1
# Please don't edit below this line

View File

@@ -270,3 +270,21 @@ TEST_F(DeviceFactoryOverrideTest, givenDebugFlagSetWhenPrepareDeviceEnvironments
EXPECT_EQ(123u, executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.slmSize);
EXPECT_EQ(123u, executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->gtSystemInfo.SLMSizeInKb);
}
TEST_F(DeviceFactoryOverrideTest, givenDebugFlagSetWhenPrepareDeviceEnvironmentsIsCalledThenOverrideRegionCount) {
DebugManagerStateRestore restore;
debugManager.flags.OverrideRegionCount.set(123);
EXPECT_TRUE(DeviceFactory::prepareDeviceEnvironments(executionEnvironment));
EXPECT_EQ(123u, executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->featureTable.regionCount);
}
TEST_F(DeviceFactoryOverrideTest, givenDebugFlagSetWhenPrepareDeviceEnvironmentsForProductFamilyOverrideIsCalledThenOverrideRegionCount) {
DebugManagerStateRestore restore;
debugManager.flags.OverrideRegionCount.set(123);
EXPECT_TRUE(DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment));
EXPECT_EQ(123u, executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->featureTable.regionCount);
}