Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertByteSliceToFloatSlice(transactionDataString []byte) []float32
- func ConvertSliceStringToFloat(transactionDataString []string) []float32
- func Float32bytes(float float32) []byte
- func RandReferenceData(n int) []float32
- func Uint64frombytes(bytes []byte) uint64
- type BenchmarkRunner
- func (b *BenchmarkRunner) DatabaseName() string
- func (b *BenchmarkRunner) DebugLevel() int
- func (b *BenchmarkRunner) DoPrintResponses() bool
- func (b *BenchmarkRunner) GetBufferedReader() *bufio.Reader
- func (b *BenchmarkRunner) GetOverallQuantiles(histogram *hdrhistogram.Histogram) map[string]interface{}
- func (l *BenchmarkRunner) GetOverallRatesMap(totalOps uint64, took time.Duration) map[string]interface{}
- func (b *BenchmarkRunner) IgnoreErrors() bool
- func (b *BenchmarkRunner) Run(queryPool *sync.Pool, processorCreateFn ProcessorCreate, rowSizeBytes int, ...)
- func (b *BenchmarkRunner) SetLimit(limit uint64)
- func (b *BenchmarkRunner) UseReferenceDataRedis() bool
- type LoadRunner
- type Loader
- type LoaderCreate
- type MetricCollector
- type MetricCollectorCreate
- type Processor
- type ProcessorCreate
- type RedisAI
- type Stat
- type TestResult
Constants ¶
const (
Inf = rate.Limit(math.MaxFloat64)
)
Variables ¶
var FormatString1 = "%s,%d\n"
var RedisAIPool = sync.Pool{ New: func() interface{} { return &RedisAI{ HumanLabel: make([]byte, 0, 1024), HumanDescription: make([]byte, 0, 1024), RedisQuery: make([]byte, 0, 1024), } }, }
RedisAIPool is a sync.Pool of RedisAI Query types
Functions ¶
func Float32bytes ¶
func RandReferenceData ¶
func Uint64frombytes ¶
Types ¶
type BenchmarkRunner ¶
type BenchmarkRunner struct { JsonOutFile string MetadataAutobatching int64 // contains filtered or unexported fields }
LoadRunner contains the common components for running a inference benchmarking program against a database.
func NewBenchmarkRunner ¶
func NewBenchmarkRunner() *BenchmarkRunner
NewLoadRunner creates a new instance of LoadRunner which is common functionality to be used by inference benchmarker programs
func (*BenchmarkRunner) DatabaseName ¶
func (b *BenchmarkRunner) DatabaseName() string
ModelName returns the name of the database to run queries against
func (*BenchmarkRunner) DebugLevel ¶
func (b *BenchmarkRunner) DebugLevel() int
DebugLevel returns the level of debug messages for this benchmark
func (*BenchmarkRunner) DoPrintResponses ¶
func (b *BenchmarkRunner) DoPrintResponses() bool
DoPrintResponses indicates whether responses for queries should be printed
func (*BenchmarkRunner) GetBufferedReader ¶
func (b *BenchmarkRunner) GetBufferedReader() *bufio.Reader
GetBufferedReader returns the buffered Reader that should be used by the loader
func (*BenchmarkRunner) GetOverallQuantiles ¶
func (b *BenchmarkRunner) GetOverallQuantiles(histogram *hdrhistogram.Histogram) map[string]interface{}
func (*BenchmarkRunner) GetOverallRatesMap ¶
func (l *BenchmarkRunner) GetOverallRatesMap(totalOps uint64, took time.Duration) map[string]interface{}
func (*BenchmarkRunner) IgnoreErrors ¶
func (b *BenchmarkRunner) IgnoreErrors() bool
func (*BenchmarkRunner) Run ¶
func (b *BenchmarkRunner) Run(queryPool *sync.Pool, processorCreateFn ProcessorCreate, rowSizeBytes int, inferencesPerRow int64, metricCollectorFn MetricCollectorCreate)
Run does the bulk of the benchmark execution. It launches a gorountine to track stats, creates workers to process queries, read in the input, execute the queries, and then does cleanup.
func (*BenchmarkRunner) SetLimit ¶
func (b *BenchmarkRunner) SetLimit(limit uint64)
SetLimit changes the number of queries to run, with 0 being all of them
func (*BenchmarkRunner) UseReferenceDataRedis ¶
func (b *BenchmarkRunner) UseReferenceDataRedis() bool
type LoadRunner ¶
type LoadRunner struct {
// contains filtered or unexported fields
}
LoadRunner contains the common components for running a inference benchmarking program against a database.
func NewLoadRunner ¶
func NewLoadRunner() *LoadRunner
NewLoadRunner creates a new instance of LoadRunner which is common functionality to be used by inference benchmarker programs
func (*LoadRunner) GetBufferedReader ¶
func (b *LoadRunner) GetBufferedReader() *bufio.Reader
GetBufferedReader returns the buffered Reader that should be used by the loader
func (*LoadRunner) RunLoad ¶
func (b *LoadRunner) RunLoad(queryPool *sync.Pool, LoaderCreateFn LoaderCreate, rowBenchmarkNBytes int)
Run does the bulk of the benchmark execution. It launches a gorountine to track stats, creates workers to process queries, read in the input, execute the queries, and then does cleanup.
func (*LoadRunner) SetLimit ¶
func (b *LoadRunner) SetLimit(limit uint64)
SetLimit changes the number of queries to run, with 0 being all of them
type Loader ¶
type Loader interface { // Init initializes at global state for the Loader, possibly based on its worker number / ID Init(workerNum int, wg *sync.WaitGroup) // ProcessInferenceQuery handles a given inference and reports its stats ProcessLoadQuery(q []byte, debug int) ([]*Stat, uint64, error) Close() }
Loader is an interface that handles the setup of a inference processing worker and executes queries one at a time
type LoaderCreate ¶
type LoaderCreate func() Loader
LoaderCreate is a function that creates a new Loader (called in Run)
type MetricCollector ¶
type MetricCollector interface { // CollectRunTimeMetrics asks the specific runner to fetch runtime stats that will then be stored on the results file. // Returns the collection timestamp and an interface with all fetched data CollectRunTimeMetrics() (int64, interface{}, error) }
MetricCollector is an interface that handles the metrics collection from the model server
type MetricCollectorCreate ¶
type MetricCollectorCreate func() MetricCollector
type Processor ¶
type Processor interface { // Init initializes at global state for the Loader, possibly based on its worker number / ID Init(workerNum int, totalWorkers int, wg *sync.WaitGroup, m chan uint64, rs chan uint64) // ProcessInferenceQuery handles a given inference and reports its stats ProcessInferenceQuery(q []byte, isWarm bool, workerNum int, useReferenceDataRedis bool, useReferenceDataMysql bool, queryNumber int64) ([]*Stat, error) // Close forces any work buffered to be sent to the DB being tested prior to going further Close() }
Processor is an interface that handles the setup of a inference processing worker and executes queries one at a time
type ProcessorCreate ¶
type ProcessorCreate func() Processor
LoaderCreate is a function that creates a new Loader (called in Run)
type RedisAI ¶
type RedisAI struct { HumanLabel []byte HumanDescription []byte RedisQuery []byte // contains filtered or unexported fields }
RedisAI encodes a RedisAI request. This will be serialized for use by the aibench_run_inference_redisai program.
func (*RedisAI) HumanDescriptionName ¶
HumanDescriptionName returns the human readable description of this Query
func (*RedisAI) HumanLabelName ¶
HumanLabelName returns the human readable name of this Query
type Stat ¶
type Stat struct {
// contains filtered or unexported fields
}
Stat represents one statistical measurement, typically used to store the latency of a inference (or part of inference).
type TestResult ¶
type TestResult struct { // Test Configs ResultFormatVersion string `json:"ResultFormatVersion"` Limit uint64 `json:"Limit"` MetadataAutobatching int64 `json:"MetadataAutobatching"` TensorBatchSize uint64 `json:"TensorBatchSize"` Workers uint `json:"Workers"` MaxRps uint64 `json:"MaxRps"` // Test Description TestDescription string `json:"TestDescription"` // DB Spefic Configs DBSpecificConfigs map[string]interface{} `json:"DBSpecificConfigs"` StartTime int64 `json:"StartTime` EndTime int64 `json:"EndTime"` DurationMillis int64 `json:"DurationMillis"` // Totals Totals map[string]interface{} `json:"Totals"` // Overall Rates OverallRates map[string]interface{} `json:"OverallRates"` OverallRatesIncludingWarmup map[string]interface{} `json:"OverallRatesIncludingWarmup"` // Overall Quantiles OverallQuantiles map[string]interface{} `json:"OverallQuantiles"` // Per second ( tick ) client stats ClientRunTimeStats map[int64]interface{} `json:"ClientRunTimeStats"` // Per second ( tick ) server stats ServerRunTimeStats map[int64]interface{} `json:"ServerRunTimeStats"` }