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
1 change: 1 addition & 0 deletions src/op/builtin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ TVM_REGISTER_PASS_CONFIG_OPTION(kASTPrintEnable, Bool);
TVM_REGISTER_PASS_CONFIG_OPTION(kLayoutVisualizationEnable, Bool);
TVM_REGISTER_PASS_CONFIG_OPTION(kLayoutVisualizationFormats, String);
TVM_REGISTER_PASS_CONFIG_OPTION(kDeviceCompileFlags, ffi::Array<ffi::String>);
TVM_REGISTER_PASS_CONFIG_OPTION(kDisableDataRaceCheck, Bool);

DataType cuTensorMapType() { return DataType::UInt(8, 128); }

Expand Down
2 changes: 2 additions & 0 deletions src/op/builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ static constexpr const char *kLayoutVisualizationEnable =
static constexpr const char *kLayoutVisualizationFormats =
"tl.layout_visualization_formats";
static constexpr const char *kDeviceCompileFlags = "tl.device_compile_flags";
static constexpr const char *kDisableDataRaceCheck =
"tl.disable_data_race_check";

/*!
* \brief Whether to disable thread storage synchronization
Expand Down
19 changes: 10 additions & 9 deletions src/transform/verify_parallel_loop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ struct ParallelLoopVerifier : public ConstrVisitor {
}
}
void VisitStmt_(const BufferStoreNode *op) override {
if (reducers.count(op->buffer->data)) {
if (reducers.count(op->buffer->data) || op->buffer.scope() == "local.var" ||
op->buffer.scope() == "local") {
StmtExprVisitor::VisitStmt_(op);
return;
}
Expand Down Expand Up @@ -227,14 +228,14 @@ struct ParallelLoopVerifier : public ConstrVisitor {
}
}
if (!failed_vars.empty()) {
LOG(FATAL) << "Potential data race detected: `" << op->buffer
<< op->indices << "`"
<< "is written by multiple threads of loop vars: "
<< failed_vars << ", Counterexample:\n"
<< analyzer.z3_prover.GetModel(failed_var_expr)
<< "If you believe this is a false positive, pass "
"`PassKey.TL_DISABLE_DATA_RACE_CHECK` to pass key to "
"disable this check.";
LOG(WARNING) << "Data race detected: `" << op->buffer << op->indices
<< "`"
<< "is written by multiple threads in loop " << failed_vars
<< ", Example:\n"
<< analyzer.z3_prover.GetModel(failed_var_expr)
<< "If you believe this is a false positive, pass "
"`PassKey.TL_DISABLE_DATA_RACE_CHECK` to pass key to "
"disable this check.";
}
StmtExprVisitor::VisitStmt_(op);
}
Expand Down
Loading