-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
graph: relax the aggressive numeric node series detection #4803
Conversation
00a1c7a
to
0cc4b01
Compare
@@ -192,5 +194,197 @@ describe('graph tests', () => { | |||
]) | |||
); | |||
}); | |||
|
|||
it('groups numeric series of nodes without underscores', async () => { |
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.
to codify the expected behavior for the future reader, add tests for:
- non-sequential numbering (e.g., 2 → 3 → 1 and 5 → 6 → 7 and 10 → 20 → 21)
- mixed format (e.g.,
foo_2
→foo3
orconv3
→conv2
→conv2_1
) - any others? like
foo
→bar
→foo_2
→foo3
→bar_2
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.
Added more test cases
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.
Thanks, I did not know how the series grouping would work under the cases depicted in the test and TIL.
); | ||
} | ||
|
||
function createProgressTracker(): tf_graph_common.ProgressTracker { |
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.
createProgressTracker
→ createNoopProgressTracker
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.
Done
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.
Thanks!
); | ||
} | ||
|
||
function createProgressTracker(): tf_graph_common.ProgressTracker { |
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.
Done
Before, these nodes [add_0, add_1, add_2, ...] could be collapsed into
a single "series group node", while [add1, add2, add3, ...] could not.
This change relaxes the strict regex check to allow names without
underscores.
Note that the "minimum 5 node series length" constraint still applies,
as the main heuristic that guards against overly aggressive series
grouping.