Skip to content

Commit

Permalink
Fix for spatial sharing crash
Browse files Browse the repository at this point in the history
Signed-off-by: Akshay Tondak <[email protected]>
  • Loading branch information
Akshay Tondak authored and Akshay Tondak committed Dec 9, 2024
1 parent 9a275a4 commit 0ac5ab7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace XBU = XBUtilities;

static constexpr size_t host_app = 1; //opcode
static constexpr size_t buffer_size = 1024; //1 KB
static constexpr size_t buffer_size = 1024 * 1024 * 1024; //1 GB

// Method to run the test
// Parameters:
Expand Down Expand Up @@ -96,7 +96,7 @@ boost::property_tree::ptree TestSpatialSharingOvd::run(std::shared_ptr<xrt_core:
std::vector<TestCase> testcases;

// Create two test cases and add them to the vector
TestParams params(xclbin, working_dev, kernelName, dpu_instr, 8, buffer_size, 10000);
TestParams params(xclbin, working_dev, kernelName, dpu_instr, 2, buffer_size, 10);
testcases.emplace_back(params);
testcases.emplace_back(params);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


namespace XBU = XBUtilities;
static constexpr size_t buffer_size = 1024; //1 KB
static constexpr size_t buffer_size = 1024*1024*1024; //1 GB

boost::property_tree::ptree
TestTemporalSharingOvd::run(std::shared_ptr<xrt_core::device> dev) {
Expand Down Expand Up @@ -67,7 +67,7 @@ TestTemporalSharingOvd::run(std::shared_ptr<xrt_core::device> dev) {
std::vector<TestCase> testcases;

// Create two test cases and add them to the vector
TestParams params(xclbin, working_dev, kernelName, dpu_instr, 8, buffer_size, 10000);
TestParams params(xclbin, working_dev, kernelName, dpu_instr, 1, buffer_size, 10);
testcases.emplace_back(params);
testcases.emplace_back(params);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ BO_set::BO_set(const xrt::device& device, const xrt::kernel& kernel, const std::
std::memset(bo_instr.map<char*>(), (uint8_t)0, buffer_size);
} else {
size_t instr_size = XBValidateUtils::get_instr_size(dpu_instr);
bo_instr = xrt::bo(device, instr_size, XCL_BO_FLAGS_CACHEABLE, kernel.group_id(5));
bo_instr = xrt::bo(device, instr_size * sizeof(int), XCL_BO_FLAGS_CACHEABLE, kernel.group_id(5));
XBValidateUtils::init_instr_buf(bo_instr, dpu_instr);
}
}

Expand All @@ -57,7 +58,7 @@ void BO_set::set_kernel_args(xrt::run& run) const {
run.set_arg(3, bo_ofm);
run.set_arg(4, bo_inter);
run.set_arg(5, bo_instr);
run.set_arg(6, buffer_size/sizeof(int));
run.set_arg(6, bo_instr.size()/sizeof(int));
run.set_arg(7, bo_mc);
}

Expand Down
2 changes: 1 addition & 1 deletion src/runtime_src/core/tools/xbutil2/xbutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ R"(
}]
},{
"validate": [{
"test": ["spatial-sharing-overhead", "latency", "throughput", "cmd-chain-latency", "cmd-chain-throughput", "df-bw", "tct-one-col", "tct-all-col", "gemm", "aie-reconfig-overhead", temporal-sharing-overhead"]
"test": ["latency", "throughput", "cmd-chain-latency", "cmd-chain-throughput", "df-bw", "tct-one-col", "tct-all-col", "gemm", "aie-reconfig-overhead", "spatial-sharing-overhead", "temporal-sharing-overhead"]
}]
}]
}]
Expand Down

0 comments on commit 0ac5ab7

Please sign in to comment.