Skip to content

Commit

Permalink
Add json option for advance reports (#8558)
Browse files Browse the repository at this point in the history
* add json opt, remove some validate verbose logging

Signed-off-by: AShivangi <[email protected]>

* submodule change

Signed-off-by: AShivangi <[email protected]>

* remove patch file

Signed-off-by: AShivangi <[email protected]>

* changes

Signed-off-by: AShivangi <[email protected]>

---------

Signed-off-by: AShivangi <[email protected]>
  • Loading branch information
AShivangi authored Oct 23, 2024
1 parent 8cf422e commit 1291c59
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ calculate_col_utilization(const xrt_core::device* device, boost::property_tree::
// If this check is true, at least two contexts were active on the same column at once.
if (total_active_cols > total_device_cols)
total_active_cols = total_device_cols;
double total_col_utilization = ((static_cast<double>(total_active_cols) / total_device_cols) * 100);
return boost::str(boost::format("%.0f%%") % total_col_utilization);
double total_col_occupancy = ((static_cast<double>(total_active_cols) / total_device_cols) * 100);
return boost::str(boost::format("%.0f%%") % total_col_occupancy);
}

void
Expand All @@ -109,7 +109,7 @@ getPropertyTree20202(const xrt_core::device* _pDevice,
boost::property_tree::ptree pt;
pt.put("description", "AIE Partition Information");
pt.add_child("partitions", populate_aie_partition(_pDevice));
pt.put("total_col_utilization", calculate_col_utilization(_pDevice, pt));
pt.put("total_col_occupancy", calculate_col_utilization(_pDevice, pt));
_pt.add_child("aie_partitions", pt);
}

Expand All @@ -128,7 +128,7 @@ writeReport(const xrt_core::device* /*_pDevice*/,
return;
}

_output << boost::str(boost::format("Total Column Utilization: %s\n") % _pt.get<std::string>("aie_partitions.total_col_utilization"));
_output << boost::str(boost::format("Total Column Occupancy: %s\n") % _pt.get<std::string>("aie_partitions.total_col_occupancy"));

for (const auto& pt_partition : pt_partitions) {
const auto& partition = pt_partition.second;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ TestAIEReconfigOverhead::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}

logger(ptree, "Xclbin", xclbin_path);

xrt::xclbin xclbin;
try {
xclbin = xrt::xclbin(xclbin_path);
Expand Down Expand Up @@ -67,8 +65,6 @@ TestAIEReconfigOverhead::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}
auto kernelName = xkernel.get_name();
if(XBUtilities::getVerbose())
logger(ptree, "Details", boost::str(boost::format("Kernel name is '%s'") % kernelName));

auto working_dev = xrt::device(dev);
working_dev.register_xclbin(xclbin);
Expand All @@ -90,8 +86,6 @@ TestAIEReconfigOverhead::run(std::shared_ptr<xrt_core::device> dev)
if (!std::filesystem::exists(dpu_instr))
return ptree;

logger(ptree, "DPU-Sequence", dpu_instr);

size_t instr_size = 0;
try {
instr_size = XBValidateUtils::get_instr_size(dpu_instr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ TestCmdChainLatency::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}

logger(ptree, "Xclbin", xclbin_path);

xrt::xclbin xclbin;
try {
xclbin = xrt::xclbin(xclbin_path);
Expand Down Expand Up @@ -65,8 +63,6 @@ TestCmdChainLatency::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}
auto kernelName = xkernel.get_name();
if(XBU::getVerbose())
logger(ptree, "Details", boost::str(boost::format("Kernel name is '%s'") % kernelName));

auto working_dev = xrt::device(dev);
working_dev.register_xclbin(xclbin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ TestCmdChainThroughput::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}

logger(ptree, "Xclbin", xclbin_path);

xrt::xclbin xclbin;
try {
xclbin = xrt::xclbin(xclbin_path);
Expand Down Expand Up @@ -65,8 +63,6 @@ TestCmdChainThroughput::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}
auto kernelName = xkernel.get_name();
if(XBU::getVerbose())
logger(ptree, "Details", boost::str(boost::format("Kernel name is '%s'") % kernelName));

auto working_dev = xrt::device(dev);
working_dev.register_xclbin(xclbin);
Expand Down
6 changes: 0 additions & 6 deletions src/runtime_src/core/tools/common/tests/TestDF_bandwidth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ TestDF_bandwidth::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}

logger(ptree, "Xclbin", xclbin_path);

xrt::xclbin xclbin;
try {
xclbin = xrt::xclbin(xclbin_path);
Expand Down Expand Up @@ -71,8 +69,6 @@ TestDF_bandwidth::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}
auto kernelName = xkernel.get_name();
if(XBU::getVerbose())
logger(ptree, "Details", boost::str(boost::format("Kernel name is '%s'") % kernelName));

auto working_dev = xrt::device(dev);
working_dev.register_xclbin(xclbin);
Expand All @@ -94,8 +90,6 @@ TestDF_bandwidth::run(std::shared_ptr<xrt_core::device> dev)
if (!std::filesystem::exists(dpu_instr))
return ptree;

logger(ptree, "DPU-Sequence", dpu_instr);

size_t instr_size = 0;
try {
instr_size = XBValidateUtils::get_instr_size(dpu_instr);
Expand Down
6 changes: 0 additions & 6 deletions src/runtime_src/core/tools/common/tests/TestGemm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ TestGemm::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}

logger(ptree, "Xclbin", xclbin_path);

xrt::xclbin xclbin;
try {
xclbin = xrt::xclbin(xclbin_path);
Expand Down Expand Up @@ -74,7 +72,6 @@ TestGemm::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}
auto kernelName = xkernel.get_name();
logger(ptree, "Details", boost::str(boost::format("Kernel name is '%s'") % kernelName));

auto working_dev = xrt::device(dev);
working_dev.register_xclbin(xclbin);
Expand All @@ -97,9 +94,6 @@ TestGemm::run(std::shared_ptr<xrt_core::device> dev)
if (!std::filesystem::exists(dpu_instr))
return ptree;

if(XBU::getVerbose())
logger(ptree, "DPU-Sequence", dpu_instr);

size_t instr_size = 0;
try {
instr_size = XBValidateUtils::get_instr_size(dpu_instr);
Expand Down
6 changes: 1 addition & 5 deletions src/runtime_src/core/tools/common/tests/TestNPULatency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ TestNPULatency::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}

logger(ptree, "Xclbin", xclbin_path);

xrt::xclbin xclbin;
try {
xclbin = xrt::xclbin(xclbin_path);
Expand Down Expand Up @@ -65,8 +63,6 @@ TestNPULatency::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}
auto kernelName = xkernel.get_name();
if(XBU::getVerbose())
logger(ptree, "Details", boost::str(boost::format("Kernel name is '%s'") % kernelName));

auto working_dev = xrt::device(dev);
working_dev.register_xclbin(xclbin);
Expand All @@ -80,7 +76,7 @@ TestNPULatency::run(std::shared_ptr<xrt_core::device> dev)
catch (const std::exception& )
{
logger (ptree, "Error", "Not enough columns available. Please make sure no other workload is running on the device.");
ptree.put("status", test_token_failed);ptree.put("status", test_token_failed);
ptree.put("status", test_token_failed);
return ptree;
}
xrt::xclbin::ip cu;
Expand Down
4 changes: 0 additions & 4 deletions src/runtime_src/core/tools/common/tests/TestNPUThroughput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ TestNPUThroughput::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}

logger(ptree, "Xclbin", xclbin_path);

xrt::xclbin xclbin;
try {
xclbin = xrt::xclbin(xclbin_path);
Expand Down Expand Up @@ -65,8 +63,6 @@ TestNPUThroughput::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}
auto kernelName = xkernel.get_name();
if(XBU::getVerbose())
logger(ptree, "Details", boost::str(boost::format("Kernel name is '%s'") % kernelName));

auto working_dev = xrt::device(dev);
working_dev.register_xclbin(xclbin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ boost::property_tree::ptree TestSpatialSharingOvd::run(std::shared_ptr<xrt_core:
if (!std::filesystem::exists(xclbin_path))
return ptree;

// Log the xclbin path
logger(ptree, "Xclbin", xclbin_path);

// Create an xclbin object
xrt::xclbin xclbin;
try {
Expand Down Expand Up @@ -74,10 +71,6 @@ boost::property_tree::ptree TestSpatialSharingOvd::run(std::shared_ptr<xrt_core:
// Get the name of the found kernel
auto kernelName = xkernel.get_name();

// If verbose mode is enabled, log the kernel name
if(XBU::getVerbose())
logger(ptree, "Details", boost::str(boost::format("Kernel name is '%s'") % kernelName));

// Create a working device from the provided device
auto working_dev = xrt::device(dev);
working_dev.register_xclbin(xclbin);
Expand All @@ -98,7 +91,6 @@ boost::property_tree::ptree TestSpatialSharingOvd::run(std::shared_ptr<xrt_core:
if (!std::filesystem::exists(dpu_instr))
return ptree;

logger(ptree, "DPU-Sequence", dpu_instr);
/* Run 1 */
std::vector<std::thread> threads;
std::vector<TestCase> testcases;
Expand Down
5 changes: 0 additions & 5 deletions src/runtime_src/core/tools/common/tests/TestTCTAllColumn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ TestTCTAllColumn::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}

logger(ptree, "Xclbin", xclbin_path);

xrt::xclbin xclbin;
try {
Expand Down Expand Up @@ -67,8 +66,6 @@ TestTCTAllColumn::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}
auto kernelName = xkernel.get_name();
if(XBU::getVerbose())
logger(ptree, "Details", boost::str(boost::format("Kernel name is '%s'") % kernelName));

auto working_dev = xrt::device(dev);
working_dev.register_xclbin(xclbin);
Expand All @@ -91,8 +88,6 @@ TestTCTAllColumn::run(std::shared_ptr<xrt_core::device> dev)
if (!std::filesystem::exists(dpu_instr))
return ptree;

logger(ptree, "DPU-Sequence", dpu_instr);

size_t instr_size = 0;
try {
instr_size = XBValidateUtils::get_instr_size(dpu_instr);
Expand Down
6 changes: 0 additions & 6 deletions src/runtime_src/core/tools/common/tests/TestTCTOneColumn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ TestTCTOneColumn::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}

logger(ptree, "Xclbin", xclbin_path);

xrt::xclbin xclbin;
try {
xclbin = xrt::xclbin(xclbin_path);
Expand Down Expand Up @@ -67,8 +65,6 @@ TestTCTOneColumn::run(std::shared_ptr<xrt_core::device> dev)
return ptree;
}
auto kernelName = xkernel.get_name();
if(XBU::getVerbose())
logger(ptree, "Details", boost::str(boost::format("Kernel name is '%s'") % kernelName));

auto working_dev = xrt::device(dev);
working_dev.register_xclbin(xclbin);
Expand All @@ -90,8 +86,6 @@ TestTCTOneColumn::run(std::shared_ptr<xrt_core::device> dev)
if (!std::filesystem::exists(dpu_instr))
return ptree;

logger(ptree, "DPU-Sequence", dpu_instr);

size_t instr_size = 0;
try {
instr_size = XBValidateUtils::get_instr_size(dpu_instr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ TestTemporalSharingOvd::run(std::shared_ptr<xrt_core::device> dev) {
if (!std::filesystem::exists(xclbin_path))
return ptree;

logger(ptree, "Xclbin", xclbin_path);

xrt::xclbin xclbin;
try{
xclbin = xrt::xclbin(xclbin_path);
Expand All @@ -55,8 +53,6 @@ TestTemporalSharingOvd::run(std::shared_ptr<xrt_core::device> dev) {
return ptree;
}
auto kernelName = xkernel.get_name();
if(XBU::getVerbose())
logger(ptree, "Details", boost::str(boost::format("Kernel name is '%s'") % kernelName));

auto working_dev = xrt::device(dev);
working_dev.register_xclbin(xclbin);
Expand All @@ -66,8 +62,6 @@ TestTemporalSharingOvd::run(std::shared_ptr<xrt_core::device> dev) {
if (!std::filesystem::exists(dpu_instr))
return ptree;

logger(ptree, "DPU-Sequence", dpu_instr);

// Run 1
std::vector<std::thread> threads;
std::vector<TestCase> testcases;
Expand Down
Loading

0 comments on commit 1291c59

Please sign in to comment.