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] Print out interface mismatch for prim::ModuleDictIndex #47300

Closed

Conversation

SplitInfinity
Copy link

@SplitInfinity SplitInfinity commented Nov 3, 2020

Stack from ghstack:

Summary
This commit augments the module interface subtyping check that is done
before the emission of the prim::ModuleDictIndex operator so that the
error message that is printed if the subtyping check fails provides more
information on which methods do not match.

Test Plan
Existing unit tests for prim::ModuleDictIndex. Compilation of ModWithWrongAnnotation now produces this error:

Attribute module is not of annotated type __torch__.jit.test_module_containers.ModuleInterface: Method on class '__torch__.jit.test_module_containers.DoesNotImplementInterface' (1) is not compatible with interface '__torch__.jit.test_module_containers.ModuleInterface' (2)
  (1) forward(__torch__.jit.test_module_containers.DoesNotImplementInterface self, Tensor inp) -> ((Tensor, Tensor))
  (2) forward(InterfaceType<ModuleInterface> self, Any inp) -> (Any)
:

Differential Revision: D24709538

**Summary**
This commit augments the module interface subtyping check that is done
before the emission of the `prim::ModuleDictIndex` operator so that the
error message that is printed if the subtyping check fails provides more
information on which methods do not match.

**Test Plan**
Existing unit tests for `prim::ModuleDictIndex`.

[ghstack-poisoned]
@facebook-github-bot facebook-github-bot added cla signed oncall: jit Add this issue/PR to JIT oncall triage queue labels Nov 3, 2020
SplitInfinity pushed a commit that referenced this pull request Nov 3, 2020
**Summary**
This commit augments the module interface subtyping check that is done
before the emission of the `prim::ModuleDictIndex` operator so that the
error message that is printed if the subtyping check fails provides more
information on which methods do not match.

**Test Plan**
Existing unit tests for `prim::ModuleDictIndex`.

ghstack-source-id: 614288031246d930608f6006e6e97ce4c43e1472
Pull Request resolved: #47300
@xw285cornell
Copy link
Contributor

This is really nice! Could you update the test plan with a mismatch example, and the output of failure?

@SplitInfinity
Copy link
Author

This is really nice! Could you update the test plan with a mismatch example, and the output of failure?

Updated.

@xw285cornell
Copy link
Contributor

Thanks!

@facebook-github-bot
Copy link
Contributor

@SplitInfinity merged this pull request in dc0d68a.

@facebook-github-bot facebook-github-bot deleted the gh/splitinfinity/63/head branch November 7, 2020 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed 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.

None yet

4 participants