Skip to content

Conversation

@suo
Copy link
Member

@suo suo commented Nov 14, 2019

Stack from ghstack:

We made ModuleInfo a union initially to represent the idea that a
submodule could either be a regular module or a module interface.

This PR represents module interfaces as a ConcreteModuleType with no
info (e.g. no "sugaredness"), and with the interface type as the
underlying jitType_. This has the effect of reducing the special
casing around adding/maintaining module info.

Differential Revision: D18575011

We made `ModuleInfo` a union initially to represent the idea that a
submodule could either be a regular module or a module interface.

This PR represents module interfaces as a ConcreteModuleType with no
info (e.g.  no "sugaredness"), and with the interface type as the
underlying `jitType_`. This has the effect of reducing the special
casing around adding/maintaining module info.
@suo
Copy link
Member Author

suo commented Nov 14, 2019

cc @wanchaol

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Nov 14, 2019
@kostmo
Copy link
Member

kostmo commented Nov 14, 2019

CircleCI build failures summary

As of commit 496e993:

  • 5/5 failures introduced in this PR
  • 5/5 recognized as flaky
    • Re-run these jobs?

Here are the reasons each build failed:

Job Step Log excerpt
pytorch_linux_xenial_py3_6_gcc5_4_build Set Up CI Environment After attach_workspace E: Failed to fetch
pytorch_linux_xenial_py2_7_9_build Set Up CI Environment After attach_workspace E: Failed to fetch
pytorch_xla_linux_xenial_py3_6_clang7_build Set Up CI Environment After attach_workspace E: Failed to fetch
pytorch_linux_xenial_py3_clang5_android_ndk_r19c_x86_32_build Set Up CI Environment After attach_workspace E: Failed to fetch
pytorch_linux_xenial_cuda9_cudnn7_py3_build Set Up CI Environment After attach_workspace E: Failed to fetch

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

Please report bugs/suggestions on the GitHub issue tracker.

Copy link
Collaborator

@wanchaol wanchaol left a comment

Choose a reason for hiding this comment

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

looks nice! one minor comment.

We made `ModuleInfo` a union initially to represent the idea that a
submodule could either be a regular module or a module interface.

This PR represents module interfaces as a ConcreteModuleType with no
info (e.g.  no "sugaredness"), and with the interface type as the
underlying `jitType_`. This has the effect of reducing the special
casing around adding/maintaining module info.
const auto& selfType = concreteType_->getJitType();
const auto& selfType_ = concreteType_->getJitType();
if (selfType_->cast<InterfaceType>()) {
return std::make_shared<SimpleValue>(self_)->attr(loc, m, field);
Copy link
Contributor

Choose a reason for hiding this comment

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

SimpleValue(self)-> since we are deleting the object directly after.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changing it would cause a lint error internally: https://fburl.com/wiki/jshlq9g3. Which doesn't apply in this situation but I guess could conceivably happen with some more code mutations down the road, so we might as well follow the rule?

return std::make_shared<SimpleValue>(self_)->attr(loc, m, field);
// ...otherwise, methods, parameters, attributes, and buffers are all
// first class so they get returned as SimpleValues
return std::make_shared<SimpleValue>(self_)->attr(loc, m, field);
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

suo added 2 commits November 18, 2019 23:51
We made `ModuleInfo` a union initially to represent the idea that a
submodule could either be a regular module or a module interface.

This PR represents module interfaces as a ConcreteModuleType with no
info (e.g.  no "sugaredness"), and with the interface type as the
underlying `jitType_`. This has the effect of reducing the special
casing around adding/maintaining module info.

Differential Revision: [D18575011](https://our.internmc.facebook.com/intern/diff/D18575011)
We made `ModuleInfo` a union initially to represent the idea that a
submodule could either be a regular module or a module interface.

This PR represents module interfaces as a ConcreteModuleType with no
info (e.g.  no "sugaredness"), and with the interface type as the
underlying `jitType_`. This has the effect of reducing the special
casing around adding/maintaining module info.

Differential Revision: [D18575011](https://our.internmc.facebook.com/intern/diff/D18575011)
@facebook-github-bot
Copy link
Contributor

@suo merged this pull request in 558a777.

@facebook-github-bot facebook-github-bot deleted the gh/suo/231/head branch November 23, 2019 15:16
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.

7 participants