Skip to content

Commit

Permalink
[torch.compile] use size tuning for specific sizes (vllm-project#10933)
Browse files Browse the repository at this point in the history
Signed-off-by: youkaichao <youkaichao@gmail.com>
  • Loading branch information
youkaichao authored Dec 6, 2024
1 parent 9743d64 commit db87eb6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vllm/compilation/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ def wrap_inductor(graph,
if additional_inductor_config is not None:
current_config.update(additional_inductor_config)

if isinstance(runtime_shape, int):
# for a specific batchsize, tuning triton kernel parameters
# can be beneficial
current_config["max_autotune"] = True
current_config["coordinate_descent_tuning"] = True

# inductor can inplace modify the graph, so we need to copy it
# see https://github.com/pytorch/pytorch/issues/138980
graph = copy.deepcopy(graph)
Expand Down

0 comments on commit db87eb6

Please sign in to comment.