feature: Enable support for reporting bfloat16 conversion support for L0

Related-To: NEO-14316

Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
This commit is contained in:
Neil R. Spruit
2025-03-07 14:58:25 -08:00
committed by Compute-Runtime-Automation
parent bc68b70b40
commit b32f726913
3 changed files with 33 additions and 2 deletions

View File

@@ -23,6 +23,7 @@
#include "shared/source/memory_manager/unified_memory_manager.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/os_interface/os_library.h"
#include "shared/source/release_helper/release_helper.h"
#include "shared/source/utilities/logger.h"
#include "level_zero/core/source/builtin/builtin_functions_lib.h"
@@ -155,12 +156,30 @@ ze_result_t DriverHandleImp::getExtensionProperties(uint32_t *pCount,
std::vector<std::pair<std::string, uint32_t>> additionalExtensions;
bool isBfloat16Supported = false;
bool isBindlessHeapsSupported = false;
for (const auto device : devices) {
if (device->getNEODevice()->getRootDeviceEnvironment().getReleaseHelper()) {
if (device->getNEODevice()->getRootDeviceEnvironment().getReleaseHelper()->isBFloat16ConversionSupported()) {
isBfloat16Supported = true;
}
}
if (device->getNEODevice()->getRootDeviceEnvironment().getBindlessHeapsHelper()) {
additionalExtensions.emplace_back(ZE_BINDLESS_IMAGE_EXP_NAME, ZE_BINDLESS_IMAGE_EXP_VERSION_CURRENT);
isBindlessHeapsSupported = true;
}
if (isBfloat16Supported && isBindlessHeapsSupported) {
break;
}
}
if (isBindlessHeapsSupported) {
additionalExtensions.emplace_back(ZE_BINDLESS_IMAGE_EXP_NAME, ZE_BINDLESS_IMAGE_EXP_VERSION_CURRENT);
}
if (isBfloat16Supported) {
additionalExtensions.emplace_back(ZE_BFLOAT16_CONVERSIONS_EXT_NAME, ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_1_0);
}
devices[0]->getL0GfxCoreHelper().appendPlatformSpecificExtensions(additionalExtensions, devices[0]->getProductHelper(), devices[0]->getHwInfo());
if (devices[0]->getL0GfxCoreHelper().synchronizedDispatchSupported() && devices[0]->isImplicitScalingCapable()) {

View File

@@ -25,6 +25,7 @@
#include "shared/test/common/mocks/mock_execution_environment.h"
#include "shared/test/common/mocks/mock_io_functions.h"
#include "shared/test/common/mocks/mock_os_library.h"
#include "shared/test/common/mocks/mock_release_helper.h"
#include "shared/test/common/mocks/mock_sip.h"
#include "shared/test/common/mocks/ult_device_factory.h"
#include "shared/test/common/test_macros/hw_test.h"
@@ -151,6 +152,13 @@ TEST_F(DriverVersionTest, givenCallToGetExtensionPropertiesThenSupportedExtensio
if (device->getNEODevice()->getRootDeviceEnvironment().getBindlessHeapsHelper()) {
additionalExtensions.emplace_back(ZE_BINDLESS_IMAGE_EXP_NAME, ZE_BINDLESS_IMAGE_EXP_VERSION_CURRENT);
}
auto mockReleaseHelperVal = std::unique_ptr<MockReleaseHelper>(new MockReleaseHelper());
mockReleaseHelperVal->bFloat16Support = true;
auto &rootDeviceEnvironment = device->getNEODevice()->getRootDeviceEnvironmentRef();
rootDeviceEnvironment.releaseHelper.reset(mockReleaseHelperVal.release());
if (device->getNEODevice()->getRootDeviceEnvironment().getReleaseHelper()->isBFloat16ConversionSupported()) {
additionalExtensions.emplace_back(ZE_BFLOAT16_CONVERSIONS_EXT_NAME, ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_1_0);
}
if (!device->getProductHelper().isDcFlushAllowed()) {
additionalExtensions.emplace_back(ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_NAME, ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_VERSION_CURRENT);
}

View File

@@ -21,7 +21,6 @@ class MockReleaseHelper : public ReleaseHelper {
ADDMETHOD_CONST_NOBASE(isPipeControlPriorToPipelineSelectWaRequired, bool, false, ());
ADDMETHOD_CONST_NOBASE(isProgramAllStateComputeCommandFieldsWARequired, bool, false, ());
ADDMETHOD_CONST_NOBASE(isSplitMatrixMultiplyAccumulateSupported, bool, false, ());
ADDMETHOD_CONST_NOBASE(isBFloat16ConversionSupported, bool, false, ());
ADDMETHOD_CONST_NOBASE(isAuxSurfaceModeOverrideRequired, bool, false, ());
ADDMETHOD_CONST_NOBASE(isResolvingSubDeviceIDNeeded, bool, false, ());
ADDMETHOD_CONST_NOBASE(isDirectSubmissionSupported, bool, false, ());
@@ -48,5 +47,10 @@ class MockReleaseHelper : public ReleaseHelper {
static SizeToPreferredSlmValueArray sizeToPreferredSlmValue = {};
return sizeToPreferredSlmValue;
}
bool isBFloat16ConversionSupported() const override {
return bFloat16Support;
}
bool bFloat16Support = false;
};
} // namespace NEO