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

[jit] Emit script function calls during tracing. #25089

Closed
wants to merge 8 commits into from

Conversation

suo
Copy link
Member

@suo suo commented Aug 23, 2019

Stack from ghstack:

Previously, when the tracer encountered a scripted function (or method), it
inlined the function into the graph. Now, we emit a CallFunction or
CallMethod node instead.

Differential Revision: D16987936

Previously, when the tracer encountered a scripted function (or method), it
inlined the function into the graph. Now, we emit a CallFunction or
CallMethod node instead.
@pytorchbot pytorchbot added oncall: jit Add this issue/PR to JIT oncall triage queue module: pybind Related to our Python bindings / interactions with other Python libraries labels Aug 23, 2019
@suo suo mentioned this pull request Aug 23, 2019
suo added a commit that referenced this pull request Aug 23, 2019
Previously, when the tracer encountered a scripted function (or method), it
inlined the function into the graph. Now, we emit a CallFunction or
CallMethod node instead.

ghstack-source-id: a20b41b56c12143743e0842a17adf6ffe159480b
Pull Request resolved: #25089
@suo suo requested a review from zdevito August 23, 2019 16:46
Previously, when the tracer encountered a scripted function (or method), it
inlined the function into the graph. Now, we emit a CallFunction or
CallMethod node instead.

Differential Revision: [D16987936](https://our.internmc.facebook.com/intern/diff/D16987936)
Previously, when the tracer encountered a scripted function (or method), it
inlined the function into the graph. Now, we emit a CallFunction or
CallMethod node instead.

Differential Revision: [D16987936](https://our.internmc.facebook.com/intern/diff/D16987936)
@pytorchbot pytorchbot added the module: cpp Related to C++ API label Aug 23, 2019
Previously, when the tracer encountered a scripted function (or method), it
inlined the function into the graph. Now, we emit a CallFunction or
CallMethod node instead.

Differential Revision: [D16987936](https://our.internmc.facebook.com/intern/diff/D16987936)
Previously, when the tracer encountered a scripted function (or method), it
inlined the function into the graph. Now, we emit a CallFunction or
CallMethod node instead.

Differential Revision: [D16987936](https://our.internmc.facebook.com/intern/diff/D16987936)
suo added a commit that referenced this pull request Aug 23, 2019
Previously, when the tracer encountered a scripted function (or method), it
inlined the function into the graph. Now, we emit a CallFunction or
CallMethod node instead.

ghstack-source-id: 9809a277ec1f601125ef22b8842027253b6eb7aa
Pull Request resolved: #25089
Copy link
Contributor

@zdevito zdevito left a comment

Choose a reason for hiding this comment

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

Looks good!

@@ -10547,6 +10546,7 @@ def traced_fn(x):
self.assertTrue(len(list(traced_fn.graph.inputs())) == 1)
FileCheck().check("aten::mm").check("aten::add").run(str(traced_fn.graph))

@_tmp_donotuse_dont_inline_everything
Copy link
Contributor

Choose a reason for hiding this comment

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

but it says donotuse

Copy link
Member Author

Choose a reason for hiding this comment

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

:'(

@@ -565,6 +565,8 @@ def graph_diagnostic_info():
break # Graphs have already diverged

if n_mod.kind() == 'prim::Constant' and not (n_mod.mustBeNone() or n_check.mustBeNone()):
if not n_mod.hasAttribute('value'):
Copy link
Contributor

Choose a reason for hiding this comment

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

why did this change?

Previously, when the tracer encountered a scripted function (or method), it
inlined the function into the graph. Now, we emit a CallFunction or
CallMethod node instead.

Differential Revision: [D16987936](https://our.internmc.facebook.com/intern/diff/D16987936)
@suo suo requested a review from apaszke as a code owner August 28, 2019 21:26
suo added a commit that referenced this pull request Aug 28, 2019
Previously, when the tracer encountered a scripted function (or method), it
inlined the function into the graph. Now, we emit a CallFunction or
CallMethod node instead.

ghstack-source-id: 5d5fb8513f35fd2574f795b239ec1d29838a1e70
Pull Request resolved: #25089
Previously, when the tracer encountered a scripted function (or method), it
inlined the function into the graph. Now, we emit a CallFunction or
CallMethod node instead.

Differential Revision: [D16987936](https://our.internmc.facebook.com/intern/diff/D16987936)
Previously, when the tracer encountered a scripted function (or method), it
inlined the function into the graph. Now, we emit a CallFunction or
CallMethod node instead.

Differential Revision: [D16987936](https://our.internmc.facebook.com/intern/diff/D16987936)
suo added a commit that referenced this pull request Aug 30, 2019
Previously, when the tracer encountered a scripted function (or method), it
inlined the function into the graph. Now, we emit a CallFunction or
CallMethod node instead.

ghstack-source-id: b4ef95e3f8f408c094d553597332fe4d1b9f4a96
Pull Request resolved: #25089
@facebook-github-bot
Copy link
Contributor

@suo merged this pull request in 60f6cc9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged module: cpp Related to C++ API module: pybind Related to our Python bindings / interactions with other Python libraries oncall: jit Add this issue/PR to JIT oncall triage queue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants