Skip to content
Snippets Groups Projects
Commit 70246ab7 authored by Hashim Sharif's avatar Hashim Sharif
Browse files

Adding nvdla pass sequence in hpvm-clang

parent 8b0989e6
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,18 @@ def compile_hpvm_c(
"inplace", "hpvm-fuse", "dfg2llvm-wrapperapi",
f"configuration-inputs-filename={conf_file}"
]
elif tensor_target == "nvdla":
if conf_file is None:
raise ValueError("conf_file must be defined when tensor_target=='tensor'.")
passes += ["LLVMHPVM2NVDLAPass"]
pass_flags += [
"hpvm-nvdla",
"cprecision=fp16",
"calib-table=calib.txt"
]
elif tensor_target == "cudnn":
passes += ["LLVMInPlaceDFGAnalysis", "LLVMDFG2LLVM_CUDNN"]
pass_flags += ["inplace", "dfg2llvm-cudnn"]
......@@ -198,7 +210,7 @@ See option -b for that."""
"-t",
"--tensor-target",
type=str,
choices=["tensor", "cudnn"],
choices=["tensor", "cudnn", "nvdla"],
help="Backend to use for tensor operators",
)
parser.add_argument(
......@@ -254,6 +266,7 @@ See option -b for that."""
if args.tensor_target == "tensor":
if args.conf_file is None:
parser.error('Tensor target "tensor" requires --conf-file argument')
if args.x == "c":
args.is_cpp = False
elif args.x == "c++":
......@@ -262,7 +275,7 @@ See option -b for that."""
parser.error(f"Language mode {args.x} not supported yet -- only c or c++")
if not HPVM_USE_OPENCL and args.opencl:
parser.error(f"OpenCL is disabled for this build of HPVM.")
if not HPVM_HAS_TRT and args.tensor_target:
if not HPVM_HAS_TRT and args.tensor_target != "nvdla":
parser.error(
"Tensor domain support is disabled for this build of HPVM; "
"please check your CMake warnings during compilation."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment