Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
adopt transaction API
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Jun 15, 2024
1 parent 745cadf commit 68291c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion third_party/XRT
Submodule XRT updated 87 files
+1 −1 .github/workflows/xrt_ci.yml
+7 −1 .gitignore
+1 −1 build/petalinux.build
+3 −3 src/CMake/nativeTests.cmake
+2 −1 src/runtime_src/core/common/api/bo_int.h
+33 −8 src/runtime_src/core/common/api/hw_queue.cpp
+8 −5 src/runtime_src/core/common/api/hw_queue.h
+14 −5 src/runtime_src/core/common/api/module_int.h
+5 −1 src/runtime_src/core/common/api/xrt_bo.cpp
+16 −1 src/runtime_src/core/common/api/xrt_device.cpp
+4 −0 src/runtime_src/core/common/api/xrt_hw_context.cpp
+169 −104 src/runtime_src/core/common/api/xrt_kernel.cpp
+157 −64 src/runtime_src/core/common/api/xrt_module.cpp
+29 −22 src/runtime_src/core/common/bo_cache.h
+7 −0 src/runtime_src/core/common/config_reader.h
+2 −1 src/runtime_src/core/common/drv/kds_core.c
+4 −3 src/runtime_src/core/common/shim/buffer_handle.h
+0 −9 src/runtime_src/core/common/shim/hwqueue_handle.h
+1 −0 src/runtime_src/core/edge/user/aie/common_layer/adf_api_config.h
+1 −0 src/runtime_src/core/edge/user/zynq_dev.h
+179 −36 src/runtime_src/core/include/ert.h
+2 −0 src/runtime_src/core/include/experimental/xrt_elf.h
+6 −0 src/runtime_src/core/include/xrt/xrt_bo.h
+3 −2 src/runtime_src/core/include/xrt/xrt_device.h
+28 −0 src/runtime_src/core/include/xrt/xrt_hw_context.h
+56 −0 src/runtime_src/core/include/xrt/xrt_kernel.h
+1 −1 src/runtime_src/core/pcie/driver/linux/xocl/lib/libqdma
+15 −3 src/runtime_src/core/pcie/driver/linux/xocl/mgmtpf/mgmt-core.c
+3 −0 src/runtime_src/core/pcie/driver/linux/xocl/mgmtpf/mgmt-core.h
+2 −1 src/runtime_src/core/pcie/driver/linux/xocl/mgmtpf/mgmt-sysfs.c
+144 −16 src/runtime_src/core/pcie/driver/linux/xocl/mgmtpf/mgmt-utils.c
+2 −21 src/runtime_src/core/pcie/driver/linux/xocl/subdev/qdma.c
+2 −0 src/runtime_src/core/pcie/driver/linux/xocl/userpf/xocl_kds.c
+1 −5 src/runtime_src/core/pcie/linux/shim.h
+1 −1 src/runtime_src/core/tools/common/Table2D.cpp
+1 −1 src/runtime_src/core/tools/common/XBMain.cpp
+2 −19 src/runtime_src/core/tools/common/reports/ReportAiePartitions.cpp
+0 −2 src/runtime_src/core/tools/common/reports/ReportElectrical.cpp
+14 −10 src/runtime_src/core/tools/common/reports/ReportHost.cpp
+8 −4 src/runtime_src/core/tools/common/tests/TestDF_bandwidth.cpp
+18 −23 src/runtime_src/core/tools/common/tests/TestGemm.cpp
+6 −3 src/runtime_src/core/tools/common/tests/TestNPULatency.cpp
+7 −4 src/runtime_src/core/tools/common/tests/TestNPUThroughput.cpp
+8 −4 src/runtime_src/core/tools/common/tests/TestTCTAllColumn.cpp
+8 −5 src/runtime_src/core/tools/common/tests/TestTCTOneColumn.cpp
+4 −5 src/runtime_src/core/tools/xbutil2/CMakeLists.txt
+2 −2 src/runtime_src/core/tools/xbutil2/OO_AieClockFreq.cpp
+2 −2 src/runtime_src/core/tools/xbutil2/OO_AieRegRead.cpp
+1 −2 src/runtime_src/core/tools/xbutil2/SubCmdAdvanced.cpp
+0 −1 src/runtime_src/core/tools/xbutil2/SubCmdAdvanced.h
+1 −1 src/runtime_src/core/tools/xbutil2/SubCmdConfigure.cpp
+9 −15 src/runtime_src/core/tools/xbutil2/xbutil
+2 −2 src/runtime_src/core/tools/xbutil2/xbutil-bash-completion
+2 −2 src/runtime_src/core/tools/xbutil2/xbutil-csh-completion-wrapper
+3 −3 src/runtime_src/core/tools/xbutil2/xbutil.cpp
+51 −0 src/runtime_src/core/tools/xbutil2/xrt-smi
+1 −1 src/runtime_src/core/tools/xbutil2/xrt-smi.bat
+70 −37 src/runtime_src/hip/api/hip_module.cpp
+1 −1 src/runtime_src/hip/core/event.cpp
+19 −34 src/runtime_src/hip/core/module.cpp
+66 −18 src/runtime_src/hip/core/module.h
+24 −11 src/runtime_src/tools/scripts/boost.sh
+1 −1 src/runtime_src/tools/scripts/pkgapu.sh
+11 −3 src/runtime_src/tools/xclbinutil/XclBinUtilities.cxx
+104 −95 src/runtime_src/tools/xclbinutil/aie-pdi-transform/src/pdi-parsing.c
+253 −245 src/runtime_src/tools/xclbinutil/aie-pdi-transform/src/pdi-transform.c
+1 −0 src/runtime_src/tools/xclbinutil/unittests/AIEPartition/2220.hex
+1 −0 src/runtime_src/tools/xclbinutil/unittests/AIEPartition/2220_expected.hex
+1 −0 src/runtime_src/tools/xclbinutil/unittests/AIEPartition/2221.hex
+1 −0 src/runtime_src/tools/xclbinutil/unittests/AIEPartition/2221_expected.hex
+0 −2 src/runtime_src/tools/xclbinutil/unittests/AIEPartition/AIEPartition.py
+9 −1 src/runtime_src/xdp/profile/database/static_info/aie_constructs.h
+2 −22 src/runtime_src/xdp/profile/device/common/client_transaction.cpp
+2 −3 src/runtime_src/xdp/profile/device/common/client_transaction.h
+36 −71 src/runtime_src/xdp/profile/plugin/aie_debug/aie_debug_plugin.cpp
+2 −2 src/runtime_src/xdp/profile/plugin/aie_debug/aie_debug_plugin.h
+16 −10 src/runtime_src/xdp/profile/plugin/aie_profile/client/aie_profile.cpp
+1 −1 src/runtime_src/xdp/profile/plugin/aie_profile/client/aie_profile.h
+32 −0 src/runtime_src/xdp/profile/plugin/aie_trace/client/aie_trace.cpp
+7 −0 src/runtime_src/xdp/profile/plugin/aie_trace/edge/aie_trace.cpp
+29 −0 src/runtime_src/xdp/profile/plugin/aie_trace/util/aie_trace_util.cpp
+81 −43 src/runtime_src/xdp/profile/plugin/ml_timeline/clientDev/ml_timeline.cpp
+3 −0 src/runtime_src/xdp/profile/plugin/ml_timeline/clientDev/ml_timeline.h
+7 −1 src/runtime_src/xdp/profile/plugin/ml_timeline/ml_timeline_impl.h
+37 −0 src/runtime_src/xdp/profile/plugin/ml_timeline/ml_timeline_plugin.cpp
+1 −0 src/runtime_src/xdp/profile/plugin/ml_timeline/ml_timeline_plugin.h
+1 −1 src/runtime_src/xocl/core/kernel.cpp
15 changes: 9 additions & 6 deletions xaiepy/xrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
namespace py = pybind11;
using namespace py::literals;

// group_id 0 is for npu instructions
// group_id 1 is for number of npu instructions
// host side buffers/args follow starting from position 2
constexpr size_t TRANSACTION_API_OP_CODE = 3;
// group_id 0 is for the op code
// group_id 1 is for npu instructions
// group_id 2 is for number of npu instructions
// host side buffers/args follow starting from position 3
// see aiecc.main.emit_design_kernel_json
constexpr size_t HOST_BUFFERS_START_IDX = 2;
constexpr size_t HOST_BUFFERS_START_IDX = 3;

class PyXCLBin {
public:
Expand Down Expand Up @@ -102,8 +104,9 @@ class PyXCLBin {

void run() {
run_ = std::make_unique<xrt::run>(*kernel);
run_->set_arg(0, *npuInstructions);
run_->set_arg(1, npuInstructions->size());
run_->set_arg(0, TRANSACTION_API_OP_CODE);
run_->set_arg(1, *npuInstructions);
run_->set_arg(2, npuInstructions->size());
for (size_t i = 0; i < buffers.size(); ++i)
run_->set_arg(HOST_BUFFERS_START_IDX + i, *buffers[i]);
run_->start();
Expand Down

0 comments on commit 68291c2

Please sign in to comment.