Skip to content

Commit

Permalink
[Fixbug] Clear the intermediate object files for kernel tuning (#339)
Browse files Browse the repository at this point in the history
This PR clears the intermediate object files generated during tuning.

This should reduce 2/3 cache size without hurting any functionality. 

#338
  • Loading branch information
yaoyaoding authored Aug 2, 2023
1 parent 1eb41ad commit a395fb1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/hidet/drivers/build_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import re
import os
import json
import shutil
from hashlib import sha256
from typing import List, Optional, Tuple

Expand Down Expand Up @@ -162,6 +163,10 @@ def launch(arg: meta.types(param_types)):
# build task ir module
build_ir_module(ir_module=task_ir_module, output_dir=task_dir, output_kind='.so', target=target)

# clear the candidate object files that are no longer needed
if not hidet.option.get_option('debug_cache_tuning'):
shutil.rmtree(os.path.join(task_dir, 'candidates'), ignore_errors=True)


def generate_meta_data(task: Task, task_dir: str, build_target: str, num_candidates: int):
from hidet.ir.compute import TensorNode
Expand Down

0 comments on commit a395fb1

Please sign in to comment.