-
Notifications
You must be signed in to change notification settings - Fork 1.3k
param: optimize fix for exponential memory allocation #10180
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10180 +/- ##
=======================================
Coverage 90.61% 90.61%
=======================================
Files 499 499
Lines 37881 37881
Branches 5505 5505
=======================================
Hits 34327 34327
Misses 2912 2912
Partials 642 642 ☔ View full report in Codecov by Sentry. |
|
As I said in #10178 (comment), this won't fix the issue because different keypaths could still reference to same list. params:
- references
- references.references
- references.references.references
- references.references.references.references
- references.references.references.references.references
- references.references.references.references.references.referencesI think there's no way around deepcopying. I'll suggest restoring that, and also making |
Do you have a minimal example for that? I have been unable to reproduce it, and can't think of any scenario where |
|
The childrens of the values that keypath/xpath points to could be same. # dvc.yaml
stages:
example:
cmd: test
params:
- custom.yaml:
- references
- references.references
- references.references.references
- references.references.references.references
- references.references.references.references.references
- references.references.references.references.references.references# custom.yaml
values: &anchor [0, 1, 2, 3]
references:
references:
references:
references:
references:
references:
references:
first: *anchor
second: *anchor
third: *anchor
fourth: *anchor
fifth: *anchor
sixth: *anchor
seventh: *anchor
eighth: *anchor
ninth: *anchor
tenth: *anchor
eleventh: *anchor |
for more information, see https://pre-commit.ci
|
Thanks! I didn't know that |
|
We could try pruning sub-paths here, but with aliases and anchors, I cannot say with confidence if that would be enough. So, I think it's better to |
As @skshetry proposed on #10178 (comment), deduplicating
key_pathswould be enough, becausedpath.searchwith distinct keys will never output the same object twice.Important
This patch seems to fix #10177 and some other creative variants I wrote, but I'm still afraid of unforeseen edge cases; not sure if this is a good idea.