Optimize programming of front end by selecting correct hardware

Related-To: NEO-5019

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2022-09-02 14:23:24 +00:00
committed by Compute-Runtime-Automation
parent fa6bccdb30
commit 18af46296d
11 changed files with 22 additions and 32 deletions

View File

@@ -105,7 +105,7 @@ void StateComputeModeProperties::clearIsDirty() {
void FrontEndProperties::setProperties(bool isCooperativeKernel, bool disableEUFusion, bool disableOverdispatch, int32_t engineInstancedDevice, const HardwareInfo &hwInfo) {
if (this->propertiesSupportLoaded == false) {
auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
hwInfoConfig.fillFrontEndPropertiesSupportStructure(this->frontEndPropertiesSupport);
hwInfoConfig.fillFrontEndPropertiesSupportStructure(this->frontEndPropertiesSupport, hwInfo);
this->propertiesSupportLoaded = true;
}
@@ -131,7 +131,7 @@ void FrontEndProperties::setProperties(bool isCooperativeKernel, bool disableEUF
void FrontEndProperties::setPropertySingleSliceDispatchCcsMode(int32_t engineInstancedDevice, const HardwareInfo &hwInfo) {
if (this->propertiesSupportLoaded == false) {
auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
hwInfoConfig.fillFrontEndPropertiesSupportStructure(this->frontEndPropertiesSupport);
hwInfoConfig.fillFrontEndPropertiesSupportStructure(this->frontEndPropertiesSupport, hwInfo);
this->propertiesSupportLoaded = true;
}
this->singleSliceDispatchCcsMode.isDirty = false;

View File

@@ -161,7 +161,7 @@ class HwInfoConfig {
virtual bool getPreemptionDbgPropertyCsrSurfaceSupport() const = 0;
virtual void fillScmPropertiesSupportStructure(StateComputeModePropertiesSupport &propertiesSupport) = 0;
virtual void fillFrontEndPropertiesSupportStructure(FrontEndPropertiesSupport &propertiesSupport) = 0;
virtual void fillFrontEndPropertiesSupportStructure(FrontEndPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) = 0;
MOCKABLE_VIRTUAL ~HwInfoConfig() = default;
@@ -292,7 +292,7 @@ class HwInfoConfigHw : public HwInfoConfig {
bool getPreemptionDbgPropertyCsrSurfaceSupport() const override;
void fillScmPropertiesSupportStructure(StateComputeModePropertiesSupport &propertiesSupport) override;
void fillFrontEndPropertiesSupportStructure(FrontEndPropertiesSupport &propertiesSupport) override;
void fillFrontEndPropertiesSupportStructure(FrontEndPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) override;
protected:
HwInfoConfigHw() = default;

View File

@@ -393,7 +393,7 @@ uint32_t HwInfoConfigHw<gfxProduct>::getThreadEuRatioForScratch(const HardwareIn
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isComputeDispatchAllWalkerEnableInCfeStateRequired(const HardwareInfo &hwInfo) const {
return false;
return getFrontEndPropertyComputeDispatchAllWalkerSupport();
}
template <PRODUCT_FAMILY gfxProduct>
@@ -617,8 +617,8 @@ bool HwInfoConfigHw<gfxProduct>::getFrontEndPropertySingleSliceDispatchCcsModeSu
}
template <PRODUCT_FAMILY gfxProduct>
void HwInfoConfigHw<gfxProduct>::fillFrontEndPropertiesSupportStructure(FrontEndPropertiesSupport &propertiesSupport) {
propertiesSupport.computeDispatchAllWalker = getFrontEndPropertyComputeDispatchAllWalkerSupport();
void HwInfoConfigHw<gfxProduct>::fillFrontEndPropertiesSupportStructure(FrontEndPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) {
propertiesSupport.computeDispatchAllWalker = isComputeDispatchAllWalkerEnableInCfeStateRequired(hwInfo);
propertiesSupport.disableEuFusion = getFrontEndPropertyDisableEuFusionSupport();
propertiesSupport.disableOverdispatch = getFrontEndPropertyDisableOverDispatchSupport();
propertiesSupport.singleSliceDispatchCcsMode = getFrontEndPropertySingleSliceDispatchCcsModeSupport();

View File

@@ -26,13 +26,8 @@ void PreambleHelper<Family>::appendProgramVFEState(const HardwareInfo &hwInfo, c
command->setComputeOverdispatchDisable(streamProperties.frontEndState.disableOverdispatch.value == 1);
command->setSingleSliceDispatchCcsMode(streamProperties.frontEndState.singleSliceDispatchCcsMode.value == 1);
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
if (hwInfoConfig.getSteppingFromHwRevId(hwInfo) >= REVISION_B) {
const auto programComputeDispatchAllWalkerEnableInCfeState = hwInfoConfig.isComputeDispatchAllWalkerEnableInCfeStateRequired(hwInfo);
if (programComputeDispatchAllWalkerEnableInCfeState && streamProperties.frontEndState.computeDispatchAllWalkerEnable.value > 0) {
command->setComputeDispatchAllWalkerEnable(true);
}
if (streamProperties.frontEndState.computeDispatchAllWalkerEnable.value > 0) {
command->setComputeDispatchAllWalkerEnable(true);
}
if (DebugManager.flags.CFEComputeDispatchAllWalkerEnable.get() != -1) {

View File

@@ -192,7 +192,7 @@ uint32_t HwInfoConfigHw<gfxProduct>::getThreadEuRatioForScratch(const HardwareIn
template <>
bool HwInfoConfigHw<gfxProduct>::isComputeDispatchAllWalkerEnableInCfeStateRequired(const HardwareInfo &hwInfo) const {
return true;
return getSteppingFromHwRevId(hwInfo) >= REVISION_B;
}
template <>

View File

@@ -335,11 +335,6 @@ uint32_t HwInfoConfigHw<IGFX_UNKNOWN>::getThreadEuRatioForScratch(const Hardware
return 8u;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isComputeDispatchAllWalkerEnableInCfeStateRequired(const HardwareInfo &hwInfo) const {
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isIpSamplingSupported(const HardwareInfo &hwInfo) const {
return false;

View File

@@ -54,7 +54,7 @@ TEST(StreamPropertiesTests, whenSettingCooperativeKernelPropertiesThenCorrectVal
FrontEndPropertiesSupport frontEndPropertiesSupport = {};
auto hwInfoConfig = HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
hwInfoConfig->fillFrontEndPropertiesSupportStructure(frontEndPropertiesSupport);
hwInfoConfig->fillFrontEndPropertiesSupportStructure(frontEndPropertiesSupport, *defaultHwInfo);
for (auto isEngineInstanced : ::testing::Bool()) {
for (auto isCooperativeKernel : ::testing::Bool()) {
@@ -245,7 +245,7 @@ TEST(StreamPropertiesTests, givenOtherFrontEndPropertiesStructWhenSetPropertiesI
TEST(StreamPropertiesTests, givenSingleDispatchCcsFrontEndPropertyWhenSettingPropertyAndCheckIfSupportedThenExpectCorrectState) {
FrontEndPropertiesSupport fePropertiesSupport{};
auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
hwInfoConfig.fillFrontEndPropertiesSupportStructure(fePropertiesSupport);
hwInfoConfig.fillFrontEndPropertiesSupportStructure(fePropertiesSupport, *defaultHwInfo);
MockFrontEndProperties feProperties{};
EXPECT_FALSE(feProperties.propertiesSupportLoaded);

View File

@@ -526,8 +526,8 @@ HWTEST_F(HwInfoConfigTest, WhenFillingFrontEndPropertiesSupportThenExpectUseCorr
auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
hwInfoConfig->fillFrontEndPropertiesSupportStructure(frontEndPropertiesSupport);
EXPECT_EQ(hwInfoConfig->getFrontEndPropertyComputeDispatchAllWalkerSupport(), frontEndPropertiesSupport.computeDispatchAllWalker);
hwInfoConfig->fillFrontEndPropertiesSupportStructure(frontEndPropertiesSupport, pInHwInfo);
EXPECT_EQ(hwInfoConfig->isComputeDispatchAllWalkerEnableInCfeStateRequired(pInHwInfo), frontEndPropertiesSupport.computeDispatchAllWalker);
EXPECT_EQ(hwInfoConfig->getFrontEndPropertyDisableEuFusionSupport(), frontEndPropertiesSupport.disableEuFusion);
EXPECT_EQ(hwInfoConfig->getFrontEndPropertyDisableOverDispatchSupport(), frontEndPropertiesSupport.disableOverdispatch);
EXPECT_EQ(hwInfoConfig->getFrontEndPropertySingleSliceDispatchCcsModeSupport(), frontEndPropertiesSupport.singleSliceDispatchCcsMode);

View File

@@ -55,7 +55,7 @@ XE_HPC_CORETEST_F(PreambleCfeState, givenKernelExecutionTypeConcurrentAndRevisio
ASSERT_NE(cmdList.end(), cfeStateIt);
auto cfeState = reinterpret_cast<CFE_STATE *>(*cfeStateIt);
uint32_t expectedValue = hwInfoConfig.isComputeDispatchAllWalkerEnableInCfeStateRequired(hwInfo);
uint32_t expectedValue = streamProperties.frontEndState.computeDispatchAllWalkerEnable.isDirty ? streamProperties.frontEndState.computeDispatchAllWalkerEnable.value : 0;
EXPECT_EQ(expectedValue, cfeState->getComputeDispatchAllWalkerEnable());
EXPECT_FALSE(cfeState->getSingleSliceDispatchCcsMode());
}