@daocloud-proto/hydra 0.11.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin-api/core/v1alpha1/core.pb.ts +59 -0
- package/admin-api/guardrails/v1alpha1/guardrails.pb.ts +180 -0
- package/admin-api/maas/v1alpha1/maas.pb.ts +3 -0
- package/admin-api/model/v1alpha1/model.pb.ts +51 -0
- package/admin-api/model/v1alpha1/model_weights_volume.pb.ts +96 -0
- package/admin-api/storage/v1alpha1/filesstorage.pb.ts +261 -0
- package/admin-api/workspace-quota/v1alpha1/workspace_quota.pb.ts +61 -0
- package/common/common.pb.ts +55 -0
- package/common/errorcode.ts +2 -2
- package/management-api/agent/v1alpha1/event.pb.ts +59 -0
- package/management-api/agent/v1alpha1/server_registration.pb.ts +33 -0
- package/management-api/agent/v1alpha1/sftp_user.pb.ts +39 -0
- package/management-api/apikey/v1alpha1/apikey.pb.ts +70 -2
- package/management-api/cluster/v1alpha1/cluster.pb.ts +28 -0
- package/management-api/core/v1alpha1/image.pb.ts +174 -0
- package/management-api/core/v1alpha1/management.pb.ts +17 -0
- package/management-api/core/v1alpha1/permissions.pb.ts +33 -11
- package/management-api/dataset/v1alpha1/dataset.pb.ts +110 -0
- package/management-api/dataset/v1alpha1/dataset_volume.pb.ts +107 -0
- package/management-api/event/v1alpha1/event.pb.ts +38 -0
- package/management-api/finetune/v1alpha1/common.pb.ts +14 -0
- package/management-api/finetune/v1alpha1/evaljob.pb.ts +130 -0
- package/management-api/finetune/v1alpha1/export_job.pb.ts +89 -0
- package/management-api/finetune/v1alpha1/finetuneconfig.pb.ts +239 -0
- package/management-api/finetune/v1alpha1/finetunejob.pb.ts +107 -0
- package/management-api/model/v1alpha1/model.pb.ts +114 -9
- package/management-api/model/v1alpha1/model_weights_volume.pb.ts +101 -0
- package/management-api/model_serving/v1alpha1/model_serving.pb.ts +103 -5
- package/management-api/model_type/v1alpha1/model_type.pb.ts +20 -0
- package/management-api/queue/v1alpha1/queue.pb.ts +121 -0
- package/management-api/storage/v1alpha1/filesstorage.pb.ts +495 -0
- package/management-api/workspace/v1alpha1/workspace.pb.ts +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as HydraCommonCommon from "../../../common/common.pb"
|
|
8
|
+
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
9
|
+
|
|
10
|
+
export enum EventObjKind {
|
|
11
|
+
KIND_UNSPECIFIED = "KIND_UNSPECIFIED",
|
|
12
|
+
DATASET = "DATASET",
|
|
13
|
+
POD = "POD",
|
|
14
|
+
UNKNOWN = "UNKNOWN",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum EventType {
|
|
18
|
+
TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
|
|
19
|
+
NORMAL = "NORMAL",
|
|
20
|
+
WARNING = "WARNING",
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type Event = {
|
|
24
|
+
objKind?: EventObjKind
|
|
25
|
+
objName?: string
|
|
26
|
+
objNamespace?: string
|
|
27
|
+
type?: EventType
|
|
28
|
+
message?: string
|
|
29
|
+
reason?: string
|
|
30
|
+
firstTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
31
|
+
lastTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
32
|
+
count?: number
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type ListEventsResponse = {
|
|
36
|
+
items?: Event[]
|
|
37
|
+
page?: HydraCommonCommon.Pagination
|
|
38
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export enum JobStatus {
|
|
8
|
+
UNKNOWN = "UNKNOWN",
|
|
9
|
+
PENDING = "PENDING",
|
|
10
|
+
RUNNING = "RUNNING",
|
|
11
|
+
COMPLETED = "COMPLETED",
|
|
12
|
+
FAILED = "FAILED",
|
|
13
|
+
DELETING = "DELETING",
|
|
14
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as HydraCommonCommon from "../../../common/common.pb"
|
|
8
|
+
import * as fm from "../../../fetch.pb"
|
|
9
|
+
import * as GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
|
|
10
|
+
import * as GoogleProtobufStruct from "../../../google/protobuf/struct.pb"
|
|
11
|
+
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
12
|
+
import * as HydraManagement_apiFinetuneV1alpha1Common from "./common.pb"
|
|
13
|
+
import * as HydraManagement_apiFinetuneV1alpha1Finetuneconfig from "./finetuneconfig.pb"
|
|
14
|
+
|
|
15
|
+
type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
|
|
16
|
+
type OneOf<T> =
|
|
17
|
+
| { [k in keyof T]?: undefined }
|
|
18
|
+
| (
|
|
19
|
+
keyof T extends infer K ?
|
|
20
|
+
(K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
|
|
21
|
+
: never)
|
|
22
|
+
: never);
|
|
23
|
+
export type EvalJob = {
|
|
24
|
+
id?: string
|
|
25
|
+
name?: string
|
|
26
|
+
workspace?: number
|
|
27
|
+
cluster?: string
|
|
28
|
+
namespace?: string
|
|
29
|
+
resources?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.ResourceConfig
|
|
30
|
+
finetuneConfigName?: string
|
|
31
|
+
finetuneJobName?: string
|
|
32
|
+
finetuneJobId?: string
|
|
33
|
+
datasetId?: string
|
|
34
|
+
datasetVolumeId?: string
|
|
35
|
+
cutoffLen?: number
|
|
36
|
+
maxSamples?: number
|
|
37
|
+
overwriteCache?: boolean
|
|
38
|
+
preprocessingNumWorkers?: number
|
|
39
|
+
perDeviceEvalBatchSize?: number
|
|
40
|
+
predictWithGenerate?: boolean
|
|
41
|
+
ddpTimeout?: string
|
|
42
|
+
phase?: HydraManagement_apiFinetuneV1alpha1Common.JobStatus
|
|
43
|
+
reason?: string
|
|
44
|
+
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
45
|
+
completionTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
46
|
+
datasetName?: string
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/* hydra modified */ export type BaseCreateWSEvalJobRequest = {
|
|
51
|
+
workspace?: number
|
|
52
|
+
name?: string
|
|
53
|
+
cluster?: string
|
|
54
|
+
namespace?: string
|
|
55
|
+
resources?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.ResourceConfig
|
|
56
|
+
finetuneConfigName?: string
|
|
57
|
+
finetuneJobName?: string
|
|
58
|
+
datasetId?: string
|
|
59
|
+
datasetVolumeId?: string
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type CreateWSEvalJobRequest = BaseCreateWSEvalJobRequest
|
|
63
|
+
& OneOf<{ cutoffLen: number }>
|
|
64
|
+
& OneOf<{ maxSamples: number }>
|
|
65
|
+
& OneOf<{ overwriteCache: boolean }>
|
|
66
|
+
& OneOf<{ preprocessingNumWorkers: number }>
|
|
67
|
+
& OneOf<{ perDeviceEvalBatchSize: number }>
|
|
68
|
+
& OneOf<{ predictWithGenerate: boolean }>
|
|
69
|
+
& OneOf<{ ddpTimeout: string }>
|
|
70
|
+
|
|
71
|
+
export type GetWSEvalJobRequest = {
|
|
72
|
+
workspace?: number
|
|
73
|
+
cluster?: string
|
|
74
|
+
namespace?: string
|
|
75
|
+
name?: string
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type ListWSEvalJobsRequest = {
|
|
79
|
+
workspace?: number
|
|
80
|
+
cluster?: string
|
|
81
|
+
namespace?: string
|
|
82
|
+
page?: HydraCommonCommon.Pagination
|
|
83
|
+
finetuneJobId?: string
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type ListWSEvalJobsResponse = {
|
|
87
|
+
items?: EvalJob[]
|
|
88
|
+
page?: HydraCommonCommon.Pagination
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type DeleteWSEvalJobRequest = {
|
|
92
|
+
workspace?: number
|
|
93
|
+
cluster?: string
|
|
94
|
+
namespace?: string
|
|
95
|
+
id?: string
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type GetWSEvalMetricsRequest = {
|
|
99
|
+
workspace?: number
|
|
100
|
+
id?: string
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type GetWSEvalMetricsResponse = {
|
|
104
|
+
metrics?: GoogleProtobufStruct.Struct
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export type DefaultEvalJobRequest = {
|
|
108
|
+
workspace?: number
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export class WSEvalJobManagement {
|
|
112
|
+
static CreateWSEvalJob(req: CreateWSEvalJobRequest, initReq?: fm.InitReq): Promise<EvalJob> {
|
|
113
|
+
return fm.fetchReq<CreateWSEvalJobRequest, EvalJob>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/finetune-evaljobs`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
114
|
+
}
|
|
115
|
+
static GetWSEvalJob(req: GetWSEvalJobRequest, initReq?: fm.InitReq): Promise<EvalJob> {
|
|
116
|
+
return fm.fetchReq<GetWSEvalJobRequest, EvalJob>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/finetune-evaljobs/${req["name"]}?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
117
|
+
}
|
|
118
|
+
static ListWSEvalJobs(req: ListWSEvalJobsRequest, initReq?: fm.InitReq): Promise<ListWSEvalJobsResponse> {
|
|
119
|
+
return fm.fetchReq<ListWSEvalJobsRequest, ListWSEvalJobsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/finetune-evaljobs?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace"])}`, {...initReq, method: "GET"})
|
|
120
|
+
}
|
|
121
|
+
static DeleteWSEvalJob(req: DeleteWSEvalJobRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
122
|
+
return fm.fetchReq<DeleteWSEvalJobRequest, GoogleProtobufEmpty.Empty>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/finetune-evaljobs/${req["id"]}`, {...initReq, method: "DELETE"})
|
|
123
|
+
}
|
|
124
|
+
static DefaultEvalJob(req: DefaultEvalJobRequest, initReq?: fm.InitReq): Promise<EvalJob> {
|
|
125
|
+
return fm.fetchReq<DefaultEvalJobRequest, EvalJob>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune-evaljobs:default?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
126
|
+
}
|
|
127
|
+
static GetWSEvalMetrics(req: GetWSEvalMetricsRequest, initReq?: fm.InitReq): Promise<GetWSEvalMetricsResponse> {
|
|
128
|
+
return fm.fetchReq<GetWSEvalMetricsRequest, GetWSEvalMetricsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune-evaljobs/${req["id"]}/metrics?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as HydraCommonCommon from "../../../common/common.pb"
|
|
8
|
+
import * as fm from "../../../fetch.pb"
|
|
9
|
+
import * as GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
|
|
10
|
+
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
11
|
+
import * as HydraManagement_apiFinetuneV1alpha1Common from "./common.pb"
|
|
12
|
+
|
|
13
|
+
export enum ExportDevice {
|
|
14
|
+
cpu = "cpu",
|
|
15
|
+
auto = "auto",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type ExportJob = {
|
|
19
|
+
workspace?: number
|
|
20
|
+
name?: string
|
|
21
|
+
cluster?: string
|
|
22
|
+
namespace?: string
|
|
23
|
+
finetuneConfigName?: string
|
|
24
|
+
finetuneJobName?: string
|
|
25
|
+
filesStorageName?: string
|
|
26
|
+
exportSubdir?: string
|
|
27
|
+
exportSize?: number
|
|
28
|
+
exportDevice?: ExportDevice
|
|
29
|
+
exportLegacyFormat?: boolean
|
|
30
|
+
status?: HydraManagement_apiFinetuneV1alpha1Common.JobStatus
|
|
31
|
+
reason?: string
|
|
32
|
+
creationTime?: GoogleProtobufTimestamp.Timestamp
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type SaveExportJobRequest = {
|
|
36
|
+
workspace?: number
|
|
37
|
+
name?: string
|
|
38
|
+
cluster?: string
|
|
39
|
+
namespace?: string
|
|
40
|
+
finetuneConfigName?: string
|
|
41
|
+
finetuneJobName?: string
|
|
42
|
+
filesStorageName?: string
|
|
43
|
+
exportSubdir?: string
|
|
44
|
+
exportSize?: number
|
|
45
|
+
exportDevice?: ExportDevice
|
|
46
|
+
exportLegacyFormat?: boolean
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type SingleExportJobRequest = {
|
|
50
|
+
workspace?: number
|
|
51
|
+
cluster?: string
|
|
52
|
+
namespace?: string
|
|
53
|
+
name?: string
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type ListExportJobRequest = {
|
|
57
|
+
workspace?: number
|
|
58
|
+
cluster?: string
|
|
59
|
+
namespace?: string
|
|
60
|
+
page?: HydraCommonCommon.Pagination
|
|
61
|
+
finetuneJobId?: string
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type ListExportJobResponse = {
|
|
65
|
+
exportJobs?: ExportJob[]
|
|
66
|
+
page?: HydraCommonCommon.Pagination
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type DefaultExportJobRequest = {
|
|
70
|
+
workspace?: number
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export class WSExportJobService {
|
|
74
|
+
static CreatExportJob(req: SaveExportJobRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
75
|
+
return fm.fetchReq<SaveExportJobRequest, GoogleProtobufEmpty.Empty>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/finetune-exportjobs`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
76
|
+
}
|
|
77
|
+
static DeleteExportJob(req: SingleExportJobRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
78
|
+
return fm.fetchReq<SingleExportJobRequest, GoogleProtobufEmpty.Empty>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/finetune-exportjobs/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
79
|
+
}
|
|
80
|
+
static DefaultExportJob(req: DefaultExportJobRequest, initReq?: fm.InitReq): Promise<ExportJob> {
|
|
81
|
+
return fm.fetchReq<DefaultExportJobRequest, ExportJob>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune-exportjobs:default?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
82
|
+
}
|
|
83
|
+
static GetExportJob(req: SingleExportJobRequest, initReq?: fm.InitReq): Promise<ExportJob> {
|
|
84
|
+
return fm.fetchReq<SingleExportJobRequest, ExportJob>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/finetune-exportjobs/${req["name"]}?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
85
|
+
}
|
|
86
|
+
static ListExportJob(req: ListExportJobRequest, initReq?: fm.InitReq): Promise<ListExportJobResponse> {
|
|
87
|
+
return fm.fetchReq<ListExportJobRequest, ListExportJobResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/finetune-exportjobs?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace"])}`, {...initReq, method: "GET"})
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as HydraCommonCommon from "../../../common/common.pb"
|
|
8
|
+
import * as fm from "../../../fetch.pb"
|
|
9
|
+
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
10
|
+
|
|
11
|
+
type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
|
|
12
|
+
type OneOf<T> =
|
|
13
|
+
| { [k in keyof T]?: undefined }
|
|
14
|
+
| (
|
|
15
|
+
keyof T extends infer K ?
|
|
16
|
+
(K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
|
|
17
|
+
: never)
|
|
18
|
+
: never);
|
|
19
|
+
|
|
20
|
+
export enum TrainingStage {
|
|
21
|
+
TRAINING_STAGE_UNSPECIFIED = "TRAINING_STAGE_UNSPECIFIED",
|
|
22
|
+
SFT = "SFT",
|
|
23
|
+
DPO = "DPO",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export enum FineTuningType {
|
|
27
|
+
FINE_TUNING_TYPE_UNSPECIFIED = "FINE_TUNING_TYPE_UNSPECIFIED",
|
|
28
|
+
LORA = "LORA",
|
|
29
|
+
FULL = "FULL",
|
|
30
|
+
FREEZE = "FREEZE",
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export enum ComputeType {
|
|
34
|
+
COMPUTE_TYPE_UNSPECIFIED = "COMPUTE_TYPE_UNSPECIFIED",
|
|
35
|
+
BF16 = "BF16",
|
|
36
|
+
FP16 = "FP16",
|
|
37
|
+
FP32 = "FP32",
|
|
38
|
+
PURE_BF16 = "PURE_BF16",
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export enum LrSchedulerType {
|
|
42
|
+
LR_SCHEDULER_TYPE_UNSPECIFIED = "LR_SCHEDULER_TYPE_UNSPECIFIED",
|
|
43
|
+
COSINE = "COSINE",
|
|
44
|
+
LINEAR = "LINEAR",
|
|
45
|
+
COSINE_WITH_RESTARTS = "COSINE_WITH_RESTARTS",
|
|
46
|
+
POLYNOMIAL = "POLYNOMIAL",
|
|
47
|
+
CONSTANT = "CONSTANT",
|
|
48
|
+
CONSTANT_WITH_WARMUP = "CONSTANT_WITH_WARMUP",
|
|
49
|
+
INVERSE_SQRT = "INVERSE_SQRT",
|
|
50
|
+
REDUCE_LR_ON_PLATEAU = "REDUCE_LR_ON_PLATEAU",
|
|
51
|
+
COSINE_WITH_MIN_LR = "COSINE_WITH_MIN_LR",
|
|
52
|
+
WARMUP_STABLE_DECAY = "WARMUP_STABLE_DECAY",
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export enum OptimizerType {
|
|
56
|
+
OPTIMIZER_TYPE_UNSPECIFIED = "OPTIMIZER_TYPE_UNSPECIFIED",
|
|
57
|
+
ADAMW_TORCH = "ADAMW_TORCH",
|
|
58
|
+
ADAMW_HF = "ADAMW_HF",
|
|
59
|
+
SGD = "SGD",
|
|
60
|
+
ADAFACTOR = "ADAFACTOR",
|
|
61
|
+
ADAGRAD = "ADAGRAD",
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export enum QuantizationMethodType {
|
|
65
|
+
QUANTIZATION_METHOD_TYPE_UNSPECIFIED = "QUANTIZATION_METHOD_TYPE_UNSPECIFIED",
|
|
66
|
+
BITSANDBYTES = "BITSANDBYTES",
|
|
67
|
+
HQQ = "HQQ",
|
|
68
|
+
EETQ = "EETQ",
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type ModelConfig = {
|
|
72
|
+
modelId?: string
|
|
73
|
+
modelVolumeId?: string
|
|
74
|
+
template?: string
|
|
75
|
+
trustRemoteCode?: boolean
|
|
76
|
+
modelName?: string
|
|
77
|
+
modelAvatar?: string
|
|
78
|
+
modelTag?: string
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type LoraConfig = {
|
|
82
|
+
loraRank?: number
|
|
83
|
+
loraAlpha?: number
|
|
84
|
+
loraDropout?: number
|
|
85
|
+
loraTarget?: string
|
|
86
|
+
additionalTarget?: string
|
|
87
|
+
loraPlusLrRatio?: number
|
|
88
|
+
loraPlusLrEmbedding?: number
|
|
89
|
+
useRslora?: boolean
|
|
90
|
+
useDora?: boolean
|
|
91
|
+
pissaInit?: boolean
|
|
92
|
+
pissaIter?: number
|
|
93
|
+
pissaConvert?: boolean
|
|
94
|
+
createNewAdapter?: boolean
|
|
95
|
+
quantizationBit?: number
|
|
96
|
+
quantizationMethod?: QuantizationMethodType
|
|
97
|
+
ropeScaling?: string
|
|
98
|
+
booster?: string
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type DatasetConfig = {
|
|
102
|
+
datasetId?: string
|
|
103
|
+
datasetVolumeId?: string
|
|
104
|
+
cutoffLen?: number
|
|
105
|
+
maxSamples?: number
|
|
106
|
+
valSize?: number
|
|
107
|
+
datasetName?: string
|
|
108
|
+
datasetTag?: string
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export type TrainingConfig = {
|
|
112
|
+
numTrainEpochs?: number
|
|
113
|
+
perDeviceTrainBatchSize?: number
|
|
114
|
+
gradientAccumulationSteps?: number
|
|
115
|
+
learningRate?: number
|
|
116
|
+
lrSchedulerType?: LrSchedulerType
|
|
117
|
+
warmupRatio?: number
|
|
118
|
+
warmupSteps?: number
|
|
119
|
+
computeType?: ComputeType
|
|
120
|
+
optimizer?: OptimizerType
|
|
121
|
+
seed?: number
|
|
122
|
+
ddpTimeout?: number
|
|
123
|
+
maxGradNorm?: number
|
|
124
|
+
neftAlpha?: number
|
|
125
|
+
deepspeedStage?: number
|
|
126
|
+
deepspeedOffload?: boolean
|
|
127
|
+
gradientCheckpointing?: boolean
|
|
128
|
+
loggingSteps?: number
|
|
129
|
+
saveSteps?: number
|
|
130
|
+
outputSubPath?: string
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export type DpoConfig = {
|
|
134
|
+
prefBeta?: number
|
|
135
|
+
prefLoss?: string
|
|
136
|
+
prefFtx?: number
|
|
137
|
+
dpoLabelSmoothing?: number
|
|
138
|
+
refModel?: string
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
/* hydra modified */ export type BaseResourceConfig = {
|
|
143
|
+
gpuType?: string
|
|
144
|
+
gpuCount?: number
|
|
145
|
+
cpu?: number
|
|
146
|
+
memory?: number
|
|
147
|
+
perGpuMemory?: number
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type ResourceConfig = BaseResourceConfig
|
|
151
|
+
& OneOf<{ gpuCores: number }>
|
|
152
|
+
|
|
153
|
+
export type FineTuneConfig = {
|
|
154
|
+
name?: string
|
|
155
|
+
cluster?: string
|
|
156
|
+
namespace?: string
|
|
157
|
+
stage?: TrainingStage
|
|
158
|
+
finetuningType?: FineTuningType
|
|
159
|
+
model?: ModelConfig
|
|
160
|
+
lora?: LoraConfig
|
|
161
|
+
dataset?: DatasetConfig
|
|
162
|
+
training?: TrainingConfig
|
|
163
|
+
dpo?: DpoConfig
|
|
164
|
+
resources?: ResourceConfig
|
|
165
|
+
createdAt?: GoogleProtobufTimestamp.Timestamp
|
|
166
|
+
updatedAt?: GoogleProtobufTimestamp.Timestamp
|
|
167
|
+
modelSource?: boolean
|
|
168
|
+
workspace?: number
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export type CreateWSFineTuneConfigRequest = {
|
|
172
|
+
workspace?: number
|
|
173
|
+
cluster?: string
|
|
174
|
+
namespace?: string
|
|
175
|
+
name?: string
|
|
176
|
+
stage?: TrainingStage
|
|
177
|
+
finetuningType?: FineTuningType
|
|
178
|
+
model?: ModelConfig
|
|
179
|
+
lora?: LoraConfig
|
|
180
|
+
dataset?: DatasetConfig
|
|
181
|
+
training?: TrainingConfig
|
|
182
|
+
dpo?: DpoConfig
|
|
183
|
+
resources?: ResourceConfig
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export type UpdateWSFineTuneConfigRequest = {
|
|
187
|
+
workspace?: number
|
|
188
|
+
cluster?: string
|
|
189
|
+
namespace?: string
|
|
190
|
+
name?: string
|
|
191
|
+
stage?: TrainingStage
|
|
192
|
+
finetuningType?: FineTuningType
|
|
193
|
+
model?: ModelConfig
|
|
194
|
+
lora?: LoraConfig
|
|
195
|
+
dataset?: DatasetConfig
|
|
196
|
+
training?: TrainingConfig
|
|
197
|
+
dpo?: DpoConfig
|
|
198
|
+
resources?: ResourceConfig
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export type GetWSFineTuneConfigRequest = {
|
|
202
|
+
workspace?: number
|
|
203
|
+
name?: string
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export type ListWSFineTuneConfigsRequest = {
|
|
207
|
+
workspace?: number
|
|
208
|
+
cluster?: string
|
|
209
|
+
page?: HydraCommonCommon.Pagination
|
|
210
|
+
datasetId?: string
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export type ListWSFineTuneConfigsResponse = {
|
|
214
|
+
items?: FineTuneConfig[]
|
|
215
|
+
page?: HydraCommonCommon.Pagination
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export type DeleteWSFineTuneConfigRequest = {
|
|
219
|
+
workspace?: number
|
|
220
|
+
name?: string
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export class WSFineTuneConfigManagement {
|
|
224
|
+
static CreateWSFineTuneConfig(req: CreateWSFineTuneConfigRequest, initReq?: fm.InitReq): Promise<FineTuneConfig> {
|
|
225
|
+
return fm.fetchReq<CreateWSFineTuneConfigRequest, FineTuneConfig>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
226
|
+
}
|
|
227
|
+
static UpdateWSFineTuneConfig(req: UpdateWSFineTuneConfigRequest, initReq?: fm.InitReq): Promise<FineTuneConfig> {
|
|
228
|
+
return fm.fetchReq<UpdateWSFineTuneConfigRequest, FineTuneConfig>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs/${req["name"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
229
|
+
}
|
|
230
|
+
static GetWSFineTuneConfig(req: GetWSFineTuneConfigRequest, initReq?: fm.InitReq): Promise<FineTuneConfig> {
|
|
231
|
+
return fm.fetchReq<GetWSFineTuneConfigRequest, FineTuneConfig>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs/${req["name"]}?${fm.renderURLSearchParams(req, ["workspace", "name"])}`, {...initReq, method: "GET"})
|
|
232
|
+
}
|
|
233
|
+
static ListWSFineTuneConfigs(req: ListWSFineTuneConfigsRequest, initReq?: fm.InitReq): Promise<ListWSFineTuneConfigsResponse> {
|
|
234
|
+
return fm.fetchReq<ListWSFineTuneConfigsRequest, ListWSFineTuneConfigsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
235
|
+
}
|
|
236
|
+
static DeleteWSFineTuneConfig(req: DeleteWSFineTuneConfigRequest, initReq?: fm.InitReq): Promise<FineTuneConfig> {
|
|
237
|
+
return fm.fetchReq<DeleteWSFineTuneConfigRequest, FineTuneConfig>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
238
|
+
}
|
|
239
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as HydraCommonCommon from "../../../common/common.pb"
|
|
8
|
+
import * as fm from "../../../fetch.pb"
|
|
9
|
+
import * as GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
|
|
10
|
+
import * as GoogleProtobufStruct from "../../../google/protobuf/struct.pb"
|
|
11
|
+
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
12
|
+
import * as HydraManagement_apiFinetuneV1alpha1Common from "./common.pb"
|
|
13
|
+
import * as HydraManagement_apiFinetuneV1alpha1Finetuneconfig from "./finetuneconfig.pb"
|
|
14
|
+
|
|
15
|
+
type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
|
|
16
|
+
type OneOf<T> =
|
|
17
|
+
| { [k in keyof T]?: undefined }
|
|
18
|
+
| (
|
|
19
|
+
keyof T extends infer K ?
|
|
20
|
+
(K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
|
|
21
|
+
: never)
|
|
22
|
+
: never);
|
|
23
|
+
|
|
24
|
+
/* hydra modified */ export type BaseMetricPoint = {
|
|
25
|
+
currentSteps?: number
|
|
26
|
+
totalSteps?: number
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type MetricPoint = BaseMetricPoint
|
|
30
|
+
& OneOf<{ loss: number }>
|
|
31
|
+
& OneOf<{ evalLoss: number }>
|
|
32
|
+
& OneOf<{ predictLoss: number }>
|
|
33
|
+
& OneOf<{ reward: number }>
|
|
34
|
+
& OneOf<{ accuracy: number }>
|
|
35
|
+
& OneOf<{ lr: number }>
|
|
36
|
+
& OneOf<{ epoch: number }>
|
|
37
|
+
& OneOf<{ percentage: number }>
|
|
38
|
+
& OneOf<{ elapsedTime: string }>
|
|
39
|
+
& OneOf<{ remainingTime: string }>
|
|
40
|
+
|
|
41
|
+
export type FineTuneJob = {
|
|
42
|
+
id?: string
|
|
43
|
+
name?: string
|
|
44
|
+
configName?: string
|
|
45
|
+
status?: HydraManagement_apiFinetuneV1alpha1Common.JobStatus
|
|
46
|
+
cluster?: string
|
|
47
|
+
namespace?: string
|
|
48
|
+
storageSpec?: GoogleProtobufStruct.Struct
|
|
49
|
+
resourceConfig?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.ResourceConfig
|
|
50
|
+
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
51
|
+
completionTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
52
|
+
metrics?: MetricPoint[]
|
|
53
|
+
trainingParams?: GoogleProtobufStruct.Struct
|
|
54
|
+
metadata?: GoogleProtobufStruct.Struct
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type CreateWSFineTuneJobRequest = {
|
|
58
|
+
workspace?: number
|
|
59
|
+
cluster?: string
|
|
60
|
+
namespace?: string
|
|
61
|
+
name?: string
|
|
62
|
+
stage?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.TrainingStage
|
|
63
|
+
finetuningType?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.FineTuningType
|
|
64
|
+
model?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.ModelConfig
|
|
65
|
+
lora?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.LoraConfig
|
|
66
|
+
dataset?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.DatasetConfig
|
|
67
|
+
training?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.TrainingConfig
|
|
68
|
+
dpo?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.DpoConfig
|
|
69
|
+
resources?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.ResourceConfig
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type GetWSFineTuneJobRequest = {
|
|
73
|
+
workspace?: number
|
|
74
|
+
id?: string
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type ListWSFineTuneJobsRequest = {
|
|
78
|
+
workspace?: number
|
|
79
|
+
cluster?: string
|
|
80
|
+
namespace?: string
|
|
81
|
+
page?: HydraCommonCommon.Pagination
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type ListWSFineTuneJobsResponse = {
|
|
85
|
+
items?: FineTuneJob[]
|
|
86
|
+
page?: HydraCommonCommon.Pagination
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type DeleteWSFineTuneJobRequest = {
|
|
90
|
+
workspace?: number
|
|
91
|
+
id?: string
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export class WSFineTuneJobManagement {
|
|
95
|
+
static CreateWSFineTuneJob(req: CreateWSFineTuneJobRequest, initReq?: fm.InitReq): Promise<FineTuneJob> {
|
|
96
|
+
return fm.fetchReq<CreateWSFineTuneJobRequest, FineTuneJob>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune/jobs`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
97
|
+
}
|
|
98
|
+
static GetWSFineTuneJob(req: GetWSFineTuneJobRequest, initReq?: fm.InitReq): Promise<FineTuneJob> {
|
|
99
|
+
return fm.fetchReq<GetWSFineTuneJobRequest, FineTuneJob>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune/jobs/${req["id"]}?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
|
|
100
|
+
}
|
|
101
|
+
static ListWSFineTuneJobs(req: ListWSFineTuneJobsRequest, initReq?: fm.InitReq): Promise<ListWSFineTuneJobsResponse> {
|
|
102
|
+
return fm.fetchReq<ListWSFineTuneJobsRequest, ListWSFineTuneJobsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune/jobs?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
103
|
+
}
|
|
104
|
+
static DeleteWSFineTuneJob(req: DeleteWSFineTuneJobRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
105
|
+
return fm.fetchReq<DeleteWSFineTuneJobRequest, GoogleProtobufEmpty.Empty>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune/jobs/${req["id"]}`, {...initReq, method: "DELETE"})
|
|
106
|
+
}
|
|
107
|
+
}
|