Revert "Update default thread arbitration policy"

This reverts commit 8c3e9ace69.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2022-01-13 21:04:37 +01:00
committed by Compute-Runtime-Automation
parent 8c3e9ace69
commit 182042b04d
7 changed files with 12 additions and 83 deletions

View File

@@ -774,12 +774,7 @@ ze_result_t KernelImp::initialize(const ze_kernel_desc_t *desc) {
auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily);
auto &kernelDescriptor = kernelImmData->getDescriptor();
schedulingHintExpFlag = hwHelper.getDefaultThreadArbitrationPolicy();
if (kernelImmData->getKernelInfo()->requiresSubgroupIndependentForwardProgress() && (schedulingHintExpFlag < NEO::ThreadArbitrationPolicy::RoundRobin)) {
schedulingHintExpFlag = NEO::ThreadArbitrationPolicy::RoundRobin;
}
this->schedulingHintExpFlag = hwHelper.getDefaultThreadArbitrationPolicy();
UNRECOVERABLE_IF(!this->kernelImmData->getKernelInfo()->heapInfo.pKernelHeap);
if (isaAllocation->getAllocationType() == NEO::GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL) {

View File

@@ -286,44 +286,6 @@ class KernelImmutableDataFixture : public ModuleImmutableDataFixture {
using KernelImmutableDataTests = Test<KernelImmutableDataFixture>;
HWTEST_F(KernelImmutableDataTests, givenIfpRequiredWhenInitializingKernelThenSetRoundRobinArbitrationMode) {
std::unique_ptr<MockImmutableData> mockKernelImmData = std::make_unique<MockImmutableData>(0);
mockKernelImmData->kernelInfo->kernelDescriptor.kernelAttributes.flags.requiresSubgroupIndependentForwardProgress = true;
createModuleFromBinary(0, false, mockKernelImmData.get());
std::unique_ptr<ModuleImmutableDataFixture::MockKernel> kernel;
kernel = std::make_unique<ModuleImmutableDataFixture::MockKernel>(module.get());
createKernel(kernel.get());
auto defaultPolicy = HwHelperHw<FamilyType>::get().getDefaultThreadArbitrationPolicy();
if (defaultPolicy >= ThreadArbitrationPolicy::RoundRobin) {
EXPECT_EQ(defaultPolicy, kernel->getSchedulingHintExp());
} else {
EXPECT_EQ(static_cast<uint32_t>(ThreadArbitrationPolicy::RoundRobin), kernel->getSchedulingHintExp());
}
}
HWTEST_F(KernelImmutableDataTests, givenIfpNotRequiredWhenInitializingKernelThenSetDefaultArbitrationMode) {
std::unique_ptr<MockImmutableData> mockKernelImmData = std::make_unique<MockImmutableData>(0);
mockKernelImmData->kernelInfo->kernelDescriptor.kernelAttributes.flags.requiresSubgroupIndependentForwardProgress = false;
createModuleFromBinary(0, false, mockKernelImmData.get());
std::unique_ptr<ModuleImmutableDataFixture::MockKernel> kernel;
kernel = std::make_unique<ModuleImmutableDataFixture::MockKernel>(module.get());
createKernel(kernel.get());
auto defaultPolicy = HwHelperHw<FamilyType>::get().getDefaultThreadArbitrationPolicy();
EXPECT_EQ(defaultPolicy, kernel->getSchedulingHintExp());
}
TEST_F(KernelImmutableDataTests, givenKernelInitializedWithNoPrivateMemoryThenPrivateMemoryIsNull) {
uint32_t perHwThreadPrivateMemorySizeRequested = 0u;
bool isInternal = false;

View File

@@ -246,9 +246,8 @@ cl_int Kernel::initialize() {
}
setThreadArbitrationPolicy(hwHelper.getDefaultThreadArbitrationPolicy());
if (kernelInfo.kernelDescriptor.kernelAttributes.flags.requiresSubgroupIndependentForwardProgress && (this->threadArbitrationPolicy < ThreadArbitrationPolicy::RoundRobin)) {
setThreadArbitrationPolicy(ThreadArbitrationPolicy::RoundRobin);
if (false == kernelInfo.kernelDescriptor.kernelAttributes.flags.requiresSubgroupIndependentForwardProgress) {
setThreadArbitrationPolicy(ThreadArbitrationPolicy::AgeBased);
}
patchBlocksSimdSize();

View File

@@ -752,14 +752,8 @@ HWTEST_F(EnqueueKernelTests, whenEnqueueingKernelThenCsrCorrectlySetsRequiredThr
nullptr,
nullptr);
pCommandQueue->flush();
auto defaultPolicy = HwHelperHw<FamilyType>::get().getDefaultThreadArbitrationPolicy();
if (defaultPolicy >= ThreadArbitrationPolicy::RoundRobin) {
EXPECT_EQ(defaultPolicy, static_cast<uint32_t>(csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
} else {
EXPECT_EQ(static_cast<uint32_t>(ThreadArbitrationPolicy::RoundRobin), static_cast<uint32_t>(csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
}
EXPECT_EQ(HwHelperHw<FamilyType>::get().getDefaultThreadArbitrationPolicy(),
static_cast<uint32_t>(csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
pCommandQueue->enqueueKernel(
mockKernelWithInternalsWithIfpNotRequired.mockKernel,
@@ -771,7 +765,8 @@ HWTEST_F(EnqueueKernelTests, whenEnqueueingKernelThenCsrCorrectlySetsRequiredThr
nullptr,
nullptr);
pCommandQueue->flush();
EXPECT_EQ(defaultPolicy, static_cast<uint32_t>(csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
EXPECT_EQ(ThreadArbitrationPolicy::AgeBased,
static_cast<uint32_t>(csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
pCommandQueue->enqueueKernel(
mockKernelWithInternalsWithIfpRequired.mockKernel,
@@ -783,12 +778,8 @@ HWTEST_F(EnqueueKernelTests, whenEnqueueingKernelThenCsrCorrectlySetsRequiredThr
nullptr,
nullptr);
pCommandQueue->flush();
if (defaultPolicy >= ThreadArbitrationPolicy::RoundRobin) {
EXPECT_EQ(defaultPolicy, static_cast<uint32_t>(csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
} else {
EXPECT_EQ(static_cast<uint32_t>(ThreadArbitrationPolicy::RoundRobin), static_cast<uint32_t>(csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
}
EXPECT_EQ(HwHelperHw<FamilyType>::get().getDefaultThreadArbitrationPolicy(),
static_cast<uint32_t>(csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
}
typedef HelloWorldFixture<HelloWorldFixtureFactory> EnqueueKernelFixture;

View File

@@ -52,7 +52,7 @@ GEN11TEST_F(Gen11EnqueueTest, givenKernelNotRequiringIndependentForwardProgressW
auto cmd = findMmioCmd<FamilyType>(hwParser.cmdList.begin(), hwParser.cmdList.end(), RowChickenReg4::address);
ASSERT_NE(nullptr, cmd);
EXPECT_EQ(RowChickenReg4::regDataForArbitrationPolicy[HwHelperHw<FamilyType>::get().getDefaultThreadArbitrationPolicy()], cmd->getDataDword());
EXPECT_EQ(RowChickenReg4::regDataForArbitrationPolicy[ThreadArbitrationPolicy::AgeBased], cmd->getDataDword());
EXPECT_EQ(1U, countMmio<FamilyType>(hwParser.cmdList.begin(), hwParser.cmdList.end(), RowChickenReg4::address));
}
} // namespace NEO

View File

@@ -52,7 +52,7 @@ GEN9TEST_F(Gen9EnqueueTest, givenKernelNotRequiringIndependentForwardProgressWhe
auto cmd = findMmioCmd<FamilyType>(hwParser.cmdList.begin(), hwParser.cmdList.end(), DebugControlReg2::address);
ASSERT_NE(nullptr, cmd);
EXPECT_EQ(DebugControlReg2::getRegData(HwHelperHw<FamilyType>::get().getDefaultThreadArbitrationPolicy()), cmd->getDataDword());
EXPECT_EQ(DebugControlReg2::getRegData(ThreadArbitrationPolicy::AgeBased), cmd->getDataDword());
EXPECT_EQ(1U, countMmio<FamilyType>(hwParser.cmdList.begin(), hwParser.cmdList.end(), DebugControlReg2::address));
}
} // namespace NEO

View File

@@ -2750,7 +2750,7 @@ TEST(KernelTest, givenKernelLocalIdGenerationByRuntimeFalseAndLocalIdsNotUsedWhe
device->getMemoryManager()->freeGraphicsMemory(mockKernel.kernelInfo.getGraphicsAllocation());
}
TEST(KernelTest, givenIfpWhenKernelIsInitializedThenThreadArbitrationPolicyIsSetToRoundRobinOrAbove) {
TEST(KernelTest, whenKernelIsInitializedThenThreadArbitrationPolicyIsSetToDefaultValue) {
UltClDeviceFactory deviceFactory{1, 0};
SPatchExecutionEnvironment sPatchExecEnv = {};
@@ -2759,24 +2759,6 @@ TEST(KernelTest, givenIfpWhenKernelIsInitializedThenThreadArbitrationPolicyIsSet
auto &mockKernel = *mockKernelWithInternals.mockKernel;
auto &hwHelper = HwHelper::get(deviceFactory.rootDevices[0]->getHardwareInfo().platform.eRenderCoreFamily);
if (hwHelper.getDefaultThreadArbitrationPolicy() >= ThreadArbitrationPolicy::RoundRobin) {
EXPECT_EQ(hwHelper.getDefaultThreadArbitrationPolicy(), mockKernel.threadArbitrationPolicy);
} else {
EXPECT_EQ(static_cast<uint32_t>(ThreadArbitrationPolicy::RoundRobin), mockKernel.threadArbitrationPolicy);
}
}
TEST(KernelTest, givenNoIfpWhenKernelIsInitializedThenThreadArbitrationPolicyIsSetToDefaultValue) {
UltClDeviceFactory deviceFactory{1, 0};
SPatchExecutionEnvironment sPatchExecEnv = {};
sPatchExecEnv.SubgroupIndependentForwardProgressRequired = false;
MockKernelWithInternals mockKernelWithInternals{*deviceFactory.rootDevices[0], sPatchExecEnv};
auto &mockKernel = *mockKernelWithInternals.mockKernel;
auto &hwHelper = HwHelper::get(deviceFactory.rootDevices[0]->getHardwareInfo().platform.eRenderCoreFamily);
EXPECT_EQ(hwHelper.getDefaultThreadArbitrationPolicy(), mockKernel.threadArbitrationPolicy);
}