mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-07 14:21:55 +00:00
update
This commit is contained in:
parent
f167cdea32
commit
cf846eb25c
15
README.md
15
README.md
@ -61,3 +61,18 @@ GPU is occupied by which job(s)
|
|||||||
```
|
```
|
||||||
?action=debug_update_enable_pre_schedule_ratio&ratio=0.95
|
?action=debug_update_enable_pre_schedule_ratio&ratio=0.95
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**FeedDLData**
|
||||||
|
```
|
||||||
|
?action=debug_optimizer_feed_dl&job=lstm&seq=1&value=2
|
||||||
|
```
|
||||||
|
|
||||||
|
**TrainDL**
|
||||||
|
```
|
||||||
|
?action=debug_optimizer_train_dl&job=lstm
|
||||||
|
```
|
||||||
|
|
||||||
|
**PredictDL**
|
||||||
|
```
|
||||||
|
?action=debug_get_predict_dl&job=lstm&seq=1
|
||||||
|
```
|
40
src/main.go
40
src/main.go
@ -226,6 +226,46 @@ func serverAPI(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.Write(js)
|
w.Write(js)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
case "debug_optimizer_feed_dl":
|
||||||
|
log.Debug("debug_optimizer_feed_dl")
|
||||||
|
var job string
|
||||||
|
var seq int
|
||||||
|
var value int
|
||||||
|
job = r.URL.Query().Get("job")
|
||||||
|
if t, err := strconv.Atoi(r.URL.Query().Get("seq")); err != nil {
|
||||||
|
seq = t
|
||||||
|
}
|
||||||
|
if t, err := strconv.Atoi(r.URL.Query().Get("value")); err != nil {
|
||||||
|
value = t
|
||||||
|
}
|
||||||
|
InstanceOfOptimizer().feedData(job, seq, 0, 0, 0, value)
|
||||||
|
js, _ := json.Marshal(OptimizerJobExecutionTime{})
|
||||||
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
w.Write(js)
|
||||||
|
break
|
||||||
|
|
||||||
|
case "debug_optimizer_train_dl":
|
||||||
|
log.Debug("debug_optimizer_train_dl")
|
||||||
|
InstanceOfOptimizer().train(r.URL.Query().Get("job"))
|
||||||
|
js, _ := json.Marshal(OptimizerJobExecutionTime{})
|
||||||
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
w.Write(js)
|
||||||
|
break
|
||||||
|
|
||||||
|
case "debug_get_predict_dl":
|
||||||
|
log.Debug("debug_get_predict_dl")
|
||||||
|
if seq, err := strconv.Atoi(r.URL.Query().Get("seq")); err != nil {
|
||||||
|
est, _ := InstanceOfOptimizer().predict(r.URL.Query().Get("job"), seq)
|
||||||
|
js, _ := json.Marshal(est)
|
||||||
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
w.Write(js)
|
||||||
|
} else {
|
||||||
|
js, _ := json.Marshal(OptimizerJobExecutionTime{})
|
||||||
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
w.Write(js)
|
||||||
|
}
|
||||||
|
break
|
||||||
|
|
||||||
default:
|
default:
|
||||||
http.Error(w, "Not Found", http.StatusNotFound)
|
http.Error(w, "Not Found", http.StatusNotFound)
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user