3
3
import torch
4
4
import torch .multiprocessing as mp
5
5
from ax .service .ax_client import AxClient , ObjectiveProperties
6
- from BO_acc_throughput import define_parameter_list
7
6
from utils import (
8
7
cal_model_size ,
9
8
cal_wikitext_ppl ,
@@ -174,12 +173,12 @@ def eval_in_parallel(
174
173
model , tokenizer = load_model (checkpoint , f"cuda:{ gpu_id } " )
175
174
176
175
print (f"Process { proc_id } on GPU { gpu_id } starts!" )
177
-
176
+ dict_config = dict ( config )
178
177
quantize_by_fqn_to_config (
179
- model = model , device = f"cuda:{ gpu_id } " , fqn_to_config = dict ( config )
178
+ model = model , device = f"cuda:{ gpu_id } " , fqn_to_config = dict_config
180
179
)
181
180
182
- eval_results = eval (model , tokenizer , num_PPL_eval_samples , config )
181
+ eval_results = eval (model , tokenizer , num_PPL_eval_samples , dict_config )
183
182
184
183
return_dict [proc_id ] = (trial_id , config , eval_results )
185
184
@@ -206,7 +205,7 @@ def run_parallel_BO(
206
205
initial_samples ,
207
206
):
208
207
# TODO: add default parameter list if not specified
209
- parameters_list = define_parameter_list ( )
208
+ parameters_list = load_parameters_from_json ( parameters_list )
210
209
initial_points_set = load_initial_samples (initial_samples )
211
210
num_BO_initial_samples = len (initial_points_set )
212
211
0 commit comments