From 71fc127d62ae24d797ccfe854c0729f3c3030698 Mon Sep 17 00:00:00 2001 From: Xu Zhao Date: Wed, 6 Nov 2024 11:10:11 -0500 Subject: [PATCH] Fix remove params --- tritonbench/utils/parser.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tritonbench/utils/parser.py b/tritonbench/utils/parser.py index c88643e4..08da8458 100644 --- a/tritonbench/utils/parser.py +++ b/tritonbench/utils/parser.py @@ -1,5 +1,5 @@ import argparse -from typing import List +from typing import List, Optional from tritonbench.utils.env_utils import AVAILABLE_PRECISIONS from tritonbench.utils.triton_op import DEFAULT_RUN_ITERS, DEFAULT_WARMUP, IS_FBCODE @@ -201,9 +201,10 @@ def _remove_params(params, loc): return params[:loc] + params[loc + 2 :] -def add_cmd_parameter(args: List[str], name: str, value: str) -> List[str]: +def add_cmd_parameter(args: List[str], name: str, value: Optional[str]=None) -> List[str]: args.append(name) - args.append(value) + if value: + args.append(value) return args