Skip to content
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

Update sdk to support f16/bf16 #330

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions core/backup_impl_create_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ type collectionStruct struct {

// parse collections to backup
// For backward compatibility:
// 1,parse dbCollections first,
// 2,if dbCollections not set, use collectionNames
//
// 1,parse dbCollections first,
// 2,if dbCollections not set, use collectionNames
func (b *BackupContext) parseBackupCollections(request *backuppb.CreateBackupRequest) ([]collectionStruct, error) {
log.Debug("Request collection names",
zap.Strings("request_collection_names", request.GetCollectionNames()),
Expand Down Expand Up @@ -275,7 +276,7 @@ func (b *BackupContext) backupCollectionPrepare(ctx context.Context, levelInfo *
continue
} else {
indexInfo := &backuppb.IndexInfo{
FieldName: index.FieldName(),
FieldName: field.Name,
IndexName: index.Name(),
IndexType: string(index.IndexType()),
Params: index.Params(),
Expand Down
4 changes: 2 additions & 2 deletions core/backup_impl_restore_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ func (b *BackupContext) executeRestoreCollectionTask(ctx context.Context, backup
// auto index only support index_type and metric_type in params
params["index_type"] = "AUTOINDEX"
params["metric_type"] = index.GetParams()["metric_type"]
idx = entity.NewGenericIndex(index.GetIndexName(), entity.AUTOINDEX, index.GetFieldName(), params)
idx = entity.NewGenericIndex(index.GetIndexName(), entity.AUTOINDEX, params)
} else {
log.Info("not auto index")
indexType := index.GetIndexType()
Expand All @@ -534,7 +534,7 @@ func (b *BackupContext) executeRestoreCollectionTask(ctx context.Context, backup
if params["index_type"] == "marisa-trie" {
params["index_type"] = "Trie"
}
idx = entity.NewGenericIndex(index.GetIndexName(), entity.IndexType(indexType), index.GetFieldName(), index.GetParams())
idx = entity.NewGenericIndex(index.GetIndexName(), entity.IndexType(indexType), index.GetParams())
}
err := b.getMilvusClient().CreateIndex(ctx, targetDBName, targetCollectionName, index.GetFieldName(), idx, true)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions core/proto/backup.proto
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ enum DataType {

BinaryVector = 100;
FloatVector = 101;
Float16Vector = 102;
BFloat16Vector = 103;
SparseFloatVector = 104;
}

enum FieldState {
Expand Down
448 changes: 230 additions & 218 deletions core/proto/backuppb/backup.pb.go

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,10 @@ const docTemplate = `{
22,
23,
100,
101
101,
102,
103,
104
],
"x-enum-varnames": [
"DataType_None",
Expand All @@ -551,7 +554,10 @@ const docTemplate = `{
"DataType_Array",
"DataType_Json",
"DataType_BinaryVector",
"DataType_FloatVector"
"DataType_FloatVector",
"DataType_Float16Vector",
"DataType_BFloat16Vector",
"DataType_SparseFloatVector"
]
},
"backuppb.DeleteBackupResponse": {
Expand Down Expand Up @@ -1051,7 +1057,7 @@ const docTemplate = `{
"type": "object",
"properties": {
"data": {
"description": "Types that are valid to be assigned to Data:\n\t*ValueField_BoolData\n\t*ValueField_IntData\n\t*ValueField_LongData\n\t*ValueField_FloatData\n\t*ValueField_DoubleData\n\t*ValueField_StringData\n\t*ValueField_BytesData"
"description": "Types that are valid to be assigned to Data:\n\n\t*ValueField_BoolData\n\t*ValueField_IntData\n\t*ValueField_LongData\n\t*ValueField_FloatData\n\t*ValueField_DoubleData\n\t*ValueField_StringData\n\t*ValueField_BytesData"
}
}
}
Expand Down
12 changes: 9 additions & 3 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,10 @@
22,
23,
100,
101
101,
102,
103,
104
],
"x-enum-varnames": [
"DataType_None",
Expand All @@ -543,7 +546,10 @@
"DataType_Array",
"DataType_Json",
"DataType_BinaryVector",
"DataType_FloatVector"
"DataType_FloatVector",
"DataType_Float16Vector",
"DataType_BFloat16Vector",
"DataType_SparseFloatVector"
]
},
"backuppb.DeleteBackupResponse": {
Expand Down Expand Up @@ -1043,7 +1049,7 @@
"type": "object",
"properties": {
"data": {
"description": "Types that are valid to be assigned to Data:\n\t*ValueField_BoolData\n\t*ValueField_IntData\n\t*ValueField_LongData\n\t*ValueField_FloatData\n\t*ValueField_DoubleData\n\t*ValueField_StringData\n\t*ValueField_BytesData"
"description": "Types that are valid to be assigned to Data:\n\n\t*ValueField_BoolData\n\t*ValueField_IntData\n\t*ValueField_LongData\n\t*ValueField_FloatData\n\t*ValueField_DoubleData\n\t*ValueField_StringData\n\t*ValueField_BytesData"
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ definitions:
- 23
- 100
- 101
- 102
- 103
- 104
type: integer
x-enum-varnames:
- DataType_None
Expand All @@ -219,6 +222,9 @@ definitions:
- DataType_Json
- DataType_BinaryVector
- DataType_FloatVector
- DataType_Float16Vector
- DataType_BFloat16Vector
- DataType_SparseFloatVector
backuppb.DeleteBackupResponse:
properties:
code:
Expand Down Expand Up @@ -570,7 +576,7 @@ definitions:
backuppb.ValueField:
properties:
data:
description: "Types that are valid to be assigned to Data:\n\t*ValueField_BoolData\n\t*ValueField_IntData\n\t*ValueField_LongData\n\t*ValueField_FloatData\n\t*ValueField_DoubleData\n\t*ValueField_StringData\n\t*ValueField_BytesData"
description: "Types that are valid to be assigned to Data:\n\n\t*ValueField_BoolData\n\t*ValueField_IntData\n\t*ValueField_LongData\n\t*ValueField_FloatData\n\t*ValueField_DoubleData\n\t*ValueField_StringData\n\t*ValueField_BytesData"
type: object
info:
contact:
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/google/uuid v1.3.0
github.com/json-iterator/go v1.1.12
github.com/lingdor/stackerror v0.0.0-20191119040541-976d8885ed76
github.com/milvus-io/milvus-sdk-go/v2 v2.3.0
github.com/milvus-io/milvus-sdk-go/v2 v2.4.0
github.com/minio/minio-go/v7 v7.0.61
github.com/pkg/errors v0.9.1
github.com/samber/lo v1.39.0
Expand Down Expand Up @@ -78,7 +78,7 @@ require (
github.com/magiconair/properties v1.8.5 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/milvus-io/milvus-proto/go-api/v2 v2.3.6 // indirect
github.com/milvus-io/milvus-proto/go-api/v2 v2.4.0 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
Expand Down Expand Up @@ -116,4 +116,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/milvus-io/milvus-sdk-go/v2 => github.com/wayblink/milvus-sdk-go/v2 v2.3.6-beta3
//replace github.com/milvus-io/milvus-sdk-go/v2 => github.com/wayblink/milvus-sdk-go/v2 v2.3.0-beta4.0.20240429062752-f02992b0ed88
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,10 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5
github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8=
github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/milvus-io/milvus-proto/go-api/v2 v2.3.6 h1:dvjukoX5NvoX4Q3oHWXb8gi+l1/WuxQ8BaqazqzlCHg=
github.com/milvus-io/milvus-proto/go-api/v2 v2.3.6/go.mod h1:1OIl0v5PQeNxIJhCvY+K55CBUOYDZevw9g9380u1Wek=
github.com/milvus-io/milvus-proto/go-api/v2 v2.4.0 h1:9KsyZR+neMlRvV52C5sIsLB13jthT2AY/+buyiNjcCg=
github.com/milvus-io/milvus-proto/go-api/v2 v2.4.0/go.mod h1:1OIl0v5PQeNxIJhCvY+K55CBUOYDZevw9g9380u1Wek=
github.com/milvus-io/milvus-sdk-go/v2 v2.4.0 h1:llESmiYiaFqRh0CUrZCLH0IWWkk5r8/vz0tkaA0YzQo=
github.com/milvus-io/milvus-sdk-go/v2 v2.4.0/go.mod h1:8IKyxVV+kd+RADMuMpo8GXnTDq5ZxrSSWpe9nJieboQ=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
github.com/minio/minio-go/v7 v7.0.61 h1:87c+x8J3jxQ5VUGimV9oHdpjsAvy3fhneEBKuoKEVUI=
Expand Down Expand Up @@ -574,8 +576,6 @@ github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBn
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
github.com/wayblink/milvus-sdk-go/v2 v2.3.6-beta3 h1:Lu8A/KGpOzyyD1aHX4TzHfXcEfyFZAG8XxV+PxQbRYU=
github.com/wayblink/milvus-sdk-go/v2 v2.3.6-beta3/go.mod h1:QimM7ujrxHPhKgKkpgRA0zdRTRAe+AIJb79E6NO7Hqo=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
Expand Down
Loading