Skip to content

Conversation

@eellison
Copy link
Contributor

@eellison eellison commented Nov 9, 2019

Stack from ghstack:

Fix for #28998

Differential Revision: D18412561

@eellison eellison requested a review from apaszke as a code owner November 9, 2019 00:48
@eellison eellison requested a review from suo November 9, 2019 00:48
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Nov 9, 2019
…quential"


This PR adds support for `_modules`, making it so we no longer need to special case support for `nn.Sequential`. I was getting internal errors around the previous approach using `self.define()`, so i am adding this PR as part of the stack.

Fix for #28998

[ghstack-poisoned]
eellison pushed a commit that referenced this pull request Nov 9, 2019
@eellison eellison requested review from driazati, wanchaol and zdevito and removed request for zdevito November 9, 2019 00:53
iterator->addChild(loc, m, modules_);
return std::make_shared<ModuleDictMethod>(iterator, "items");
} else {
throw ErrorReport(loc) << "_Modules only supports keys, values, or items";
Copy link
Contributor

Choose a reason for hiding this comment

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

_Modules -> _modules

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.

Binding a private python member into TorchScript seems like the wrong approach. Shouldn't we implement the standard nn.Module API for this stuff? That would be the children, named_children, modules() and named_modules methods. Having _modules without named_children is going to promote the use of a private API.

…quential"


This PR adds support for `_modules`, making it so we no longer need to special case support for `nn.Sequential`. I was getting internal errors around the previous approach using `self.define()`, so i am adding this PR as part of the stack.

Fix for #28998

Differential Revision: [D18412561](https://our.internmc.facebook.com/intern/diff/D18412561)

[ghstack-poisoned]
eellison pushed a commit that referenced this pull request Nov 12, 2019
…quential"


This PR adds support for `_modules`, making it so we no longer need to special case support for `nn.Sequential`. I was getting internal errors around the previous approach using `self.define()`, so i am adding this PR as part of the stack.

Fix for #28998

Differential Revision: [D18412561](https://our.internmc.facebook.com/intern/diff/D18412561)

[ghstack-poisoned]
…quential"


This PR adds support for `_modules`, making it so we no longer need to special case support for `nn.Sequential`. I was getting internal errors around the previous approach using `self.define()`, so i am adding this PR as part of the stack.

Fix for #28998

Differential Revision: [D18412561](https://our.internmc.facebook.com/intern/diff/D18412561)

[ghstack-poisoned]
eellison pushed a commit that referenced this pull request Nov 12, 2019
…quential"


This PR adds support for `_modules`, making it so we no longer need to special case support for `nn.Sequential`. I was getting internal errors around the previous approach using `self.define()`, so i am adding this PR as part of the stack.

Fix for #28998

Differential Revision: [D18412561](https://our.internmc.facebook.com/intern/diff/D18412561)

[ghstack-poisoned]
@eellison eellison changed the title add support for _modules, reducing special casing of nn.Sequential [JIT] Add support for named_modules() Feb 25, 2020
@dr-ci
Copy link

dr-ci bot commented Feb 25, 2020

💊 CircleCI build failures summary and remediations

As of commit 01e28fe:

  • 1/1 failures introduced in this PR

Detailed failure analysis

One may explore the probable reasons each build failed interactively on the Dr. CI website.

🕵️ 1 new failure recognized by patterns

The following build failures do not appear to be due to upstream breakage:

See CircleCI build pytorch_linux_xenial_py3_6_gcc5_4_build (1/1)

Step: "Build" (full log | pattern match details)

Automatic merge failed; fix conflicts and then commit the result.
CONFLICT (add/add): Merge conflict in .circleci/scripts/vs_install.ps1 
Auto-merging .circleci/scripts/vs_install.ps1 
CONFLICT (add/add): Merge conflict in .circleci/scripts/binary_run_in_docker.sh 
Auto-merging .circleci/scripts/binary_run_in_docker.sh 
CONFLICT (add/add): Merge conflict in .circleci/scripts/binary_populate_env.sh 
Auto-merging .circleci/scripts/binary_populate_env.sh 
CONFLICT (add/add): Merge conflict in .circleci/scripts/binary_ios_upload.sh 
Auto-merging .circleci/scripts/binary_ios_upload.sh 
CONFLICT (add/add): Merge conflict in .circleci/config.yml 
Auto-merging .circleci/config.yml 
Automatic merge failed; fix conflicts and then commit the result. 

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.

This comment has been revised 19 times.

@eellison eellison requested a review from driazati February 25, 2020 19:49
@eellison eellison dismissed zdevito’s stale review February 25, 2020 19:50

no longer exposing internal api, now exposing named_modules()

@eellison
Copy link
Contributor Author

This doesn't do the checking for uniqueness, but when we recursively script we create a new module on each compilation (don't preserve aliasing), so i don't think that's actually a problem.

eellison pushed a commit that referenced this pull request Feb 25, 2020
Copy link
Contributor

@driazati driazati left a comment

Choose a reason for hiding this comment

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

Can you make a follow up issue or add to this PR stuff like named_children?

@eellison
Copy link
Contributor Author

Can you make a follow up issue or add to this PR stuff like named_children?

i'm going to do the other apis as a follow up sometime this week.

eellison pushed a commit that referenced this pull request Feb 26, 2020
@facebook-github-bot
Copy link
Contributor

@eellison merged this pull request in 057fd5e.

hczhu pushed a commit that referenced this pull request Feb 28, 2020
…29495)

Summary:
Pull Request resolved: #29495

This PR adds support for `_modules`, making it so we no longer need to special case support for `nn.Sequential`. I was getting internal errors around the previous approach using `self.define()`, so i am adding this PR as part of the stack.

Fix for #28998

Test Plan: Imported from OSS

Differential Revision: D18412561

Pulled By: eellison

fbshipit-source-id: a8b24ebee39638fccf63b2701f65f8bb0de84faa
@facebook-github-bot facebook-github-bot deleted the gh/eellison/28/head branch March 1, 2020 15:17
ttumiel pushed a commit to ttumiel/pytorch that referenced this pull request Mar 4, 2020
…ytorch#29495)

Summary:
Pull Request resolved: pytorch#29495

This PR adds support for `_modules`, making it so we no longer need to special case support for `nn.Sequential`. I was getting internal errors around the previous approach using `self.define()`, so i am adding this PR as part of the stack.

Fix for pytorch#28998

Test Plan: Imported from OSS

Differential Revision: D18412561

Pulled By: eellison

fbshipit-source-id: a8b24ebee39638fccf63b2701f65f8bb0de84faa
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.

6 participants