Skip to content

Commit

Permalink
[MLU] add mlu device for infer
Browse files Browse the repository at this point in the history
  • Loading branch information
PeiyuLau committed Jul 14, 2023
1 parent 991fb7c commit e3efae0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/infer/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def init_args():
parser.add_argument("--use_gpu", type=str2bool, default=True)
parser.add_argument("--use_xpu", type=str2bool, default=False)
parser.add_argument("--use_npu", type=str2bool, default=False)
parser.add_argument("--use_mlu", type=str2bool, default=False)
parser.add_argument("--ir_optim", type=str2bool, default=True)
parser.add_argument("--use_tensorrt", type=str2bool, default=False)
parser.add_argument("--min_subgraph_size", type=int, default=15)
Expand Down Expand Up @@ -247,6 +248,9 @@ def create_predictor(args, mode, logger):

elif args.use_npu:
config.enable_custom_device("npu")
elif args.use_mlu:
dev_type = paddle.device.get_all_custom_device_type()[0]
config.enable_custom_device(dev_type)
elif args.use_xpu:
config.enable_xpu(10 * 1024 * 1024)
else:
Expand Down

0 comments on commit e3efae0

Please sign in to comment.