-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebase to pass CI and reflect suggestions
- Loading branch information
Showing
3 changed files
with
22 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import tvm | ||
from tvm.runtime import Module | ||
from tvm.target import Target | ||
from tvm.meta_schedule.builder import BuilderInput, LocalBuilder, BuilderResult | ||
from typing import List | ||
|
||
|
||
def relay_build_with_tensorrt( | ||
mod: Module, | ||
target: Target, | ||
params: dict, | ||
) -> List[BuilderResult]: | ||
from tvm.relay.op.contrib.tensorrt import partition_for_tensorrt | ||
|
||
mod, config = partition_for_tensorrt(mod, params) | ||
with tvm.transform.PassContext(opt_level=3, config={"relay.ext.tensorrt.options": config}): | ||
return tvm.relay.build_module._build_module_no_factory(mod, "cuda", "llvm", params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters