Skip to content

Commit

Permalink
WIP: Add runner for run-recipe (#8608)
Browse files Browse the repository at this point in the history
A run-recipe defines how to execute a graph model using XRT.

This changes contain a stand-alone runner class that reads and
executes a run-recipe json file. The idea is to have tools
geneate the run-recipe along with xclbin and control code for kernels.

The format (schema) of the recipe json is loosely defined. The
implementation of the runner drove some of the defintion of the json
format.

A run-recipe is associated with exactly one xclbin which, when loaded
into a region (partition) on the device, can run the recipe.

This is work-in-progress and is base-lined and validated for today's
NPU TXN control code.  The runner will change shortly when we obsolete
xclbin for NPU.

The recipe will not work with Alveo as the runner uses xrt::runlist
for execution and xrt::runlist is not supposed in Alveo.

Signed-off-by: Soren Soe <[email protected]>
  • Loading branch information
stsoe authored Nov 20, 2024
1 parent e9fe46b commit f0d8f58
Show file tree
Hide file tree
Showing 16 changed files with 2,648 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ modernize-*,

WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: none
User: sonals
CheckOptions:
Expand Down Expand Up @@ -124,6 +123,8 @@ CheckOptions:
value: llvm
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: '0'
- key: cppcoreguidelines-avoid-non-const-global-variables.AllowInternalLinkage
value: '1'
- key: cppcoreguidelines-avoid-magic-numbers.IgnoredFloatingPointValues
value: '1.0;100.0;'
- key: cppcoreguidelines-avoid-magic-numbers.IgnoredIntegerValues
Expand Down
3 changes: 3 additions & 0 deletions src/runtime_src/core/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Copyright (C) 2022-2024 Advanced Micro Devices, Inc. All rights reserved.
add_subdirectory(api)
add_subdirectory(xdp)
add_subdirectory(runner)

if(CMAKE_VERSION VERSION_LESS "3.18.0")
message(WARNING "CMake version is less than 3.18.0, build of submodule aiebu disabled")
Expand Down Expand Up @@ -62,12 +63,14 @@ target_include_directories(core_common_objects

add_library(xrt_coreutil SHARED
$<TARGET_OBJECTS:core_common_library_objects>
$<TARGET_OBJECTS:core_common_runner_objects>
$<TARGET_OBJECTS:core_common_api_library_objects>
$<TARGET_OBJECTS:core_common_xdp_profile_objects>
)

add_library(xrt_coreutil_static STATIC
$<TARGET_OBJECTS:core_common_library_objects>
$<TARGET_OBJECTS:core_common_runner_objects>
$<TARGET_OBJECTS:core_common_api_library_objects>
$<TARGET_OBJECTS:core_common_xdp_profile_objects>
)
Expand Down
12 changes: 12 additions & 0 deletions src/runtime_src/core/common/runner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
add_library(core_common_runner_objects OBJECT
runner.cpp
cpu.cpp
)

target_include_directories(core_common_runner_objects
PRIVATE
${XRT_SOURCE_DIR}/runtime_src
)

Loading

0 comments on commit f0d8f58

Please sign in to comment.