-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vectorsearch training workload #333
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"settings": { | ||
"index": { | ||
{%- if train_index_primary_shards is defined and train_index_primary_shards %} | ||
"number_of_shards": {{ train_index_primary_shards }} | ||
{%- endif %} | ||
{%- if train_index_replica_shards is defined %} | ||
,"number_of_replicas": {{ train_index_replica_shards }} | ||
{%- endif %} | ||
} | ||
}, | ||
"mappings": { | ||
"properties": { | ||
"{{ train_field_name }}": { | ||
"type": "knn_vector", | ||
"dimension": {{ target_index_dimension }} | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"target_index_name": "target_index", | ||
"target_field_name": "target_field", | ||
"target_index_body": "indices/faiss-index.json", | ||
"target_index_primary_shards": 1, | ||
"target_index_dimension": 128, | ||
"target_index_space_type": "l2", | ||
"target_index_bulk_size": 100, | ||
"target_index_bulk_index_data_set_format": "hdf5", | ||
"target_index_bulk_index_data_set_path": "/tmp/sift-128-euclidean.hdf5", | ||
"target_index_bulk_indexing_clients": 10, | ||
|
||
"train_index_name": "train_index", | ||
"train_field_name": "train_field", | ||
"train_method_engine": "faiss", | ||
"train_index_body": "indices/train-index.json", | ||
"train_index_primary_shards": 1, | ||
"train_index_replica_shards": 1, | ||
|
||
"train_index_bulk_size": 100, | ||
"train_index_bulk_index_data_set_format": "hdf5", | ||
"train_index_bulk_index_data_set_path": "/tmp/sift-128-euclidean.hdf5", | ||
"train_index_bulk_indexing_clients": 10, | ||
"train_index_num_vectors": 1000, | ||
|
||
"train_model_id": "test-model", | ||
"train_operation_retries": 100, | ||
"train_operation_poll_period": 0.5, | ||
"train_search_size": 10000, | ||
|
||
"encoder": "pq", | ||
"faiss_encoder_code_size": 2, | ||
"faiss_encoder_m": 4, | ||
|
||
"target_index_max_num_segments": 1, | ||
"target_index_force_merge_timeout": 300, | ||
"hnsw_ef_search": 100, | ||
"hnsw_ef_construction": 100, | ||
"query_k": 100, | ||
"query_body": { | ||
"docvalue_fields" : ["_id"], | ||
"stored_fields" : "_none_" | ||
}, | ||
|
||
"query_data_set_format": "hdf5", | ||
"query_data_set_path":"/tmp/sift-128-euclidean.hdf5", | ||
"query_count": 100 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"target_index_name": "target_index", | ||
"target_field_name": "target_field", | ||
"target_index_body": "indices/faiss-index.json", | ||
"target_index_primary_shards": 1, | ||
"target_index_dimension": 128, | ||
"target_index_space_type": "l2", | ||
"target_index_bulk_size": 100, | ||
"target_index_bulk_index_data_set_format": "hdf5", | ||
"target_index_bulk_index_data_set_path": "/tmp/sift-128-euclidean.hdf5", | ||
"target_index_bulk_indexing_clients": 10, | ||
|
||
"train_index_name": "train_index", | ||
"train_field_name": "train_field", | ||
"train_method_engine": "faiss", | ||
"train_index_body": "indices/train-index.json", | ||
"train_index_primary_shards": 1, | ||
"train_index_replica_shards": 1, | ||
|
||
"train_index_bulk_size": 100, | ||
"train_index_bulk_index_data_set_format": "hdf5", | ||
"train_index_bulk_index_data_set_path": "/tmp/sift-128-euclidean.hdf5", | ||
"train_index_bulk_indexing_clients": 10, | ||
"train_index_num_vectors": 1000, | ||
|
||
"train_model_id": "test-model", | ||
"train_operation_retries": 100, | ||
"train_operation_poll_period": 0.5, | ||
"train_search_size": 10000, | ||
|
||
"encoder": "sq", | ||
"faiss_encoder_type": "fp16", | ||
"faiss_encoder_clip": false, | ||
|
||
"target_index_max_num_segments": 1, | ||
"target_index_force_merge_timeout": 300, | ||
"hnsw_ef_search": 100, | ||
"hnsw_ef_construction": 100, | ||
"query_k": 100, | ||
"query_body": { | ||
"docvalue_fields" : ["_id"], | ||
"stored_fields" : "_none_" | ||
}, | ||
|
||
"query_data_set_format": "hdf5", | ||
"query_data_set_path":"/tmp/sift-128-euclidean.hdf5", | ||
"query_count": 100 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"target_index_name": "target_index", | ||
"target_field_name": "target_field", | ||
"target_index_body": "indices/faiss-index.json", | ||
"target_index_primary_shards": 1, | ||
"target_index_dimension": 128, | ||
"target_index_space_type": "l2", | ||
"target_index_bulk_size": 100, | ||
"target_index_bulk_index_data_set_format": "hdf5", | ||
"target_index_bulk_index_data_set_path": "/tmp/sift-128-euclidean.hdf5", | ||
"target_index_bulk_indexing_clients": 10, | ||
|
||
"train_index_name": "train_index", | ||
"train_field_name": "train_field", | ||
"train_method_engine": "faiss", | ||
"train_index_body": "indices/train-index.json", | ||
"train_index_primary_shards": 1, | ||
"train_index_replica_shards": 1, | ||
|
||
"train_index_bulk_size": 100, | ||
"train_index_bulk_index_data_set_format": "hdf5", | ||
"train_index_bulk_index_data_set_path": "/tmp/sift-128-euclidean.hdf5", | ||
"train_index_bulk_indexing_clients": 10, | ||
"train_index_num_vectors": 1000, | ||
|
||
"train_model_id": "test-model", | ||
"train_operation_retries": 100, | ||
"train_operation_poll_period": 0.5, | ||
"train_search_size": 10000, | ||
|
||
"target_index_max_num_segments": 1, | ||
"target_index_force_merge_timeout": 300, | ||
"hnsw_ef_search": 100, | ||
"hnsw_ef_construction": 100, | ||
"query_k": 100, | ||
"query_body": { | ||
"docvalue_fields" : ["_id"], | ||
"stored_fields" : "_none_" | ||
}, | ||
|
||
"query_data_set_format": "hdf5", | ||
"query_data_set_path":"/tmp/sift-128-euclidean.hdf5", | ||
"query_count": 100 | ||
} |
34 changes: 34 additions & 0 deletions
34
vectorsearch/test_procedures/common/train-index-only-schedule.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"operation": { | ||
"name": "delete-train-index", | ||
"operation-type": "delete-index", | ||
"only-if-exists": true, | ||
"index": "{{ train_index_name | default('train_index') }}" | ||
} | ||
}, | ||
{ | ||
"operation": { | ||
"name": "create-train-index", | ||
"operation-type": "create-index", | ||
"index": "{{ train_index_name | default('train_index') }}" | ||
} | ||
}, | ||
{ | ||
"operation": { | ||
"name": "custom-vector-bulk-train", | ||
"operation-type": "bulk-vector-data-set", | ||
"index": "{{ train_index_name | default('train_index') }}", | ||
"field": "{{ train_field_name | default('train_field') }}", | ||
"bulk_size": {{ train_index_bulk_size | default(500)}}, | ||
"data_set_format": "{{ train_index_bulk_index_data_set_format | default('hdf5') }}", | ||
"data_set_path": "{{ train_index_bulk_index_data_set_path }}", | ||
"data_set_corpus": "{{ train_index_bulk_index_data_set_corpus }}", | ||
"num_vectors": {{ train_index_num_vectors | default(-1) }}, | ||
"id-field-name": "_id" | ||
}, | ||
"clients": {{ train_index_bulk_indexing_clients | default(1)}} | ||
}, | ||
{ | ||
"name" : "refresh-train-index", | ||
"operation" : "refresh-train-index" | ||
} |
75 changes: 75 additions & 0 deletions
75
vectorsearch/test_procedures/common/train-model-schedule.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"operation": { | ||
"operation-type": "delete-knn-model", | ||
"name": "delete-model", | ||
"model_id": "{{ train_model_id }}", | ||
"ignore-if-model-does-not-exist": true | ||
} | ||
}, | ||
{ | ||
"operation": { | ||
"name": "train-knn-model", | ||
"operation-type": "train-knn-model", | ||
"body": { | ||
"training_index": "{{ train_index_name | default('train_index') }}", | ||
"training_field": "{{ train_field_name | default('train_field') }}", | ||
"search_size": "{{ train_search_size | default(10000) }}", | ||
"dimension": {{ target_index_dimension }}, | ||
{%- if train_max_vector_count is defined and train_max_vector_count %} | ||
"max_training_vector_count": "{{ train_max_vector_count }}", | ||
{%- endif %} | ||
"method": { | ||
"name": "{{ train_method_name | default('ivf') }}", | ||
"engine": "{{ train_method_engine | default('faiss') }}", | ||
"space_type": "{{ target_index_space_type | default('l2') }}", | ||
"parameters": { | ||
{%- if faiss_nlist is defined and faiss_nlist %} | ||
"nlist": {{ faiss_nlist }} | ||
{%- endif %} | ||
|
||
{%- if faiss_nprobes is defined and faiss_nprobes %} | ||
{%- if faiss_nlist is defined and faiss_nlist %} | ||
, | ||
{%- endif %} | ||
"nprobes": {{ faiss_nprobes}} | ||
{%- endif %} | ||
|
||
{%- if encoder is defined and encoder %} | ||
{%- if faiss_nprobes is defined and faiss_nprobes %} | ||
, | ||
{%- endif %} | ||
"encoder": { | ||
"name": "{{ encoder }}", | ||
"parameters": { | ||
{%- if faiss_encoder_code_size is defined and faiss_encoder_code_size %} | ||
"code_size": {{ faiss_encoder_code_size }} | ||
{%- endif %} | ||
|
||
{%- if faiss_encoder_m is defined and faiss_encoder_m %} | ||
{%- if faiss_encoder_code_size is defined and faiss_encoder_code_size %} | ||
, | ||
{%- endif %} | ||
"m": {{ faiss_encoder_m }} | ||
{%- endif %} | ||
|
||
{%- if faiss_encoder_type is defined and faiss_encoder_type %} | ||
"type": "{{ faiss_encoder_type }}" | ||
{%- endif %} | ||
|
||
{%- if faiss_encoder_clip is defined and faiss_encoder_clip %} | ||
{%- if faiss_encoder_type is defined and faiss_encoder_type %} | ||
, | ||
{%- endif %} | ||
"clip": "{{ faiss_encoder_clip }}" | ||
{%- endif %} | ||
} | ||
} | ||
{%- endif %} | ||
} | ||
} | ||
}, | ||
"model_id": "{{ train_model_id | default('train_model') }}", | ||
"retries": {{ train_operation_retries | default(1000) }}, | ||
"poll_period": {{ train_operation_poll_period | default(0.5) }} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling out here that this
target-index
param is not used anywhere in the workload, but it's necessary due to OSB validation. I'm not sure what the solution is, but I opened an issue about this.