Skip to content

Commit

Permalink
[DEBUG] Save Task pickle in translations cache (#380)
Browse files Browse the repository at this point in the history
Save `Task` pickle in the translations cache. 

The reason - it is very convenient during performance analysis to get
smaller test case. Supporting scripts will come soon
  • Loading branch information
vadiklyutiy authored Aug 1, 2024
1 parent 2320e0a commit ebbe5c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/hidet/drivers/build_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,11 @@ def build_task(task: Task, target='cuda', load=True) -> Optional[CompiledTask]:
# write task
with open(os.path.join(task_dir, 'task.txt'), 'w') as f:
f.write(task_string)

try:
hidet.save_task(task, os.path.join(task_dir, 'task.pickle'))
except Exception as e: # pylint: disable=broad-except, unused-variable
# Some object can not be serialized with pickle. Just ignore them.
pass
# write version
with open(version_path, 'w') as f:
f.write(hidet.__version__)
Expand Down

0 comments on commit ebbe5c5

Please sign in to comment.