diff --git a/prog/sched.go b/prog/sched.go index c8065685a..ebac50056 100644 --- a/prog/sched.go +++ b/prog/sched.go @@ -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() { diff --git a/syz-manager/manager.go b/syz-manager/manager.go index f36e0ede3..e4a65164b 100644 --- a/syz-manager/manager.go +++ b/syz-manager/manager.go @@ -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") } }() diff --git a/tools/model_manager/api/lang_model/data/targetSyscalls_5.10.134 b/tools/model_manager/api/lang_model/data/targetSyscalls similarity index 100% rename from tools/model_manager/api/lang_model/data/targetSyscalls_5.10.134 rename to tools/model_manager/api/lang_model/data/targetSyscalls diff --git a/tools/model_manager/api/views.py b/tools/model_manager/api/views.py index 7300eefe4..2978b9d5e 100644 --- a/tools/model_manager/api/views.py +++ b/tools/model_manager/api/views.py @@ -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) @@ -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