commands
zeus.optimizer.batch_size.server.job.commands
Commands to use JobStateRepository
.
UpdateExpDefaultBs
Bases: BaseModel
Parameters to update the exploration default batch size.
Attributes:
Name | Type | Description |
---|---|---|
job_id |
str
|
Job Id. |
exp_default_batch_size |
int
|
new default batch size to use. |
Source code in zeus/optimizer/batch_size/server/job/commands.py
15 16 17 18 19 20 21 22 23 24 |
|
UpdateJobStage
Bases: BaseModel
Parameters to update the job stage.
Attributes:
Name | Type | Description |
---|---|---|
job_id |
str
|
Job Id. |
stage |
Stage
|
Set it to MAB since we only go from Pruning to MAB. |
Source code in zeus/optimizer/batch_size/server/job/commands.py
27 28 29 30 31 32 33 34 35 36 |
|
UpdateGeneratorState
Bases: BaseModel
Parameters to update the generator state.
Attributes:
Name | Type | Description |
---|---|---|
job_id |
str
|
Job Id. |
state |
str
|
Generator state. |
Source code in zeus/optimizer/batch_size/server/job/commands.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
_validate_state
_validate_state(state)
Validate the sanity of state.
Source code in zeus/optimizer/batch_size/server/job/commands.py
50 51 52 53 54 55 56 57 |
|
UpdateJobMinCost
Bases: BaseModel
Parameters to update the min training cost and corresponding batch size.
Attributes:
Name | Type | Description |
---|---|---|
job_id |
str
|
Job Id. |
min_cost |
float
|
Min training cost. |
min_cost_batch_size |
int
|
Corresponding batch size. |
Source code in zeus/optimizer/batch_size/server/job/commands.py
60 61 62 63 64 65 66 67 68 69 70 71 |
|
CreateJob
Parameters to create a new job.
Attributes:
Name | Type | Description |
---|---|---|
exp_default_batch_size |
int
|
Exploration default batch size that is used during Pruning stage. |
min_cost |
None
|
Min training cost observed. Initially, None. |
min_cost_batch_size |
int
|
Batch size that has minimum training cost observed. |
stage |
Stage
|
Stage of the job. |
mab_random_generator_state |
Optional[str]
|
Generator state if mab_seed is not None. Otherwise, None. |
For the rest of attributes, refer to JobParams
[zeus.optimizer.batch_size.common.JobParams] and GpuConfig
[zeus.optimizer.batch_size.common.GpuConfig]
Source code in zeus/optimizer/batch_size/server/job/commands.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
|
Config
Model configuration.
Make it immutable after creation.
Source code in zeus/optimizer/batch_size/server/job/commands.py
93 94 95 96 97 98 99 |
|
_validate_states
_validate_states(values)
Validate Job states.
We are checking, - If mab seed and generator state is matching. - If default, exp_default, min batch sizes are correctly intialized. - If default batch size is in the list of batch sizes.
Source code in zeus/optimizer/batch_size/server/job/commands.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
from_job_config
classmethod
from_job_config(js)
From JobConfig, instantiate CreateJob
.
Initialize generator state, exp_default_batch_size, and min_cost_batch_size.
Source code in zeus/optimizer/batch_size/server/job/commands.py
137 138 139 140 141 142 143 144 145 146 147 148 149 |
|
to_orm
to_orm()
Convert pydantic model CreateJob
to ORM object Job.
Source code in zeus/optimizer/batch_size/server/job/commands.py
151 152 153 154 155 156 157 158 159 160 161 |
|