Skip to content

Commit

Permalink
♻️ remove dimension from con-bench
Browse files Browse the repository at this point in the history
Signed-off-by: vankichi <[email protected]>
  • Loading branch information
vankichi committed Feb 20, 2024
1 parent 0506a28 commit 48764d0
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 44 deletions.
3 changes: 0 additions & 3 deletions charts/vald-benchmark-operator/crds/valdbenchmarkjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,6 @@ spec:
- indexes
- group
- range
dimension:
type: integer
minimum: 1
global_config:
type: object
properties:
Expand Down
3 changes: 0 additions & 3 deletions charts/vald-benchmark-operator/schemas/job-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ dataset:
# @schema {"name": "dataset.url", "type": "string"}
# dataset.url -- the dataset url which is used for executing benchmark job with user defined hdf5 file
url: ""
# @schema {"name": "dimension", "type": "integer", "minimum": 1}
# dimension -- vector dimension
dimension: 784
# @schema {"name": "replica", "type": "integer", "minimum": 1}
# replica -- the number of running concurrency job
replica: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:
range:
start: 1
end: 1000
dimension: 784
replica: 1
repetition: 1
job_type: "search"
Expand Down
1 change: 0 additions & 1 deletion charts/vald-benchmark-operator/values/benchmark-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ spec:
start: 1
end: 1000
job_type: "search"
dimension: 784
repetition: 1
replica: 1
rules: []
Expand Down
8 changes: 0 additions & 8 deletions charts/vald-benchmark-operator/values/benchmark-scenario.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ spec:
jobs:
# @schema {"name": "jobs.items.dataset", "type": "object"}
- job_type: "insert"
dimension: 784
repetition: 1
replica: 1
rules: []
Expand All @@ -62,7 +61,6 @@ spec:
health_check_duration: "10s"
rps: 500
- job_type: "update"
dimension: 784
repetition: 1
replica: 1
rules: []
Expand All @@ -79,7 +77,6 @@ spec:
health_check_duration: "10s"
rps: 500
- job_type: "search"
dimension: 784
repetition: 1
replica: 1
rules: []
Expand All @@ -94,7 +91,6 @@ spec:
health_check_duration: "10s"
rps: 2000
- job_type: "upsert"
dimension: 784
repetition: 1
replica: 1
rules: []
Expand All @@ -111,7 +107,6 @@ spec:
health_check_duration: "10s"
rps: 1000
- job_type: "search"
dimension: 784
repetition: 2
replica: 1
rules: []
Expand All @@ -133,7 +128,6 @@ spec:
health_check_duration: "10s"
rps: 4000
- job_type: "exists"
dimension: 784
repetition: 1
replica: 1
rules: []
Expand All @@ -148,7 +142,6 @@ spec:
health_check_duration: "10s"
rps: 1000
- job_type: "getobject"
dimension: 784
repetition: 1
replica: 1
rules: []
Expand All @@ -163,7 +156,6 @@ spec:
health_check_duration: "10s"
rps: 1000
- job_type: "remove"
dimension: 784
repetition: 1
replica: 1
rules: []
Expand Down
1 change: 0 additions & 1 deletion docs/performance/continuos-benchmatk.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ And, Benchmark Operator also applies it to the Kubernetes cluster based on `Vald
| :------------------------- | :-------- | :-------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- |
| target | \* | target Vald cluster | object | ref: [target](#target-prop) |
| dataset | \* | dataset information | object | ref: [dataset](#dataset-prop) |
| dimension | \* | dimension of vector | integer | 784 |
| job_type | \* | execute job type | string enum: [insert, update, upsert, remove, search, getobject, exists] | search |
| repetition | | the number of job repetitions<BR>default: `1` | integer | 1 |
| replica | | the number of job concurrent job executions<BR>default: `1` | integer | 2 |
Expand Down
1 change: 0 additions & 1 deletion internal/config/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package config
type BenchmarkJob struct {
Target *BenchmarkTarget `json:"target,omitempty" yaml:"target"`
Dataset *BenchmarkDataset `json:"dataset,omitempty" yaml:"dataset"`
Dimension int `json:"dimension,omitempty" yaml:"dimension"`
Replica int `json:"replica,omitempty" yaml:"replica"`
Repetition int `json:"repetition,omitempty" yaml:"repetition"`
JobType string `json:"job_type,omitempty" yaml:"job_type"`
Expand Down
1 change: 0 additions & 1 deletion internal/k8s/vald/benchmark/api/v1/job_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type BenchmarkJobSpec struct {
ServerConfig *config.Servers `json:"server_config,omitempty" yaml:"server_config"`
Target *BenchmarkTarget `json:"target,omitempty" yaml:"target"`
Dataset *BenchmarkDataset `json:"dataset,omitempty" yaml:"dataset"`
Dimension int `json:"dimension,omitempty" yaml:"dimension"`
Replica int `json:"replica,omitempty" yaml:"replica"`
Repetition int `json:"repetition,omitempty" yaml:"repetition"`
JobType string `json:"job_type,omitempty" yaml:"job_type"`
Expand Down
3 changes: 0 additions & 3 deletions k8s/tools/benchmark/operator/crds/valdbenchmarkjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,6 @@ spec:
- indexes
- group
- range
dimension:
type: integer
minimum: 1
global_config:
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion pkg/tools/benchmark/job/service/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func (jt jobType) String() string {

type job struct {
eg errgroup.Group
dimension int
dataset *config.BenchmarkDataset
jobType jobType
jobFunc func(context.Context, chan error) error
Expand Down
12 changes: 0 additions & 12 deletions pkg/tools/benchmark/job/service/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,11 @@ import (
type Option func(j *job) error

var defaultOpts = []Option{
// TODO: set default config for client
WithDimension(784),
WithBeforeJobDuration("30s"),
WithRPS(1000),
WithConcurencyLimit(200),
}

// WithDimension sets the vector's dimension for running benchmark job with dataset.
func WithDimension(dim int) Option {
return func(j *job) error {
if dim > 0 {
j.dimension = dim
}
return nil
}
}

// WithInsertConfig sets the insert API config for running insert request job.
func WithInsertConfig(c *config.InsertConfig) Option {
return func(j *job) error {
Expand Down
8 changes: 0 additions & 8 deletions pkg/tools/benchmark/job/service/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ func (j *job) search(ctx context.Context, ech chan error) error {
}
// idx is the modulo, which takes between <0, len(vecs)-1>.
idx := (iter - 1) % len(vecs)
if len(vecs[idx]) != j.dimension {
log.Warn("len(vecs) ", len(vecs[iter]), "is not matched with ", j.dimension)
return nil
}
res, err := j.client.Search(egctx, &payload.Search_Request{
Vector: vecs[idx],
Config: cfg,
Expand Down Expand Up @@ -121,10 +117,6 @@ func (j *job) search(ctx context.Context, ech chan error) error {
log.Debugf("[benchmark job] Start linear search: iter = %d", iter)
// idx is the modulo, which takes between <0, len(vecs)-1>.
idx := (iter - 1) % len(vecs)
if len(vecs[idx]) != j.dimension {
log.Warn("len(vecs) ", len(vecs[idx]), "is not matched with ", j.dimension)
return nil
}
res, err := j.client.LinearSearch(egctx, &payload.Search_Request{
Vector: vecs[idx],
Config: cfg,
Expand Down
1 change: 0 additions & 1 deletion pkg/tools/benchmark/job/usecase/benchmarkd.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ func New(cfg *config.Config) (r runner.Runner, err error) {
service.WithValdClient(vcli),
service.WithDataset(cfg.Job.Dataset),
service.WithJobTypeByString(cfg.Job.JobType),
service.WithDimension(cfg.Job.Dimension),
service.WithInsertConfig(cfg.Job.InsertConfig),
service.WithUpdateConfig(cfg.Job.UpdateConfig),
service.WithUpsertConfig(cfg.Job.UpsertConfig),
Expand Down

0 comments on commit 48764d0

Please sign in to comment.