-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect uninitialized reads and overlapping writes #224
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great change which should help prevent a common source of issues/UB. Some thoughts in the comments.
1bc771c
to
7cd1d97
Compare
no optimizationsCheck-perf-impact results: (1d1f40270fc25a329bb16053c8fa15f2)
Relative execution time per category: (mean of relative medians)
|
distributed overlapping-write detectionCheck-perf-impact results: (7e3c8bfa480dfad2a4f08c4fabe32cc2)
Relative execution time per category: (mean of relative medians)
|
distributed overlapping-write detection + bounding-box uninitialized-read detectionCheck-perf-impact results: (385bf6fbfe375253106eaa9f9b53a88e)
Relative execution time per category: (mean of relative medians)
|
I managed to optimize this a bit further, but CDAG generation still takes a 10% performance hit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good change, thank you! A few minor notes:
f43978e
to
04ccd4d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have addressed most concerns, but realized some potential inconsistencies in other features.
2df606b
to
a6a49f6
Compare
disabling diagnostics by default in release buildsCheck-perf-impact results: (9c7d95e3b2850796c2d810616c0f1aff)
Relative execution time per category: (mean of relative medians)
|
5318e68
to
8d13007
Compare
do not maintain initialized-region when diagnostics are disabledCheck-perf-impact results: (a1f01e5fe178a68d42a7063603612487)
Relative execution time per category: (mean of relative medians)
|
I have turned the task-manager / graph-generator policy settings into constructor arguments; that way I can skip updating the initialized-region of a buffer when diagnostics are disabled (previously this region had to be maintained in anticipation of a change in polices, which of course never happened). I've also added a bit more documentation. |
task_manager and distributed_graph_generator by default throw when detecting an uninitialized read or overlapping writes in order to catch invalid test code or internal bugs. In `runtime`, these conditions are reported through warning / error logs instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just some smaller remarks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
d9c3a3b
to
1df889a
Compare
Check-perf-impact results: (3b34e58e3c100f4c3541a1ed59580f72) ❓ No new benchmark data submitted. ❓ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
1df889a
to
a785278
Compare
Check-perf-impact results: (54ff34045c40bf12cbc2ca95f475792b)
Relative execution time per category: (mean of relative medians)
|
I have used this opportunity to refactor how task debug names are generated from There is now a new |
3f4a28d
to
b7b6812
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Muy bien!
* Stringify the default kernel name to "" instead of "unnamed_kernel" * Kernel names from `<class KernelName>` are simplified before being inserted into `struct task` * Move Type name demangling to utils.cc * Add print_task_debug_label to show task type and optional label in debug messages
task_manager and distributed_graph_generator by default throw when detecting an uninitialized read or overlapping writes in order to catch invalid test code or internal bugs. In `runtime`, these conditions are reported through warning / error logs instead.
b7b6812
to
4b73a23
Compare
During IDAG development, asserting that instructions do not read from uninitialized memory turned out to be an invaluable tool for finding bugs in dependency tracking and data migration. This PR is a back-port of that detection logic, extended to also find overlapping writes between chunks on CDAG generation.
By default, task_manager and distributed_graph_generator throw when detecting an uninitialized read or overlapping writes in order to catch internal errors and report tests with bogus access patterns. In the runtime, results from these checks are reported through warning (uninitialized read) and error (overlapping writes) logs instead - both for backwards compatibillity, and because uninitialized reads are expected when submitting kernels with
read_write
access in a loop (see also celerity/meta#74).All tests with incorrect access patterns were fixed, and the reporting feature is tested both with the TDAG / CDAG test context infrastructure as well as the actual runtime.