Skip to content

Conversation

@zdevito
Copy link
Contributor

@zdevito zdevito commented Jun 12, 2019

Stack from ghstack:

Summary: First class modules can now run on our entire test suite,
and benchmarks indicate there is no obvious performance regressions.
This PR removes lowered execution and cleans up dead code without
changing the Module API. A followup PR further simplifies the Module API
now that methods are simply a pair of (function, method_object).

Differential Revision: D15777726

Summary: First class modules can now run on our entire test suite,
and benchmarks indicate there is no obvious performance regressions.
This PR removes lowered execution and cleans up dead code without
changing the Module API. A followup PR further simplifies the Module API
now that methods are simply a pair of (function, method_object).
@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 module: tests Issues related to tests (not the torch.testing module) labels Jun 12, 2019
@zdevito zdevito requested a review from suo June 12, 2019 06:52
zdevito added 3 commits June 12, 2019 10:43
Remove lowered execution

Summary: First class modules can now run on our entire test suite,
and benchmarks indicate there is no obvious performance regressions.
This PR removes lowered execution and cleans up dead code without
changing the Module API. A followup PR further simplifies the Module API
now that methods are simply a pair of (function, method_object).

gh-metadata: pytorch pytorch 21674 gh/zdevito/63/head
Remove lowered execution

Summary: First class modules can now run on our entire test suite,
and benchmarks indicate there is no obvious performance regressions.
This PR removes lowered execution and cleans up dead code without
changing the Module API. A followup PR further simplifies the Module API
now that methods are simply a pair of (function, method_object).

gh-metadata: pytorch pytorch 21674 gh/zdevito/63/head
Remove lowered execution

Summary: First class modules can now run on our entire test suite,
and benchmarks indicate there is no obvious performance regressions.
This PR removes lowered execution and cleans up dead code without
changing the Module API. A followup PR further simplifies the Module API
now that methods are simply a pair of (function, method_object).

gh-metadata: pytorch pytorch 21674 gh/zdevito/63/head
@pytorchbot pytorchbot added the module: internals Related to internal abstractions in c10 and ATen label Jun 12, 2019
Remove lowered execution

Summary: First class modules can now run on our entire test suite,
and benchmarks indicate there is no obvious performance regressions.
This PR removes lowered execution and cleans up dead code without
changing the Module API. A followup PR further simplifies the Module API
now that methods are simply a pair of (function, method_object).

gh-metadata: pytorch pytorch 21674 gh/zdevito/63/head
if(const auto& sub = module.find_module(field)) {
gatherParamsFirstClass(*sub, u.user->output(), params);
} else if(script::Slot* slot = module.find_parameter(field)) {
if (const auto &sub = module.find_module(field)) {
Copy link
Member

Choose a reason for hiding this comment

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

seems like some weird autoformatting going on

}
const std::string& name() const {
return name_;
const std::string& field_name() const {
Copy link
Member

Choose a reason for hiding this comment

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

field_name is a little confusing—unqualified_name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are now two names, the name of the Class and the name of the module as a member of a parent module. We still rely on this "field_name" in a few places and it is never qualified. There is a comment that explains this. My hope is that the "Module because a view patch" simply removes it.

// Create a type representing a Module,
// These do not have methods, and are not globally registered
static ClassTypePtr createModuleType(std::shared_ptr<CompilationUnit> module);
std::shared_ptr<CompilationUnit> cu, bool is_module = false);
Copy link
Member

Choose a reason for hiding this comment

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

this is_module flag is a suspicious to me, since it implies that we are branching somewhere on whether something is a module (and so modules are not quite first class actually)

Copy link
Member

Choose a reason for hiding this comment

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

Ah, seems like it is used for ONNX…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed in person: ModuleType will be introduced as subtype of ClassType in a future comment. This means that the ClassType has additional module-like behavior (e.g. it has a list of "parameter" objects)

zdevito added 4 commits June 13, 2019 17:17
Remove lowered execution

Summary: First class modules can now run on our entire test suite,
and benchmarks indicate there is no obvious performance regressions.
This PR removes lowered execution and cleans up dead code without
changing the Module API. A followup PR further simplifies the Module API
now that methods are simply a pair of (function, method_object).

gh-metadata: pytorch pytorch 21674 gh/zdevito/63/head
Remove lowered execution

Summary: First class modules can now run on our entire test suite,
and benchmarks indicate there is no obvious performance regressions.
This PR removes lowered execution and cleans up dead code without
changing the Module API. A followup PR further simplifies the Module API
now that methods are simply a pair of (function, method_object).

gh-metadata: pytorch pytorch 21674 gh/zdevito/63/head
Remove lowered execution

Summary: First class modules can now run on our entire test suite,
and benchmarks indicate there is no obvious performance regressions.
This PR removes lowered execution and cleans up dead code without
changing the Module API. A followup PR further simplifies the Module API
now that methods are simply a pair of (function, method_object).

gh-metadata: pytorch pytorch 21674 gh/zdevito/63/head
Remove lowered execution

Summary: First class modules can now run on our entire test suite,
and benchmarks indicate there is no obvious performance regressions.
This PR removes lowered execution and cleans up dead code without
changing the Module API. A followup PR further simplifies the Module API
now that methods are simply a pair of (function, method_object).

gh-metadata: pytorch pytorch 21674 gh/zdevito/63/head
@pytorchbot pytorchbot added the module: custom-operators custom operators, custom ops, custom-operators, custom-ops label Jun 14, 2019
zdevito added 2 commits June 14, 2019 21:49
Remove lowered execution

Summary: First class modules can now run on our entire test suite,
and benchmarks indicate there is no obvious performance regressions.
This PR removes lowered execution and cleans up dead code without
changing the Module API. A followup PR further simplifies the Module API
now that methods are simply a pair of (function, method_object).

gh-metadata: pytorch pytorch 21674 gh/zdevito/63/head
Remove lowered execution

Summary: First class modules can now run on our entire test suite,
and benchmarks indicate there is no obvious performance regressions.
This PR removes lowered execution and cleans up dead code without
changing the Module API. A followup PR further simplifies the Module API
now that methods are simply a pair of (function, method_object).

gh-metadata: pytorch pytorch 21674 gh/zdevito/63/head
@zou3519 zou3519 deleted the gh/zdevito/63/head branch June 16, 2019 21:32
zdevito added a commit to zdevito/ATen that referenced this pull request Jun 16, 2019
Summary:
Pull Request resolved: pytorch/pytorch#21674
ghimport-source-id: b8e27f0ce9b8b362daf73556ee67457fb5355062

Reviewed By: eellison

Differential Revision: D15777726

Pulled By: zdevito

fbshipit-source-id: 718ac676c9a1bcf99b856862fd29631d825645da
@facebook-github-bot
Copy link
Contributor

@zdevito merged this pull request in 972ec67.

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

Labels

Merged module: custom-operators custom operators, custom ops, custom-operators, custom-ops module: internals Related to internal abstractions in c10 and ATen module: pybind Related to our Python bindings / interactions with other Python libraries module: tests Issues related to tests (not the torch.testing module) 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