Skip to content

Commit

Permalink
add cinn flag
Browse files Browse the repository at this point in the history
  • Loading branch information
cyber-pioneer committed Mar 6, 2024
1 parent 5d90acd commit 93ced7e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llm/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import paddle
import paddle.distributed.fleet.base.topology as tp
import paddle.incubate.multiprocessing as mp
from paddle.base.framework import in_pir_executor_mode
from paddle.base.framework import in_cinn_mode, in_pir_executor_mode
from paddle.distributed import fleet
from utils import (
dybatch_preprocess,
Expand Down Expand Up @@ -363,6 +363,8 @@ def __init__(self, config: PredictorArgument, tokenizer: PretrainedTokenizer = N
inference_config.enable_new_executor()
if in_pir_executor_mode():
inference_config.enable_new_ir()
if in_cinn_mode():
inference_config.enable_cinn()

with static_mode_guard():
self.predictor = paddle.inference.create_predictor(inference_config)
Expand Down

0 comments on commit 93ced7e

Please sign in to comment.