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

[ExecutionEngine] Create runctx and execute(ctx) functions #1907

Merged
merged 1 commit into from
Oct 24, 2018

Conversation

gcatron
Copy link
Contributor

@gcatron gcatron commented Oct 22, 2018

Description: Create runctx and execute(ctx) functions for moving placeholder memory allocation from compile time to run time and update tests.
Testing: Ninja all
Documentation: N/A
Progress on #1904 This would bring us to completion of the second step.

@@ -83,6 +83,8 @@ class ExecutionEngine final {

/// Runs a single execution of the function.
void run();
/// Context aware single execution of the function
void runctx(Context &ctx);

This comment was marked as off-topic.

This comment was marked as off-topic.

Copy link
Contributor

@rdzhabarov rdzhabarov left a comment

Choose a reason for hiding this comment

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

LGTM! Few nits.

@@ -16,6 +16,8 @@
#ifndef GLOW_BACKENDS_COMPILEDFUNCTION_H
#define GLOW_BACKENDS_COMPILEDFUNCTION_H

#include "glow/Graph/Context.h"

#include <unordered_map>

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@@ -83,6 +83,8 @@ class ExecutionEngine final {

/// Runs a single execution of the function.
void run();
/// Context aware single execution of the function

This comment was marked as off-topic.

@@ -28,6 +30,7 @@ class CompiledFunction {

/// Execute the network.
virtual void execute() = 0;
virtual void execute(Context &ctx) = 0;

This comment was marked as off-topic.

This comment was marked as off-topic.

Copy link
Contributor

@nadavrot nadavrot left a comment

Choose a reason for hiding this comment

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

@gcatron I think that it would be better to change run to run(ctx). Later, when we finish the migration we can remove compile(ctx).

Also, have you emailed the partners mailing list to let them know about this change?

@@ -83,6 +83,8 @@ class ExecutionEngine final {

/// Runs a single execution of the function.
void run();

This comment was marked as off-topic.

This comment was marked as off-topic.

@@ -55,6 +55,8 @@ class InterpreterFunction final : public CompiledFunction {
///@{
~InterpreterFunction() override;

void execute(Context &ctx) override;

void execute() override;

This comment was marked as off-topic.

@@ -28,6 +30,7 @@ class CompiledFunction {

/// Execute the network.
virtual void execute() = 0;
virtual void execute(Context &ctx) = 0;

This comment was marked as off-topic.

@@ -28,6 +30,9 @@ class CompiledFunction {

/// Execute the network.
virtual void execute() = 0;
/// Execute the network and allocate Placeholder memory with given
/// Context providing mapping between Placeholder and populated tensor.

This comment was marked as off-topic.

@nadavrot
Copy link
Contributor

@gcatron Looks good to me. Please make sure to squash the commits.

Copy link
Contributor

@rdzhabarov rdzhabarov left a comment

Choose a reason for hiding this comment

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

cool!

@rdzhabarov
Copy link
Contributor

Please, make sure to resolve conflicts and good to go.

re squashing, you could also select an option to "squash and merge" on this PR, up to yous

Updated tests to use new function signatures
@gcatron gcatron force-pushed the add_context_to_ee_run branch from ad6c05f to 5ebbbfc Compare October 24, 2018 20:55
@gcatron gcatron merged commit 366aba3 into pytorch:master Oct 24, 2018
@gcatron gcatron deleted the add_context_to_ee_run branch October 24, 2018 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants