[GitHub] [tvm] merrymercy commented on a change in pull request #7197: [Fix][Autoscheduler] Costmodel enhancement & bug fix for graph debug runtime

2021-01-05 Thread GitBox


merrymercy commented on a change in pull request #7197:
URL: https://github.com/apache/tvm/pull/7197#discussion_r551763767



##
File path: python/tvm/auto_scheduler/cost_model/xgb_model.py
##
@@ -116,12 +117,17 @@ def __init__(self, verbose_eval=25, 
num_warmup_sample=100, seed=None):
 self.plan_size = 32
 self.num_warmup_sample = num_warmup_sample
 self.verbose_eval = verbose_eval
+self.model_file = model_file
+if model_file:
+logger.info("XGBModel: Load pretrained model from %s...", 
model_file)
+self.load(model_file)

Review comment:
   Remove this. No pytorch/sklearn model has api or behavior like this.
   Calling `model.load(model_file)` explicitly is cleaner than adding 
`model_file` to the constructor.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [tvm] merrymercy commented on a change in pull request #7197: [Fix][Autoscheduler] Costmodel enhancement & bug fix for graph debug runtime

2021-01-04 Thread GitBox


merrymercy commented on a change in pull request #7197:
URL: https://github.com/apache/tvm/pull/7197#discussion_r551763767



##
File path: python/tvm/auto_scheduler/cost_model/xgb_model.py
##
@@ -116,12 +117,17 @@ def __init__(self, verbose_eval=25, 
num_warmup_sample=100, seed=None):
 self.plan_size = 32
 self.num_warmup_sample = num_warmup_sample
 self.verbose_eval = verbose_eval
+self.model_file = model_file
+if model_file:
+logger.info("XGBModel: Load pretrained model from %s...", 
model_file)
+self.load(model_file)

Review comment:
   Remove this. No python/sklearn model has api or behavior like this.
   Calling `model.load(model_file)` explicitly is cleaner than adding 
`model_file` to the constructor.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [tvm] merrymercy commented on a change in pull request #7197: [Fix][Autoscheduler] Costmodel enhancement & bug fix for graph debug runtime

2021-01-04 Thread GitBox


merrymercy commented on a change in pull request #7197:
URL: https://github.com/apache/tvm/pull/7197#discussion_r551763123



##
File path: python/tvm/auto_scheduler/task_scheduler.py
##
@@ -82,11 +82,12 @@ def make_search_policies(
 if isinstance(search_policy, str):
 policy_type, model_type = search_policy.split(".")
 if model_type == "xgb":
-cost_model = XGBModel(num_warmup_sample=len(tasks) * 
num_measures_per_round)
-if load_model_file:
-logger.info("TaskScheduler: Load pretrained model...")
-cost_model.load(load_model_file)
-elif load_log_file:
+cost_model = XGBModel(
+num_warmup_sample=len(tasks) * num_measures_per_round,
+model_file=load_model_file,
+)
+if load_log_file:
+logger.info("TaskScheduler: Reload measured states and train 
the model...")

Review comment:
   `load_model_file` and `load_log_file` are mutually exclusive, because 
`update_from_file` will retrain a model and overwrite the loaded model.
   I think the old code is better.
   
   I don't know why the old code cannot satisfy your need.

##
File path: python/tvm/auto_scheduler/cost_model/xgb_model.py
##
@@ -141,6 +147,12 @@ def update(self, inputs, results):
 self.inputs.extend(inputs)
 self.results.extend(results)
 
+if len(self.inputs) - self.last_train_length < self.last_train_length 
/ 5:

Review comment:
   Add a new bool argument `adapative_training` as the switch of this 
feature. 

##
File path: python/tvm/auto_scheduler/cost_model/xgb_model.py
##
@@ -116,12 +117,17 @@ def __init__(self, verbose_eval=25, 
num_warmup_sample=100, seed=None):
 self.plan_size = 32
 self.num_warmup_sample = num_warmup_sample
 self.verbose_eval = verbose_eval
+self.model_file = model_file
+if model_file:
+logger.info("XGBModel: Load pretrained model from %s...", 
model_file)
+self.load(model_file)

Review comment:
   Remove this. No python/sklearn model has api or behavior like this.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org