feat: analyse callgraph to infer effects (and reduce order edges)#2035
Draft
acl-cqc wants to merge 13 commits into
Draft
feat: analyse callgraph to infer effects (and reduce order edges)#2035acl-cqc wants to merge 13 commits into
acl-cqc wants to merge 13 commits into
Conversation
…(other_callee_=>)effects
Contributor
|
| Branch | acl/callgraph |
| Testbed | Linux |
🚨 1 Alert
| Benchmark | Measure Units | View | Benchmark Result (Result Δ%) | Upper Boundary (Limit %) |
|---|---|---|---|---|
| tests/benchmarks/test_big_array.py::test_big_array_compile | hugr_bytes bytes x 1e3 | 📈 plot 🚷 threshold 🚨 alert (🔔) | 148.89 x 1e3(+23.39%)Baseline: 120.67 x 1e3 | 121.87 x 1e3 (122.16%) |
Click to view all benchmark results
| Benchmark | hugr_bytes | Benchmark Result bytes x 1e3 (Result Δ%) | Upper Boundary bytes x 1e3 (Limit %) | hugr_nodes | Benchmark Result nodes (Result Δ%) | Upper Boundary nodes (Limit %) |
|---|---|---|---|---|---|---|
| tests/benchmarks/test_big_array.py::test_big_array_compile | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 148.89 x 1e3(+23.39%)Baseline: 120.67 x 1e3 | 121.87 x 1e3 (122.16%) | 📈 view plot 🚷 view threshold | 5,659.00(0.00%)Baseline: 5,659.00 | 5,715.59 (99.01%) |
| tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile | 📈 view plot 🚷 view threshold | 35.52 x 1e3(-1.85%)Baseline: 36.19 x 1e3 | 36.55 x 1e3 (97.17%) | 📈 view plot 🚷 view threshold | 1,582.00(0.00%)Baseline: 1,582.00 | 1,597.82 (99.01%) |
| tests/benchmarks/test_queue_push_pop.py::test_queue_push_benchmark_compile | 📈 view plot 🚷 view threshold | 9.76 x 1e3(-1.91%)Baseline: 9.95 x 1e3 | 10.05 x 1e3 (97.12%) | 📈 view plot 🚷 view threshold | 347.00(0.00%)Baseline: 347.00 | 350.47 (99.01%) |
| tests/benchmarks/test_queue_push_pop.py::test_queue_push_pop_benchmark_compile | 📈 view plot 🚷 view threshold | 13.71 x 1e3(-2.78%)Baseline: 14.11 x 1e3 | 14.25 x 1e3 (96.26%) | 📈 view plot 🚷 view threshold | 470.00(0.00%)Baseline: 470.00 | 474.70 (99.01%) |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## acl/order_by_effects #2035 +/- ##
========================================================
+ Coverage 93.06% 93.10% +0.03%
========================================================
Files 154 155 +1
Lines 14749 14833 +84
========================================================
+ Hits 13726 13810 +84
Misses 1023 1023 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
follows #2024, includes cherry-pick of #2034.
closes #1748.
check_callandsynthesize_calltake an extra parameter that identifies the callee (and the caller is in theContext), this is then added to the callgraph inside the ENGINE. After checking is finished, we process that to calculate effects and put that in theCompilerContext.There are quite a few places where we have to fall back to using
[Effect.ANY], which I guess is much where we are before the PR, but it's not clear how to move them forward; e.g. nested functions.Tracing is a serious issue; IIUC we have done callgraph analysis before we do any tracing. We should probably rerun it - after every new function/instantiation is checked by tracing, and before the traced function calls it - but how? The big tracing refactor seems like a good solution...
Also needs some more refactoring, there's a lot of
instanceof- I think adding adef effectstoCallableDef(not justCompiledCallableDef) would help, will do that shortly.