Skip to content

Commit 0e64dba

Browse files
authored
[Hexagon] Denote DMA cache bypass as experimental feature (#13699)
1 parent 724757a commit 0e64dba

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

src/driver/driver_api.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,15 @@ TVM_REGISTER_PASS_CONFIG_OPTION("tir.debug_keep_trivial_loop", Bool);
5353
TVM_REGISTER_PASS_CONFIG_OPTION("tir.use_async_copy", Bool);
5454
TVM_REGISTER_PASS_CONFIG_OPTION("tir.merge_async_commit_queue_scope", Bool);
5555
TVM_REGISTER_PASS_CONFIG_OPTION("tir.instrument_lwp", Bool);
56-
TVM_REGISTER_PASS_CONFIG_OPTION("tir.dma_bypass_cache", Bool);
5756
TVM_REGISTER_PASS_CONFIG_OPTION("tir.vtcm_capacity", Integer);
5857

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

src/tir/transforms/lower_async_dma.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ namespace transform {
211211
Pass LowerAsyncDMA() {
212212
auto pass_func = [=](PrimFunc f, IRModule m, PassContext ctx) {
213213
auto fptr = f.CopyOnWrite();
214-
bool dma_bypass_cache = ctx->GetConfig<Bool>("tir.dma_bypass_cache", Bool(false)).value();
214+
bool dma_bypass_cache =
215+
ctx->GetConfig<Bool>("tir.experimental_dma_bypass_cache", Bool(false)).value();
215216
fptr->body = AsyncDMALowerer(dma_bypass_cache)(std::move(fptr->body));
216217
return f;
217218
};

tests/python/contrib/test_hexagon/test_async_dma_pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def evaluate(
275275
with tvm.transform.PassContext(
276276
config={
277277
"tir.use_async_copy": use_async_copy,
278-
"tir.dma_bypass_cache": 1,
278+
"tir.experimental_dma_bypass_cache": 1,
279279
"tir.merge_async_commit_queue_scope": merge_async_commit_queue_scope,
280280
}
281281
):

tests/python/contrib/test_hexagon/test_software_pipeline_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def test_async_software_pipeline(
180180
with tvm.transform.PassContext(
181181
config={
182182
"tir.use_async_copy": 1,
183-
"tir.dma_bypass_cache": 1,
183+
"tir.experimental_dma_bypass_cache": 1,
184184
"tir.merge_async_commit_queue_scope": False,
185185
}
186186
):

0 commit comments

Comments
 (0)