Skip to content

Commit

Permalink
[feat] go/syz-manager: extend waiting time
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ck1ng committed Nov 2, 2022
1 parent 722e78b commit e3b6b82
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion prog/sched.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (sch *Sched) Reset() {
atomic.StoreUint32(&sch.IntTotal[i], 0)
atomic.StoreUint32(&sch.weights[i], 5)
}
atomic.StoreUint32(&sch.weights[INSERT], 10)
// atomic.StoreUint32(&sch.weights[INSERT], 10)
}

func (sch *Sched) UpdateWeights() {
Expand Down
4 changes: 2 additions & 2 deletions syz-manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ func RunManager(cfg *mgrconfig.Config) {
// dumpSyscalls(mgr.cfg.Target.Syscalls)
go func() {
for {
time.Sleep(60 * time.Minute)
time.Sleep(4 * 60 * time.Minute)
modelPath := trainModel(mgr.cfg.Syzkaller, mgr.cfg.Workdir)
mgr.loadModel(modelPath, 1)
mgr.loadModel(modelPath, 0)
log.Logf(0, "model trained & updated")
}
}()
Expand Down
3 changes: 1 addition & 2 deletions tools/model_manager/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def model_train(request):

syscalls = read_syscalls(f"{settings.BASE_DIR}/api/lang_model/data/targetSyscalls")
corpus = read_corpus(corpus_dir)
print(corpus[0])

# syzcorpus_dir = '/data5/corpus/syzkaller_corpus'
# corpus = read_corpus(syzcorpus_dir)
Expand All @@ -60,7 +59,7 @@ def model_train(request):
train_loader = DataLoader(train_dataset, batch_size=64, shuffle=True)
test_loader = DataLoader(test_dataset, batch_size=64, shuffle=True)

device = torch.device("cuda:1" if torch.cuda.is_available() else "cpu")
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

num_epoch = 50
lr = 0.001
Expand Down

0 comments on commit e3b6b82

Please sign in to comment.