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

Disable profiling when getGraphExecutorOptimize is unset #46479

Closed
wants to merge 5 commits into from

Conversation

Krovatkin
Copy link
Contributor

getGraphExecutorOptimize mandates we don't do any optimizations beyond what's required to run graphs. In this scenario, we don't want to do any profiling as profiling information will not be used.

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Oct 16, 2020
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Oct 16, 2020

💊 CI failures summary and remediations

As of commit 117d097 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 4 times.

Copy link

@ZolotukhinM ZolotukhinM left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -736,7 +736,13 @@ c10::intrusive_ptr<Future> GraphExecutor::runAsync(Stack& stack) {
}

size_t GraphExecutor::getDefaultNumBailOuts() {
return getProfilingMode() ? getBailoutDepth().load() : 0;
Copy link
Contributor

@eellison eellison Oct 16, 2020

Choose a reason for hiding this comment

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

Could we consider not even querying GraphExecutor if ! getGraphExecutorOptimize() ? This feels like the wrong place to add the check to me

Copy link
Contributor

Choose a reason for hiding this comment

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

Or dispatching to the SimpleExecutor if !getGraphExecutorOptimize()

Copy link
Contributor

Choose a reason for hiding this comment

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

From looking around maybe there's not a great place to do this... LGTM

Choose a reason for hiding this comment

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

That was my impression as well tbh

@dr-ci
Copy link

dr-ci bot commented Oct 16, 2020

💊 CI failures summary and remediations

As of commit 263807b (more details on the Dr. CI page):


  • 3/3 failures introduced in this PR---

3 failures not recognized by patterns:

Job Step Action
CircleCI pytorch_macos_10_13_py3_test Test 🔁 rerun
CircleCI pytorch_linux_xenial_py3_clang7_onnx_ort_test1 Run tests 🔁 rerun
CircleCI pytorch_linux_xenial_py3_clang7_onnx_ort_test2 Run tests 🔁 rerun
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 20 times.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@Krovatkin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@eellison eellison left a comment

Choose a reason for hiding this comment

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

Why all the changes/

@@ -466,6 +447,15 @@ ExecutionPlan ProfilingGraphExecutorImpl::getPlanFor(
return *optimized_plan_;
}

// no opt mode
if (!getGraphExecutorOptimize()) {
auto copy = graph->copy();
Copy link
Contributor

Choose a reason for hiding this comment

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

This has the opposite problem now - if you reenable optimization after running it with disabling, you will never optimize.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

err i'm kinda thinking it should be okay. If the user changes the number of profiled runs midway, we won't update it for models in flight either.

Copy link
Contributor Author

@Krovatkin Krovatkin Oct 16, 2020

Choose a reason for hiding this comment

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

Alternatively, we could try disregarding getGraphExecutorOptimize if we already started profiling runs but this behaviour seems complicated conceptually

Copy link
Contributor

@eellison eellison left a comment

Choose a reason for hiding this comment

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

Are all of these changes intentional?

@@ -96,12 +96,7 @@ void runNooptPassPipeline(std::shared_ptr<Graph>& graph) {
LowerGradOf(*graph);
GRAPH_DEBUG("After LowerGradOf, before RemoveExpands\n", *graph);
RemoveExpands(graph);
GRAPH_DEBUG("After RemoveExpands, before CanonicalizeOps\n", *graph);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this changed as part of the PR?

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@Krovatkin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@Krovatkin merged this pull request in c3466da.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged oncall: jit Add this issue/PR to JIT oncall triage queue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants