From 49e904df740823efc8c28aad04ad2b093000863e Mon Sep 17 00:00:00 2001 From: "Chodor, Jaroslaw" Date: Tue, 3 Dec 2024 16:37:27 +0000 Subject: [PATCH] feature: Parse actual_kernel_start_offset zeinfo entry This is a deprecated and redundant entry but needs to be preserved for compatibility reasons. Related-To: GSD-10402 Signed-off-by: Chodor, Jaroslaw --- .../device_binary_format/zebin/zeinfo.h | 1 + .../zebin/zeinfo_decoder.cpp | 2 ++ .../zebin_decoder_tests.cpp | 25 +++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/shared/source/device_binary_format/zebin/zeinfo.h b/shared/source/device_binary_format/zebin/zeinfo.h index aa6be4aaa0..d102c14c44 100644 --- a/shared/source/device_binary_format/zebin/zeinfo.h +++ b/shared/source/device_binary_format/zebin/zeinfo.h @@ -60,6 +60,7 @@ inline constexpr ConstStringRef subgroupIndependentForwardProgress("subgroup_ind inline constexpr ConstStringRef workGroupWalkOrderDimensions("work_group_walk_order_dimensions"); inline constexpr ConstStringRef threadSchedulingMode("thread_scheduling_mode"); inline constexpr ConstStringRef hasSample("has_sample"); +inline constexpr ConstStringRef actualKernelStartOffset("actual_kernel_start_offset"); namespace ThreadSchedulingMode { inline constexpr ConstStringRef ageBased("age_based"); inline constexpr ConstStringRef roundRobin("round_robin"); diff --git a/shared/source/device_binary_format/zebin/zeinfo_decoder.cpp b/shared/source/device_binary_format/zebin/zeinfo_decoder.cpp index 23770f2078..8dcbfbb85d 100644 --- a/shared/source/device_binary_format/zebin/zeinfo_decoder.cpp +++ b/shared/source/device_binary_format/zebin/zeinfo_decoder.cpp @@ -673,6 +673,8 @@ DecodeError readZeInfoExecutionEnvironment(const Yaml::YamlParser &parser, const validExecEnv &= readZeInfoValueChecked(parser, execEnvMetadataNd, outExecEnv.privateSize, context, outErrReason); } else if (Tags::Kernel::ExecutionEnv::spillSize == key) { validExecEnv &= readZeInfoValueChecked(parser, execEnvMetadataNd, outExecEnv.spillSize, context, outErrReason); + } else if (Tags::Kernel::ExecutionEnv::actualKernelStartOffset == key) { + // ignore intentionally - deprecated and redundant key } else { readZeInfoValueCheckedExtra(parser, execEnvMetadataNd, outExecEnv, context, key, outErrReason, outWarning, validExecEnv, err); } diff --git a/shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp b/shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp index a1790baaf5..4566580dd8 100644 --- a/shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp +++ b/shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp @@ -1983,6 +1983,31 @@ kernels: EXPECT_STREQ("DeviceBinaryFormat::zebin::.ze_info : Unknown entry \"something_new\" in context of some_kernel\n", errors.c_str()); } +TEST(ReadZeInfoExecutionEnvironment, GivenActualKernelStartOffsetThenDontTreatItAsInvalidEntry) { + NEO::ConstStringRef yaml = R"===(--- +kernels: + - name: some_kernel + execution_env: + simd_size : 8 + actual_kernel_start_offset: 240 +... +)==="; + + std::string parserErrors; + std::string parserWarnings; + NEO::Yaml::YamlParser parser; + bool success = parser.parse(yaml, parserErrors, parserWarnings); + ASSERT_TRUE(success); + auto &argsNode = *parser.findNodeWithKeyDfs("execution_env"); + std::string errors; + std::string warnings; + NEO::Zebin::ZeInfo::Types::Kernel::ExecutionEnv::ExecutionEnvBaseT execEnv; + auto err = NEO::Zebin::ZeInfo::readZeInfoExecutionEnvironment(parser, argsNode, execEnv, "some_kernel", errors, warnings); + EXPECT_EQ(NEO::DecodeError::success, err); + EXPECT_TRUE(errors.empty()) << errors; + EXPECT_TRUE(warnings.empty()) << warnings; +} + TEST(ReadZeInfoExecutionEnvironment, GivenInvalidValueForKnownEntryThenFails) { NEO::ConstStringRef yaml = R"===(--- kernels: