Skip to content
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

Merged
merged 3 commits into from
Mar 29, 2021

Conversation

psybuzz
Copy link
Contributor

@psybuzz psybuzz commented Mar 19, 2021

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.

@google-cla google-cla bot added the cla: yes label Mar 19, 2021
@psybuzz psybuzz marked this pull request as ready for review March 25, 2021 02:59
@psybuzz psybuzz requested a review from stephanwlee March 25, 2021 02:59
@@ -192,5 +194,197 @@ describe('graph tests', () => {
])
);
});

it('groups numeric series of nodes without underscores', async () => {
Copy link
Contributor

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_2foo3 or conv3conv2conv2_1)
  • any others? like foobarfoo_2foo3bar_2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added more test cases

@psybuzz psybuzz requested a review from stephanwlee March 29, 2021 19:49
Copy link
Contributor

@stephanwlee stephanwlee left a 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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createProgressTrackercreateNoopProgressTracker

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor Author

@psybuzz psybuzz left a 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 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@psybuzz psybuzz merged commit 33d2a73 into tensorflow:master Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants