Skip to content

[pytorch][mobile] remove backward functions from jit-op-registry for mobile build#26783

Merged
ljk53 merged 3 commits intogh/ljk53/58/basefrom
gh/ljk53/58/head
Sep 25, 2019
Merged

[pytorch][mobile] remove backward functions from jit-op-registry for mobile build#26783
ljk53 merged 3 commits intogh/ljk53/58/basefrom
gh/ljk53/58/head

Conversation

@ljk53
Copy link
Contributor

@ljk53 ljk53 commented Sep 25, 2019

Stack from ghstack:

Summary:
Add codegen option to remove backward ops from jit-op-registry as they are not
likely to be used for inference only mobile build.

Measured ARM-v7 AAR build size change: 5,804,182 -> 5,331,219.

Test Plan:

  • build and integrate with demo app;

Differential Revision: D17570054

…mobile build

Summary:
Add codegen option to remove backward ops from jit-op-registry as they are not
likely to be used for inference only mobile build.

Measured ARM-v7 AAR build size change: 5,804,182 -> 5,331,219.

Test Plan:
- build and integrate with demo app;

[ghstack-poisoned]
@pytorchbot pytorchbot added oncall: jit Add this issue/PR to JIT oncall triage queue module: build Build system issues labels Sep 25, 2019
@ljk53
Copy link
Contributor Author

ljk53 commented Sep 25, 2019

Recreate #26657 - that PR was marked as merged for some reason.

…gistry for mobile build"

Summary:
Add codegen option to remove backward ops from jit-op-registry as they are not
likely to be used for inference only mobile build.

Measured ARM-v7 AAR build size change: 5,804,182 -> 5,331,219.

Test Plan:
- build and integrate with demo app;

[ghstack-poisoned]
…gistry for mobile build"

Summary:
Add codegen option to remove backward ops from jit-op-registry as they are not
likely to be used for inference only mobile build.

Measured ARM-v7 AAR build size change: 5,804,182 -> 5,331,219.

Test Plan:
- build and integrate with demo app;

[ghstack-poisoned]
return decl['name'].endswith('_out')


# Copied from ..autograd.gen_python_functions.SKIP_PYTHON_BINDINGS
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zdevito is there a reason to bind other skipped python bindings for JIT? Can we safely skip all of them by default?

Copy link
Collaborator

Choose a reason for hiding this comment

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

There's symbolic differentiation support in JIT. It'd append IR for backwards directly to the graph. For those cases we need to have backwards ops registered and runnable. (at least that's my understanding)

Copy link
Collaborator

@dzhulgakov dzhulgakov 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, but I'll let @ezyang or @zdevito to take a look

return decl['name'].endswith('_out')


# Copied from ..autograd.gen_python_functions.SKIP_PYTHON_BINDINGS
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's symbolic differentiation support in JIT. It'd append IR for backwards directly to the graph. For those cases we need to have backwards ops registered and runnable. (at least that's my understanding)

@ljk53 ljk53 merged commit da31f7b into gh/ljk53/58/base Sep 25, 2019
ljk53 added a commit that referenced this pull request Sep 25, 2019
…mobile build

Summary:
Add codegen option to remove backward ops from jit-op-registry as they are not
likely to be used for inference only mobile build.

Measured ARM-v7 AAR build size change: 5,804,182 -> 5,331,219.

Test Plan:
- build and integrate with demo app;

ghstack-source-id: 6716a80
Pull Request resolved: #26783
@ljk53
Copy link
Contributor Author

ljk53 commented Sep 25, 2019

ahh... this PR got marked as merged again.. I'll recreate.

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

Labels

module: build Build system issues oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants