14 #include "hebench/modules/timer/include/timer.h"
19 #include "../include/hebench_logreg_l.h"
22 namespace TestHarness {
30 bool BenchmarkDescriptor::m_b_registered =
34 const std::vector<hebench::APIBridge::WorkloadParam> &w_params)
const
36 assert(m_b_registered);
66 std::uint64_t result_batch_size = 1;
68 result_batch_size *= batch_sizes[param_i];
71 ss <<
", , P(X = X') = sigmoid";
87 ss <<
"(W . X + b)" << std::endl
88 <<
", , , Elements, Batch size" << std::endl;
92 ss <<
", , P(X), 1, " << result_batch_size << std::endl;
100 assert(m_b_registered);
105 retval =
new Benchmark(p_engine, description_token);
119 assert(m_b_registered);
128 Benchmark::Benchmark(std::shared_ptr<Engine> p_engine,
136 hebench::Common::EventTimer timer;
137 hebench::Common::TimingReportEvent::Ptr p_timing_event;
138 std::uint64_t vector_size;
140 std::stringstream ss;
144 std::cout <<
IOS_MSG_INFO << hebench::Logging::GlobalLogger::log(
"Preparing workload.") << std::endl;
167 std::cout <<
IOS_MSG_INFO << hebench::Logging::GlobalLogger::log(
"Generating data...") << std::endl;
175 std::stringstream ss;
176 ss <<
"Loading data from external dataset: " << std::endl
178 std::cout <<
IOS_MSG_INFO << hebench::Logging::GlobalLogger::log(ss.str()) << std::endl;
184 this->getBenchmarkConfiguration().dataset_filename);
186 p_timing_event = timer.stop<std::milli>();
188 ss = std::stringstream();
189 ss <<
"Total data loaded: " << m_data->getTotalDataLoaded() <<
" bytes";
190 std::cout <<
IOS_MSG_DONE << hebench::Logging::GlobalLogger::log(ss.str()) << std::endl;
191 ss = std::stringstream();
192 ss <<
"Elapsed wall time: " << p_timing_event->elapsedWallTime<std::milli>() <<
" ms";
193 std::cout <<
IOS_MSG_INFO << hebench::Logging::GlobalLogger::log(ss.str()) << std::endl;
194 ss = std::stringstream();
195 ss <<
"Elapsed CPU time: " << p_timing_event->elapsedCPUTime<std::milli>() <<
" ms";
196 std::cout <<
IOS_MSG_INFO << hebench::Logging::GlobalLogger::log(ss.str()) << std::endl;
200 const std::uint64_t *param_data_pack_indices,
201 const std::vector<hebench::APIBridge::NativeDataBuffer *> &outputs,
const hebench::APIBridge::BenchmarkDescriptor & descriptor
Benchmark backend descriptor, as retrieved by backend, corresponding to the registration handle h_des...
Specifies a benchmark configuration.
std::vector< hebench::APIBridge::WorkloadParam > w_params
Set of arguments for workload parameters.
std::string dataset_filename
File containing data for the benchmark. If empty string, benchmarks that can auto generate the datase...
static bool registerSupportedBenchmark(std::shared_ptr< IBenchmarkDescriptor > p_desc_obj)
Registers a benchmark description object that represents one of the supported workloads.
Base class for workload benchmarks in the latency category.
Token returned by a successful call to IBenchmarkDescriptor::matchBenchmarkDescriptor().
std::shared_ptr< IDataLoader > Ptr
bool matchBenchmarkDescriptor(const hebench::APIBridge::BenchmarkDescriptor &bench_desc, const std::vector< hebench::APIBridge::WorkloadParam > &w_params) const override
Determines if the represented benchmark can perform the workload described by a specified HEBench ben...
void completeWorkloadDescription(WorkloadDescriptionOutput &output, const Engine &engine, const BenchmarkDescription::Backend &backend_desc, const BenchmarkDescription::Configuration &config) const override
Completes the description for the matched benchmark.
static constexpr std::uint64_t OpParameterCount
static constexpr std::uint64_t OpResultCount
static std::uint64_t fetchVectorSize(const std::vector< hebench::APIBridge::WorkloadParam > &w_params)
static constexpr std::size_t Index_W
static constexpr std::size_t Index_b
static constexpr std::size_t Index_X
static DataLoader::Ptr create(PolynomialDegree polynomial_degree, std::uint64_t vector_size, std::uint64_t batch_size_input, hebench::APIBridge::DataType data_type)
hebench::TestHarness::PartialBenchmark * createBenchmark(std::shared_ptr< Engine > p_engine, const DescriptionToken &description_token) override
Creates the represented IBenchmark object that can perform the workload specified by the HEBench benc...
void destroyBenchmark(hebench::TestHarness::PartialBenchmark *p_bench) override
Destroys an object returned by createBenchmark().
static constexpr std::uint64_t DefaultBatchSize
void completeWorkloadDescription(WorkloadDescriptionOutput &output, const Engine &engine, const BenchmarkDescription::Backend &backend_desc, const BenchmarkDescription::Configuration &config) const override
Completes the description for the matched benchmark.
bool matchBenchmarkDescriptor(const hebench::APIBridge::BenchmarkDescriptor &bench_desc, const std::vector< hebench::APIBridge::WorkloadParam > &w_params) const override
Determines if the represented benchmark can perform the workload described by a specified HEBench ben...
bool validateResult(IDataLoader::Ptr dataset, const std::uint64_t *param_data_pack_indices, const std::vector< hebench::APIBridge::NativeDataBuffer * > &p_outputs, hebench::APIBridge::DataType data_type) const override
Validates the result of an operation against the ground truth.
void init() override
Initializes the partial benchmark members.
virtual bool validateResult(IDataLoader::Ptr dataset, const std::uint64_t *param_data_pack_indices, const std::vector< hebench::APIBridge::NativeDataBuffer * > &outputs, hebench::APIBridge::DataType data_type) const
Validates the result of an operation against the ground truth.
std::string workload_header
Workload specific information to be added to the report header.
std::size_t operation_params_count
Number of parameters for the represented workload operation.
Bundles values that need to be filled by a workload during completeWorkloadDescription().
Base class for benchmarks.
const BenchmarkDescription::Backend & getBackendDescription() const
Allows read-only access to this benchmark backend description.
const BenchmarkDescription::Configuration & getBenchmarkConfiguration() const
Allows read-only access to this benchmark configuration.
DataType
Defines data types for a workload.
Category category
Category for the benchmark.
Workload workload
Workload for the benchmark.
@ LogisticRegression_PolyD3
@ LogisticRegression_PolyD7
@ LogisticRegression_PolyD5
Defines a benchmark test.
VectorSize LogisticRegression