Skip to content

Commit

Permalink
introduce a fix to torch.compile not dumping graph IR
Browse files Browse the repository at this point in the history
  • Loading branch information
xinli-centml committed Apr 3, 2023
1 parent 05ea406 commit a1e8df0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/hidet/graph/frontend/torch/dynamo_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ def generate_executor(flow_graph: FlowGraph) -> Callable:
use_cuda_graph = dynamo_config['use_cuda_graph']
search_space = dynamo_config['search_space']
parallel_k = dynamo_config['parallel_k']
save_dir = dynamo_config['dump_graph_ir']

with PassContext() as ctx:
if use_fp16:
ctx.set_precision('float16')
if use_fp16 and use_fp16_reduction:
ctx.set_reduce_precision('float16')
if save_dir:
ctx.save_graph_instrument(save_dir)
ctx.set_parallel_k(disabled=(parallel_k == 'disabled'), search=(parallel_k == 'search'))
logger.info('start to optimize the flow graph')
graph_opt: FlowGraph = optimize(flow_graph)
Expand Down

0 comments on commit a1e8df0

Please sign in to comment.