fix: correct programming preferred slm size for 12.70/12.71 releases

do not exceed 96K slm allocation size

Related-To: HSD-14019148270, HSD-14019142146
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski 2023-06-30 09:17:21 +00:00 committed by Compute-Runtime-Automation
parent 1e8a53bd53
commit 8327a68c9b
3 changed files with 28 additions and 56 deletions

View File

@ -12,6 +12,8 @@
#include "platforms.h" #include "platforms.h"
#include "release_definitions.h" #include "release_definitions.h"
#include <algorithm>
namespace NEO { namespace NEO {
constexpr auto release = ReleaseType::release1270; constexpr auto release = ReleaseType::release1270;
@ -23,11 +25,7 @@ bool ReleaseHelperHw<release>::isPipeControlPriorToNonPipelinedStateCommandsWARe
template <> template <>
int ReleaseHelperHw<release>::getProductMaxPreferredSlmSize(int preferredEnumValue) const { int ReleaseHelperHw<release>::getProductMaxPreferredSlmSize(int preferredEnumValue) const {
using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;
return std::min(preferredEnumValue, static_cast<int>(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K));
if (hardwareIpVersion.value == AOT::MTL_M_A0) {
return static_cast<int>(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K);
}
return preferredEnumValue;
} }
} // namespace NEO } // namespace NEO

View File

@ -12,6 +12,8 @@
#include "platforms.h" #include "platforms.h"
#include "release_definitions.h" #include "release_definitions.h"
#include <algorithm>
namespace NEO { namespace NEO {
constexpr auto release = ReleaseType::release1271; constexpr auto release = ReleaseType::release1271;
@ -23,11 +25,7 @@ bool ReleaseHelperHw<release>::isPipeControlPriorToNonPipelinedStateCommandsWARe
template <> template <>
int ReleaseHelperHw<release>::getProductMaxPreferredSlmSize(int preferredEnumValue) const { int ReleaseHelperHw<release>::getProductMaxPreferredSlmSize(int preferredEnumValue) const {
using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;
return std::min(preferredEnumValue, static_cast<int>(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K));
if (hardwareIpVersion.value == AOT::MTL_P_A0) {
return static_cast<int>(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K);
}
return preferredEnumValue;
} }
} // namespace NEO } // namespace NEO

View File

@ -231,55 +231,31 @@ MTLTEST_F(MtlProductHelper, givenMtlLpgWhenIsBFloat16ConversionSupportedIsCalled
EXPECT_FALSE(compilerProductHelper.isBFloat16ConversionSupported(hwInfo)); EXPECT_FALSE(compilerProductHelper.isBFloat16ConversionSupported(hwInfo));
} }
MTLTEST_F(MtlProductHelper, givenMtlMA0WhenGetProductMaxPreferredSlmSizeThen96KbValueReturned) { MTLTEST_F(MtlProductHelper, givenMtlWhenGetProductMaxPreferredSlmSizeThenValueDoesNotExceed96K) {
using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;
PREFERRED_SLM_ALLOCATION_SIZE preferredEnumValue = PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K;
auto hwInfo = *defaultHwInfo.get();
HardwareIpVersion aotConfig = {0};
aotConfig.value = AOT::MTL_M_A0;
auto &compilerProductHelper = this->executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
compilerProductHelper.setProductConfigForHwInfo(hwInfo, aotConfig);
refreshReleaseHelper(&hwInfo);
preferredEnumValue = static_cast<PREFERRED_SLM_ALLOCATION_SIZE>(releaseHelper->getProductMaxPreferredSlmSize(preferredEnumValue));
EXPECT_EQ(preferredEnumValue, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K);
}
MTLTEST_F(MtlProductHelper, givenMtlPA0WhenGetProductMaxPreferredSlmSizeThen96KbValueReturned) { for (auto &hwIpVersion : {AOT::MTL_M_A0, AOT::MTL_M_B0, AOT::MTL_P_A0, AOT::MTL_P_B0}) {
using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; auto hwInfo = *defaultHwInfo.get();
PREFERRED_SLM_ALLOCATION_SIZE preferredEnumValue = PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K; HardwareIpVersion aotConfig = {0};
auto hwInfo = *defaultHwInfo.get(); aotConfig.value = hwIpVersion;
HardwareIpVersion aotConfig = {0}; auto &compilerProductHelper = this->executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
aotConfig.value = AOT::MTL_P_A0; compilerProductHelper.setProductConfigForHwInfo(hwInfo, aotConfig);
auto &compilerProductHelper = this->executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>(); refreshReleaseHelper(&hwInfo);
compilerProductHelper.setProductConfigForHwInfo(hwInfo, aotConfig); for (auto &preferredSlmSize : {PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K,
refreshReleaseHelper(&hwInfo); PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K,
preferredEnumValue = static_cast<PREFERRED_SLM_ALLOCATION_SIZE>(releaseHelper->getProductMaxPreferredSlmSize(preferredEnumValue)); PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_16K,
EXPECT_EQ(preferredEnumValue, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K); PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K,
} PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_64K,
MTLTEST_F(MtlProductHelper, givenMtlMB0WhenGetProductMaxPreferredSlmSizeThenPassedValueReturned) { PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K}) {
using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;
PREFERRED_SLM_ALLOCATION_SIZE preferredEnumValue = PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K;
auto hwInfo = *defaultHwInfo.get();
HardwareIpVersion aotConfig = {0};
aotConfig.value = AOT::MTL_M_B0;
auto &compilerProductHelper = this->executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
compilerProductHelper.setProductConfigForHwInfo(hwInfo, aotConfig);
refreshReleaseHelper(&hwInfo);
preferredEnumValue = static_cast<PREFERRED_SLM_ALLOCATION_SIZE>(releaseHelper->getProductMaxPreferredSlmSize(preferredEnumValue));
EXPECT_EQ(preferredEnumValue, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K);
}
MTLTEST_F(MtlProductHelper, givenMtlPB0WhenGetProductMaxPreferredSlmSizeThenPassedValueReturned) { auto maxPreferredSlmValue = releaseHelper->getProductMaxPreferredSlmSize(preferredSlmSize);
using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; EXPECT_EQ(maxPreferredSlmValue, preferredSlmSize);
PREFERRED_SLM_ALLOCATION_SIZE preferredEnumValue = PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K; }
auto hwInfo = *defaultHwInfo.get(); auto preferredSlmSize96k = PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K;
HardwareIpVersion aotConfig = {0}; auto preferredSlmSize128k = PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K;
aotConfig.value = AOT::MTL_P_B0; auto maxPreferredSlmValue = releaseHelper->getProductMaxPreferredSlmSize(preferredSlmSize128k);
auto &compilerProductHelper = this->executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>(); EXPECT_EQ(maxPreferredSlmValue, preferredSlmSize96k);
compilerProductHelper.setProductConfigForHwInfo(hwInfo, aotConfig); }
refreshReleaseHelper(&hwInfo);
preferredEnumValue = static_cast<PREFERRED_SLM_ALLOCATION_SIZE>(releaseHelper->getProductMaxPreferredSlmSize(preferredEnumValue));
EXPECT_EQ(preferredEnumValue, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K);
} }
MTLTEST_F(MtlProductHelper, givenMtlWhenCallIsAdjustWalkOrderAvailableThenReturnProperValue) { MTLTEST_F(MtlProductHelper, givenMtlWhenCallIsAdjustWalkOrderAvailableThenReturnProperValue) {