add Tree implementation - #694
Conversation
inducer
commented
Oct 18, 2022
The authorship information on the commits is incorrect. For the tree, this should show Kaushik as the author, and you as the committer. For the tests, that should show you as the author, i.e. you need a minimum of two commits. |
15a9057 to
4aacaf5Comparematthiasdiener
commented
Oct 22, 2022
I think this should be fixed now. |
matthiasdiener
commented
Nov 17, 2022
This is ready for review |
| @@ -0,0 +1,269 @@ | |||
| __copyright__ = "Copyright (C) 2022 Kaushik Kulkarni" | |||
There was a problem hiding this comment.
It's hard for me to see here how this was changed vs. the original.
There was a problem hiding this comment.
I've split up the commits into Kaushik's original implementation (7f50179), followed by my changes on top of that initial commit. Does that make the changes clearer?
cd4ada9 to
1574154Compareinducer
commented
Aug 19, 2024
I will absorb this into #785, closing here. |
matthiasdiener
commented
Aug 20, 2024
If you want, you can also cherry-pick the memoization PR we are using in our production version: illinois-ceesd@e886189 (illinois-ceesd#4). |
| new_child_to_parent = (self._child_to_parent.delete(node) | ||
| .set(new_id, parent)) | ||
| child_to_parent_mut = self._child_to_parent.mutate() |
There was a problem hiding this comment.
Because of mutate, this now requires the use of immutables.Map. Could you just use a normal dict for the mutation?
There was a problem hiding this comment.
Since the internal immutables.Maps don't seem to be exposed to the user, maybe it is sufficient to just use dict everywhere in this class?
There was a problem hiding this comment.
With dict, immutables allows this to remain immutables is justified (whereas just about everywhere else, it's just a glorified read-only dict, which is total overkill).
inducer
commented
Aug 20, 2024
Could you talk about how important those are in terms of cost? |
matthiasdiener
commented
Aug 20, 2024
We had seen a ~5% speedup of overall compile time with that PR on a prediction run. |
#694 Co-authored-by: Matthias Diener <mdiener@illinois.edu> Co-authored-by: Andreas Kloeckner <inform@tiker.net>
#694 Co-authored-by: Matthias Diener <mdiener@illinois.edu> Co-authored-by: Andreas Kloeckner <inform@tiker.net>
inducer
commented
Aug 24, 2024
I'll add those. |
#694 Co-authored-by: Matthias Diener <mdiener@illinois.edu> Co-authored-by: Andreas Kloeckner <inform@tiker.net>
#694 Co-authored-by: Matthias Diener <mdiener@illinois.edu> Co-authored-by: Andreas Kloeckner <inform@tiker.net>
based on #350 / #690