MCPcopy Create free account
hub / github.com/MegEngine/MegCC / main

Function main

script/test_model.py:345–426  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

343
344
345def main():
346 parser = ArgumentParser(
347 description=
348 "auto benchmark and check correctness with mgb using random input")
349 parser.add_argument(
350 "--arch",
351 type=str,
352 required=False,
353 default="aarch64",
354 choices=[
355 'x86_64', 'i386', 'aarch64', 'armv7-a', 'cortex-m', 'armv7-a-qemu',
356 'rv64gcv0p7', 'rv64norvv'
357 ],
358 )
359 parser.add_argument("--eps", type=float, required=False, default=3e-4)
360 parser.add_argument(
361 "--target",
362 type=str,
363 required=True,
364 help="target host str, `xiaomi9@phone`for termux",
365 )
366 parser.add_argument("dump_dir",
367 type=str,
368 help="dump dir contain model and kernels")
369 parser.add_argument(
370 "--mdl",
371 type=str,
372 required=False,
373 default="",
374 help=
375 "input mdl path to do correctness check json str $model_name:$mdl_path,$model_name2:$mdl_path2",
376 )
377 parser.add_argument(
378 "--bin_dir",
379 type=str,
380 required=False,
381 default=None,
382 help="bin dir contains mgb-runner",
383 )
384 parser.add_argument(
385 "--input-dir",
386 type=str,
387 required=False,
388 default=None,
389 help="specify input directory"
390 )
391 parser.add_argument(
392 "--enable-fp16",
393 action="store_true",
394 help="megcc enable float16 compile flag"
395 )
396 parser.add_argument(
397 "--enable-aarch32-dot",
398 action="store_true",
399 help="megcc enable AArch32 dotprod compile flag"
400 )
401 parser.add_argument(
402 "--enable-aarch64-i8mm",

Callers 1

test_model.pyFile · 0.70

Calls 3

parse_dump_dirFunction · 0.85
parse_envFunction · 0.85
auto_checkFunction · 0.85

Tested by

no test coverage detected