Skip to content

Commit e52b66f

Browse files
committed
Minor fix.
1 parent fb0e8d1 commit e52b66f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

python/tvm/meta_schedule/task_scheduler/gradient_based.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@
3636

3737

3838
@register_func("meta_schedule.task_scheduler.derive_similarity_tag")
39-
def derive_similarity_tag(mod: IRModule, log_base: float = 1.618) -> str:
39+
def derive_similarity_tag(mod: IRModule) -> str:
4040
"""Get the tags for smilarity group creation
4141
4242
Parameters
4343
----------
4444
mod : IRModule
4545
The input workload.
46-
log_base : float
47-
The log base to normalize the flop count. Default natural (1.618).
4846
4947
Return
5048
------
@@ -57,7 +55,7 @@ def derive_similarity_tag(mod: IRModule, log_base: float = 1.618) -> str:
5755
ret += mod[var].attrs.meta_scheduler_task_scheduler_tag + "_"
5856
if ret:
5957
flop_count = _ffi_api.TaskSchedulerFlopCount(mod) # type: ignore # pylint: disable=no-member
60-
ret += "%d" % int(math.log(flop_count + 1, log_base))
58+
ret += "%d" % int(math.log(flop_count + 1, 1.618))
6159
return ret
6260

6361

src/meta_schedule/task_scheduler/gradient_based.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ class GradientBasedNode final : public TaskSchedulerNode {
7979
for (int i : task_groups[group_id]) {
8080
best_flops = std::max(best_flops, task_flop_counts[i] / task_best_latencies[i]);
8181
max_cnt[0] = task_cnts[i];
82-
std::sort(max_cnt, max_cnt + 3); // place the 2nd largest to #1
82+
std::sort(max_cnt, max_cnt + 3); // place the 2nd largest to middle position
8383
}
8484
double cur_flops = task_flop_counts[task_id] / task_best_latencies[task_id];
8585
// if we tune a task for many times but it still cannot achieve
8686
// a similar speed to the fastest one in its group, this means this task
8787
// is actually not similar to other tasks in its group.
88-
// So we will remove it from its original group.
88+
// So we will move it from the current group to a standalone group.
8989

9090
if (cur_flops < best_flops / beta && task_cnts[task_id] > 5 + max_cnt[1]) {
9191
task_groups[group_id].erase(task_id);

0 commit comments

Comments
 (0)