25 #ifndef TVM_AUTO_SCHEDULER_MEASURE_RECORD_H_
26 #define TVM_AUTO_SCHEDULER_MEASURE_RECORD_H_
35 namespace auto_scheduler {
48 static constexpr
const char*
_type_key =
"auto_scheduler.RecordToFile";
93 static constexpr
const char*
_type_key =
"auto_scheduler.RecordReader";
98 std::string cur_line_;
135 std::string* log_version);
Bass class of measurement callbacks.
Definition: measure.h:211
Managed reference to MeasureCallbackNode.
Definition: measure.h:230
Store the results of a measurement.
Definition: measure.h:162
Log reader to load step logs from a file.
Definition: measure_record.h:68
bool ReadNext(MeasureInputNode *inp, MeasureResultNode *res)
Read next line in the log file.
static constexpr const char * _type_key
Definition: measure_record.h:93
TVM_DECLARE_FINAL_OBJECT_INFO(RecordReaderNode, Object)
std::pair< Array< MeasureInput >, Array< MeasureResult > > ReadLines(int max_size=-1, int skip_size=0)
Read multiple lines from the log file.
std::ifstream infile
The reading file stream.
Definition: measure_record.h:73
String filename
The name of input file.
Definition: measure_record.h:71
Managed reference to RecordReaderNode.
Definition: measure_record.h:105
RecordReader(String filename)
The constructor.
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(RecordReader, ObjectRef, RecordReaderNode)
Callback for logging the input and results of measurements to file.
Definition: measure_record.h:40
String filename
The name of output file.
Definition: measure_record.h:43
static constexpr const char * _type_key
Definition: measure_record.h:48
void Callback(const SearchPolicy &policy, const Array< MeasureInput > &inputs, const Array< MeasureResult > &results) final
Callback function that will be called on measurement input/result pairs after each measurement batch.
TVM_DECLARE_FINAL_OBJECT_INFO(RecordToFileNode, MeasureCallbackNode)
Managed reference to RecordToFileNode.
Definition: measure_record.h:56
RecordToFile(String filename)
The constructor.
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(RecordToFile, MeasureCallback, RecordToFileNode)
Managed reference to SearchPolicyNode.
Definition: search_policy.h:198
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Base class of all object reference.
Definition: object.h:519
base class of all object containers.
Definition: object.h:171
Reference to string objects.
Definition: string.h:98
Distributed measurement infrastructure to measure the runtime costs of tensor programs....
const std::string AUTO_SCHEDULER_LOG_VERSION
Definition: measure_record.h:37
void ReadMeasureRecord(const std::string &str, MeasureInputNode *inp, MeasureResultNode *res, std::string *log_version)
Read one measure record from a string.
void WriteMeasureRecords(std::ostream *os, const Array< MeasureInput > &inputs, const Array< MeasureResult > &results, const std::string log_version=AUTO_SCHEDULER_LOG_VERSION)
Append measure records to an output stream.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36