Skip to content

Commit 9c3a460

Browse files
committed
Merge branch 'main' into pp_ddp
Signed-off-by: Mamta Singh <[email protected]>
2 parents 406a869 + 7d345dd commit 9c3a460

File tree

15 files changed

+594
-199
lines changed

15 files changed

+594
-199
lines changed

QEfficient/cloud/compile.py

+21-9
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,29 @@
8585
parser.add_argument(
8686
"--enable_qnn",
8787
"--enable-qnn",
88-
action="store_true",
88+
nargs="?",
89+
const=True,
90+
type=str,
8991
default=False,
9092
help="Enables QNN. Optionally, a configuration file can be provided with [--enable_qnn CONFIG_FILE].\
9193
If not provided, the default configuration will be used.\
9294
Sample Config: QEfficient/compile/qnn_config.json",
9395
)
94-
parser.add_argument(
95-
"qnn_config",
96-
nargs="?",
97-
type=str,
98-
)
99-
# FIXME(ochougul): Allow extra compilation arguments
100-
args = parser.parse_args()
101-
QEfficient.compile(**vars(args))
96+
97+
args, compiler_options = parser.parse_known_args()
98+
99+
if isinstance(args.enable_qnn, str):
100+
args.qnn_config = args.enable_qnn
101+
args.enable_qnn = True
102+
103+
compiler_options_dict = {}
104+
for i in range(0, len(compiler_options)):
105+
if compiler_options[i].startswith("--"):
106+
key = compiler_options[i].lstrip("-").replace("-", "_")
107+
value = (
108+
compiler_options[i + 1]
109+
if i + 1 < len(compiler_options) and not compiler_options[i + 1].startswith("-")
110+
else True
111+
)
112+
compiler_options_dict[key] = value
113+
QEfficient.compile(**args.__dict__, **compiler_options_dict)

0 commit comments

Comments
 (0)