Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/driver/driver_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,15 @@ TVM_REGISTER_PASS_CONFIG_OPTION("tir.debug_keep_trivial_loop", Bool);
TVM_REGISTER_PASS_CONFIG_OPTION("tir.use_async_copy", Bool);
TVM_REGISTER_PASS_CONFIG_OPTION("tir.merge_async_commit_queue_scope", Bool);
TVM_REGISTER_PASS_CONFIG_OPTION("tir.instrument_lwp", Bool);
TVM_REGISTER_PASS_CONFIG_OPTION("tir.dma_bypass_cache", Bool);
TVM_REGISTER_PASS_CONFIG_OPTION("tir.vtcm_capacity", Integer);

// WARNING: May cause coherency issues resulting data miscompares
// Experimental feature that, when enabled by the runtime, bypasses the cache when using DMA. When
// bypassing the cache TVM must manage cache coherency in software. Software managed cache coherency
// can be tricky e.g. it is yet to be proven out in the Hexagon runtime. Hence the warning above and
// the "experimental" notation for this feature.
TVM_REGISTER_PASS_CONFIG_OPTION("tir.experimental_dma_bypass_cache", Bool);

using tvm::Array;
using tvm::transform::Pass;

Expand Down
3 changes: 2 additions & 1 deletion src/tir/transforms/lower_async_dma.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ namespace transform {
Pass LowerAsyncDMA() {
auto pass_func = [=](PrimFunc f, IRModule m, PassContext ctx) {
auto fptr = f.CopyOnWrite();
bool dma_bypass_cache = ctx->GetConfig<Bool>("tir.dma_bypass_cache", Bool(false)).value();
bool dma_bypass_cache =
ctx->GetConfig<Bool>("tir.experimental_dma_bypass_cache", Bool(false)).value();
fptr->body = AsyncDMALowerer(dma_bypass_cache)(std::move(fptr->body));
return f;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def evaluate(
with tvm.transform.PassContext(
config={
"tir.use_async_copy": use_async_copy,
"tir.dma_bypass_cache": 1,
"tir.experimental_dma_bypass_cache": 1,
"tir.merge_async_commit_queue_scope": merge_async_commit_queue_scope,
}
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_async_software_pipeline(
with tvm.transform.PassContext(
config={
"tir.use_async_copy": 1,
"tir.dma_bypass_cache": 1,
"tir.experimental_dma_bypass_cache": 1,
"tir.merge_async_commit_queue_scope": False,
}
):
Expand Down