-
Notifications
You must be signed in to change notification settings - Fork 85
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
bench: pattern rewriting microbenchmarks #4079
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4079 +/- ##
==========================================
- Coverage 89.05% 89.04% -0.01%
==========================================
Files 318 318
Lines 43407 43405 -2
Branches 5408 5408
==========================================
- Hits 38655 38652 -3
- Misses 3408 3409 +1
Partials 1344 1344 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
||
def time_insert_point_before(self) -> None: | ||
"""Time `InsertPoint.before`.""" | ||
InsertPoint.before(self.add_op) |
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 doesn't do anything
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.
Does this give "self" time/percentage similar to gprof
for example?
WORKLOAD_CONSTANT_20 = parse_module(CTX, WorkloadBuilder.constant_folding(20)) | ||
WORKLOAD_CONSTANT_100 = parse_module(CTX, WorkloadBuilder.constant_folding(100)) | ||
WORKLOAD_CONSTANT_1000 = parse_module(CTX, WorkloadBuilder.constant_folding(1_000)) |
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.
Does this have to be hardcoded here? Can it be dynamic (i.e., configured as such down in main
?).
I have the feeling that I've asked about this before, but I might be wrong :)
integer_type: IntegerType | ||
|
||
def setup(self) -> None: | ||
"""Setup the benchmarks.""" |
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.
Would you mind adding the sketch for this IR is some sort of pseudocode?
Add microbenchmarks for pattern rewriting. Using
pyinstrument
, we can get a breakdown of the worst offending functions (shown below, with sections collapsed to highlight the interesting bits)From this, we write a number of microbenchmarks to exercise these bottlenecking functions for pattern rewriting in general and the
RemoveUnusedOperations
,CanonicalizationRewritePattern
, andregion_dce
functions of constant folding.Peeled off from tracking PR #4008.