Repository navigation
fix: avoid KeyError in DSTrace.get_sibling_exps for a node with several children - #1514
Open
Muhammad Usman Mateen (usmanmateen) wants to merge 1 commit into
Open
Muhammad Usman Mateen (usmanmateen) wants to merge 1 commit into
Muhammad Usman Mateen (usmanmateen) wants to merge 1 commit into
Conversation
…al children get_sibling_exps() removed each node's parents from the set of leaves with set.remove(), so a parent shared by two committed children, by two uncommitted experiments, or by one of each raised KeyError. Use set.discard() for both removals. Fixes microsoft#1430
Author
|
Hi XianBW (@XianBW), gentle ping on this small fix when you have a moment. Happy to adjust anything. |
Author
|
XianBW (@XianBW) Wanyi Chen (@wanyichen06) could one of you take a look at this small fix when you have time? |
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.
Description
DSTrace.get_sibling_exps()collects the leaves of the trace DAG by adding every node to a set and removing each node's parents. It usedset.remove(), so a node that is the parent of more than one child was removed twice and raisedKeyError:dag_parent = [(), (0,), (0,)]);Both removals now use
set.discard(), so the result is the set of leaves in all of these cases. Nothing else changes.Motivation and Context
Fixes #1430.
DSProposalV2ExpGencallstrace.get_sibling_exps()when diversity injection is enabled, and parallel expansion of one node is a normal case there.Gourav Singal (@GouravSingal-code) offered a fix in August, but no PR followed, so I'm sending this one. Happy to close it if theirs is ready.
How Has This Been Tested?
test/scenarios/data_science/test_trace_sibling_exps.pycovers a node with two committed children, two uncommitted experiments with the same parent, andcurrent_selectionbeing left out. All three fail onmainwithKeyErrorand pass with this change.Screenshots of Test Results (if appropriate):
black -l 120andisortpass on the changed files.Types of changes
📚 Documentation preview 📚: https://RDAgent--1514.org.readthedocs.build/en/1514/