1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-06-07 14:21:55 +00:00
This commit is contained in:
Newnius 2020-05-02 21:09:25 +08:00
parent f167cdea32
commit cf846eb25c
2 changed files with 55 additions and 0 deletions

View File

@ -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
```

View File

@ -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