Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Kanvi/skip assert - #265

#265
Open
kanvi-nervana wants to merge 16 commits into
masterNervanaSystems/ngraph-tf:masterfrom
kanvi/skip-assertNervanaSystems/ngraph-tf:kanvi/skip-assertCopy head branch name to clipboard
Open

Kanvi/skip assert#265
kanvi-nervana wants to merge 16 commits into
masterNervanaSystems/ngraph-tf:masterfrom
kanvi/skip-assertNervanaSystems/ngraph-tf:kanvi/skip-assertCopy head branch name to clipboard

Conversation

@kanvi-nervana

Copy link
Copy Markdown
Contributor

No description provided.

kanvi.khanna added 4 commits October 16, 2018 16:52
 Added code for skipping the assert op if the env variable NGRAPH_TF_SKIP_ASSERT is set
 i.e basically get rid of the control edge
 Dump unmarked graphs with assert skipped
 Added python test for checking the assert is actually skipped

@sayantan-nervana sayantan-nervana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes in:

  1. python test assert
  2. prints in SkipAssert

Comment thread test/python/test_skip_assert.py Outdated
z: test_input
})

self.with_ngraph(run_test)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe we want to do this with and without ngraph?

assert (self.with_ngraph(run_test) == self.without_ngraph(run_test)).all()

@shresthamalik shresthamalik Oct 18, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can write a test that fails with tf and works with nGraph (as we got rid of control edges). But would that be ideal?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think as a test, it is a good idea. But in a real life network, its not ideal.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What would be the purpose for such a test?

Comment thread src/ngraph_skip_assert.cc Outdated
Comment thread src/ngraph_skip_assert.cc
Comment thread src/ngraph_rewrite_pass.cc Outdated
if (std::getenv("NGRAPH_TF_SKIP_ASSERT") != nullptr) {
TF_RETURN_IF_ERROR(SkipAssert(options.graph->get()));
// If requested, dump unmarked graphs without asserts
if (DumpCapturedGraphs()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we use a new check DumpSkipAssertGraphs() (We can check for DumpAllGraphs() and NGRAPH_TF_SKIP_ASSERT, May not want another flag) like the other ones?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another concern is that skip assert is part of VariableCapturePass, it should not be there if we go by the name of the pass (should only be capturing variables). We kept it there as we wanted to test at which stage the edges need to be removed and before TF Rewrite for Execution seems to work for us.

So should we introduce/register a new pass or rename the Variable Capture Pass or the current implementation is fine.
On these lines, encapsulate pass also has a function (rewrite for tracking) that does not really align with encapsulation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@shresthamalik good feedback. We need to refactor the code to take care of these. Please create a JIRA ticket and we will address these.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do we need to do anything in this regards for this PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread src/ngraph_rewrite_pass.cc Outdated
Comment thread src/ngraph_rewrite_pass.cc Outdated
if (std::getenv("NGRAPH_TF_SKIP_ASSERT") != nullptr) {
TF_RETURN_IF_ERROR(SkipAssert(options.graph->get()));
// If requested, dump unmarked graphs without asserts
if (DumpCapturedGraphs()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@shresthamalik good feedback. We need to refactor the code to take care of these. Please create a JIRA ticket and we will address these.

Comment thread src/ngraph_skip_assert.cc
Comment thread test/python/test_skip_assert.py

@avijit-nervana avijit-nervana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good.

@sayantan-nervana sayantan-nervana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are we doing the ngraph-will-pass-but-tf-will-fail test?

the python test could be arranged as:

try:
    run_tf
    assert False  #the above line should fail, so we should not hit this assert
catch:
    run_ngtf #once run-tf fails, we land up here

LGTM otherwise

@shresthamalik shresthamalik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Other than the test. LGTM

})

assert (
self.with_ngraph(run_test) == self.without_ngraph(run_test)).all()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test wont run with the env variable in the CI, right?

@avijit-nervana avijit-nervana added the Fully Reviewed All reviewers have approved label Oct 19, 2018
@sayantan-nervana sayantan-nervana removed Fully Reviewed All reviewers have approved labels Oct 19, 2018

@shresthamalik shresthamalik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need to revisit the test.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.