fix: Report correct DP support for platforms

Related-To: NEO-9702

- Remove older interfaces and add new release helper

Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@intel.com>
This commit is contained in:
Aravind Gopalakrishnan
2023-12-19 06:28:01 +00:00
committed by Compute-Runtime-Automation
parent d953b3e8c5
commit f5045348ad
20 changed files with 53 additions and 71 deletions

View File

@@ -828,11 +828,13 @@ ze_result_t DeviceImp::getKernelProperties(ze_device_module_properties_t *pKerne
ze_intel_device_module_dp_exp_properties_t *dpProperties =
reinterpret_cast<ze_intel_device_module_dp_exp_properties_t *>(extendedProperties);
dpProperties->flags = 0u;
if (productHelper.isPlatformDp4aSupported()) {
if (compilerProductHelper.isDotAccumulateSupported()) {
dpProperties->flags |= ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DP4A;
}
if (productHelper.isPlatformDpasSupported()) {
auto &rootDeviceEnvironment = neoDevice->getRootDeviceEnvironment();
auto releaseHelper = rootDeviceEnvironment.getReleaseHelper();
if (compilerProductHelper.isDotProductAccumulateSystolicSupported(releaseHelper)) {
dpProperties->flags |= ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DPAS;
}
}

View File

@@ -40,7 +40,7 @@ HWTEST2_F(DeviceFixtureGen12LP, GivenTargetGen12LPWhenGettingDpSupportThenReturn
bool dp4a = moduleDpProps.flags & ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DP4A;
bool dpas = moduleDpProps.flags & ZE_INTEL_DEVICE_MODULE_EXP_FLAG_DPAS;
EXPECT_TRUE(dp4a);
EXPECT_TRUE(dpas);
EXPECT_FALSE(dpas);
}
using CommandQueueGroupTest = Test<DeviceFixture>;

View File

@@ -60,6 +60,7 @@ class CompilerProductHelper {
virtual bool isBFloat16ConversionSupported(const ReleaseHelper *releaseHelper) const = 0;
virtual bool isSubgroupLocalBlockIoSupported() const = 0;
virtual bool isDotAccumulateSupported() const = 0;
virtual bool isDotProductAccumulateSystolicSupported(const ReleaseHelper *releaseHelper) const = 0;
virtual bool isCreateBufferWithPropertiesSupported() const = 0;
virtual bool isSubgroupNamedBarrierSupported() const = 0;
virtual bool isSubgroupExtendedBlockReadSupported() const = 0;
@@ -101,6 +102,7 @@ class CompilerProductHelperHw : public CompilerProductHelper {
bool isBFloat16ConversionSupported(const ReleaseHelper *releaseHelper) const override;
bool isSubgroupLocalBlockIoSupported() const override;
bool isDotAccumulateSupported() const override;
bool isDotProductAccumulateSystolicSupported(const ReleaseHelper *releaseHelper) const override;
bool isCreateBufferWithPropertiesSupported() const override;
bool isSubgroupNamedBarrierSupported() const override;
bool isSubgroupExtendedBlockReadSupported() const override;

View File

@@ -248,6 +248,15 @@ bool CompilerProductHelperHw<gfxProduct>::isMatrixMultiplyAccumulateSupported(co
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool CompilerProductHelperHw<gfxProduct>::isDotProductAccumulateSystolicSupported(const ReleaseHelper *releaseHelper) const {
if (releaseHelper) {
return releaseHelper->isDotProductAccumulateSystolicSupported();
}
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool CompilerProductHelperHw<gfxProduct>::isSplitMatrixMultiplyAccumulateSupported(const ReleaseHelper *releaseHelper) const {
if (releaseHelper) {

View File

@@ -167,8 +167,6 @@ class ProductHelper {
virtual uint32_t getMaxNumSamplers() const = 0;
virtual uint32_t getCommandBuffersPreallocatedPerCommandQueue() const = 0;
virtual uint32_t getInternalHeapsPreallocated() const = 0;
virtual bool isPlatformDpasSupported() const = 0;
virtual bool isPlatformDp4aSupported() const = 0;
virtual bool overrideAllocationCacheable(const AllocationData &allocationData) const = 0;
virtual bool getFrontEndPropertyScratchSizeSupport() const = 0;

View File

@@ -166,16 +166,6 @@ uint64_t ProductHelperHw<gfxProduct>::getDeviceMemoryMaxBandWidthInBytesPerSecon
return 0;
}
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::isPlatformDpasSupported() const {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::isPlatformDp4aSupported() const {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::overrideAllocationCacheable(const AllocationData &allocationData) const {
return false;

View File

@@ -120,8 +120,6 @@ class ProductHelperHw : public ProductHelper {
uint32_t getMaxNumSamplers() const override;
uint32_t getCommandBuffersPreallocatedPerCommandQueue() const override;
uint32_t getInternalHeapsPreallocated() const override;
bool isPlatformDpasSupported() const override;
bool isPlatformDp4aSupported() const override;
bool overrideAllocationCacheable(const AllocationData &allocationData) const override;
bool getFrontEndPropertyScratchSizeSupport() const override;

View File

@@ -34,6 +34,7 @@ class ReleaseHelper {
virtual bool isAdjustWalkOrderAvailable() const = 0;
virtual bool isMatrixMultiplyAccumulateSupported() const = 0;
virtual bool isDotProductAccumulateSystolicSupported() const = 0;
virtual bool isPipeControlPriorToNonPipelinedStateCommandsWARequired() const = 0;
virtual bool isPipeControlPriorToPipelineSelectWaRequired() const = 0;
virtual bool isProgramAllStateComputeCommandFieldsWARequired() const = 0;
@@ -68,6 +69,7 @@ class ReleaseHelperHw : public ReleaseHelper {
bool isAdjustWalkOrderAvailable() const override;
bool isMatrixMultiplyAccumulateSupported() const override;
bool isDotProductAccumulateSystolicSupported() const override;
bool isPipeControlPriorToNonPipelinedStateCommandsWARequired() const override;
bool isPipeControlPriorToPipelineSelectWaRequired() const override;
bool isProgramAllStateComputeCommandFieldsWARequired() const override;

View File

@@ -32,6 +32,11 @@ inline bool ReleaseHelperHw<release>::isAuxSurfaceModeOverrideRequired() const {
return true;
}
template <>
inline bool ReleaseHelperHw<release>::isDotProductAccumulateSystolicSupported() const {
return false;
}
template <>
int ReleaseHelperHw<release>::getProductMaxPreferredSlmSize(int preferredEnumValue) const {
using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;

View File

@@ -44,6 +44,11 @@ bool ReleaseHelperHw<release>::getMediaFrequencyTileIndex(uint32_t &tileIndex) c
return true;
}
template <>
inline bool ReleaseHelperHw<release>::isDotProductAccumulateSystolicSupported() const {
return false;
}
} // namespace NEO
#include "shared/source/release_helper/release_helper_common_xe_lpg.inl"

View File

@@ -14,6 +14,10 @@ bool ReleaseHelperHw<releaseType>::isMatrixMultiplyAccumulateSupported() const {
return true;
}
template <ReleaseType releaseType>
bool ReleaseHelperHw<releaseType>::isDotProductAccumulateSystolicSupported() const {
return true;
}
template <ReleaseType releaseType>
bool ReleaseHelperHw<releaseType>::isAdjustWalkOrderAvailable() const {
return false;
}

View File

@@ -51,14 +51,4 @@ uint32_t ProductHelperHw<gfxProduct>::getMaxNumSamplers() const {
return 0u;
}
template <>
bool ProductHelperHw<gfxProduct>::isPlatformDpasSupported() const {
return true;
}
template <>
bool ProductHelperHw<gfxProduct>::isPlatformDp4aSupported() const {
return true;
}
} // namespace NEO

View File

@@ -82,16 +82,6 @@ uint64_t ProductHelperHw<gfxProduct>::overridePatIndex(bool isUncachedType, uint
return patIndex;
}
template <>
bool ProductHelperHw<gfxProduct>::isPlatformDpasSupported() const {
return true;
}
template <>
bool ProductHelperHw<gfxProduct>::isPlatformDp4aSupported() const {
return true;
}
template <>
bool ProductHelperHw<gfxProduct>::overrideAllocationCacheable(const AllocationData &allocationData) const {
return allocationData.type == AllocationType::commandBuffer;

View File

@@ -333,16 +333,6 @@ bool ProductHelperHw<IGFX_UNKNOWN>::isTimestampWaitSupportedForEvents() const {
return false;
}
template <>
bool ProductHelperHw<IGFX_UNKNOWN>::isPlatformDpasSupported() const {
return false;
}
template <>
bool ProductHelperHw<IGFX_UNKNOWN>::isPlatformDp4aSupported() const {
return false;
}
template <>
uint64_t ProductHelperHw<IGFX_UNKNOWN>::getHostMemCapabilitiesValue() const {
return 0;

View File

@@ -15,6 +15,7 @@ class MockReleaseHelper : public ReleaseHelper {
MockReleaseHelper() : ReleaseHelper(0) {}
ADDMETHOD_CONST_NOBASE(isAdjustWalkOrderAvailable, bool, false, ());
ADDMETHOD_CONST_NOBASE(isMatrixMultiplyAccumulateSupported, bool, false, ());
ADDMETHOD_CONST_NOBASE(isDotProductAccumulateSystolicSupported, bool, false, ());
ADDMETHOD_CONST_NOBASE(isPipeControlPriorToNonPipelinedStateCommandsWARequired, bool, false, ());
ADDMETHOD_CONST_NOBASE(isPipeControlPriorToPipelineSelectWaRequired, bool, false, ());
ADDMETHOD_CONST_NOBASE(isProgramAllStateComputeCommandFieldsWARequired, bool, false, ());

View File

@@ -142,6 +142,18 @@ HWTEST2_F(CompilerProductHelperFixture, GivenReleaseHelperThenMatrixMultiplyAccu
}
}
HWTEST2_F(CompilerProductHelperFixture, GivenReleaseHelperThenDotProductAccumulateSystolicIsSupportedBasedOnReleaseHelper, IsNotXeHpcCore) {
auto &compilerProductHelper = pDevice->getCompilerProductHelper();
auto releaseHelper = pDevice->getReleaseHelper();
if (releaseHelper) {
EXPECT_EQ(releaseHelper->isDotProductAccumulateSystolicSupported(), compilerProductHelper.isDotProductAccumulateSystolicSupported(releaseHelper));
} else {
EXPECT_FALSE(compilerProductHelper.isDotProductAccumulateSystolicSupported(releaseHelper));
}
}
HWTEST2_F(CompilerProductHelperFixture, GivenReleaseHelperThenMatrixMultiplyAccumulateIsSupported, IsXeHpcCore) {
auto &compilerProductHelper = pDevice->getCompilerProductHelper();
auto releaseHelper = pDevice->getReleaseHelper();
@@ -149,6 +161,13 @@ HWTEST2_F(CompilerProductHelperFixture, GivenReleaseHelperThenMatrixMultiplyAccu
EXPECT_TRUE(compilerProductHelper.isMatrixMultiplyAccumulateSupported(releaseHelper));
}
HWTEST2_F(CompilerProductHelperFixture, GivenReleaseHelperThenDotProductAccumulateSystolicIsSupported, IsXeHpcCore) {
auto &compilerProductHelper = pDevice->getCompilerProductHelper();
auto releaseHelper = pDevice->getReleaseHelper();
EXPECT_TRUE(compilerProductHelper.isDotProductAccumulateSystolicSupported(releaseHelper));
}
HWTEST2_F(CompilerProductHelperFixture, GivenReleaseHelperThenSplitMatrixMultiplyAccumulateIsSupportedBasedOnReleaseHelper, IsNotXeHpcCore) {
auto &compilerProductHelper = pDevice->getCompilerProductHelper();
auto releaseHelper = pDevice->getReleaseHelper();

View File

@@ -380,12 +380,6 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenSettingCapabilityCoherencyFla
EXPECT_TRUE(coherency);
}
HWTEST2_F(ProductHelperTest, givenProductHelperWhenDotProductSupportThenReturnsFalse, IsAtMostGen11) {
EXPECT_FALSE(productHelper->isPlatformDp4aSupported());
EXPECT_FALSE(productHelper->isPlatformDpasSupported());
}
HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfAdditionalMediaSamplerProgrammingIsRequiredThenFalseIsReturned) {
EXPECT_FALSE(productHelper->isAdditionalMediaSamplerProgrammingRequired());

View File

@@ -26,6 +26,7 @@ TEST_F(ReleaseHelper1271Tests, whenGettingCapabilitiesThenCorrectPropertiesAreRe
EXPECT_FALSE(releaseHelper->isAdjustWalkOrderAvailable());
EXPECT_FALSE(releaseHelper->isMatrixMultiplyAccumulateSupported());
EXPECT_FALSE(releaseHelper->isDotProductAccumulateSystolicSupported());
EXPECT_EQ(revision == 0, releaseHelper->isPipeControlPriorToNonPipelinedStateCommandsWARequired());
EXPECT_FALSE(releaseHelper->isPipeControlPriorToPipelineSelectWaRequired());
EXPECT_EQ(revision == 0, releaseHelper->isProgramAllStateComputeCommandFieldsWARequired());

View File

@@ -74,16 +74,6 @@ XE_HPC_CORETEST_F(ProductHelperTestXeHpcCore, givenProductHelperWhenCheckTimesta
EXPECT_TRUE(helper.isTimestampWaitSupportedForEvents());
}
XE_HPC_CORETEST_F(ProductHelperTestXeHpcCore, givenProductHelperWhenCheckDpasSupportThenReturnTrue) {
auto &helper = getHelper<ProductHelper>();
EXPECT_TRUE(helper.isPlatformDpasSupported());
}
XE_HPC_CORETEST_F(ProductHelperTestXeHpcCore, givenProductHelperWhenCheckDp4aSupportThenReturnTrue) {
auto &helper = getHelper<ProductHelper>();
EXPECT_TRUE(helper.isPlatformDp4aSupported());
}
XE_HPC_CORETEST_F(GfxCoreHelperTest, givenGfxCoreHelperWhenCallCopyThroughLockedPtrEnabledThenReturnTrue) {
const auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
const auto &productHelper = getHelper<ProductHelper>();

View File

@@ -209,14 +209,6 @@ HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCheckBlitEnqueueAllowed
EXPECT_FALSE(productHelper->blitEnqueueAllowed());
}
HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCheckDpasSupportedThenReturnTrue, IsXeLpg) {
EXPECT_TRUE(productHelper->isPlatformDpasSupported());
}
HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCheckDp4aSupportedThenReturnTrue, IsXeLpg) {
EXPECT_TRUE(productHelper->isPlatformDp4aSupported());
}
HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues, IsXeLpg) {
EXPECT_FALSE(productHelper->getScmPropertyThreadArbitrationPolicySupport());