Skip to content

Move the type registry out of Context, into LegacyTypeDispatch.#11274

Closed
ezyang wants to merge 143 commits intomasterfrom
export-D9657449
Closed

Move the type registry out of Context, into LegacyTypeDispatch.#11274
ezyang wants to merge 143 commits intomasterfrom
export-D9657449

Conversation

@ezyang
Copy link
Contributor

@ezyang ezyang commented Sep 5, 2018

Stack:
    :black_circle:  #11274 Move the type registry out of Context, into LegacyTypeDispatch.  💚
    :white_circle:  #11331 Improve LegacyTypeDispatch to handle initialization correctly.  💚

We don't want to put all of Context into ATen/core, but one
particular part cannot be avoided: the type registry, because
implementations of TensorMethods will need to get a Type,
and then do a virtual call on it.

I needed to do a little bit of (temporary) footwork to get this
in without also moving Type, because unique_ptr expects
to be able to see the destructor of Type (but it's forward declared
right now). So instead I put the destructor as an explicit functor. We
can get rid of this once Type actually moves in ATen/core

Differential Revision: D9657449

ezyang added 30 commits August 29, 2018 09:11
Differential Revision: D9557315
Differential Version: 56407314
Differential Revision: D9557315
Differential Version: 56413294
Differential Revision: D9557315
Differential Version: 56415719
Differential Revision: D9557315
Differential Version: 56424143
Differential Revision: D9557315
Differential Version: 56437859
Differential Revision: D9561478
Differential Version: 56437861
Differential Revision: D9561478
Differential Version: 56440382
Differential Revision: D9561478
Differential Version: 56440854
Differential Revision: D9562197
Differential Version: 56442349
Differential Revision: D9562312
Differential Version: 56443146
Differential Revision: D9562312
Differential Version: 5644335
Differential Revision: D9562467
Differential Version: 56443875
Differential Revision: D9562467
Differential Version: 56445436
Differential Revision: D9562312
Differential Version: 56445886
Differential Revision: D9557315
Differential Version: 56444203
Differential Revision: D9561478
Differential Version: 56446440
Differential Revision: D9562467
Differential Version: 56447016
Differential Revision: D9562467
Differential Version: 56447216
Differential Revision: D9561478
Differential Version: 56449391
Differential Revision: D9564206
Differential Version: 56452969
Differential Revision: D9562312
Differential Version: 56453321
Differential Revision: D9564516
Differential Version: 56455053
Differential Revision: D9562467
Differential Version: 56473044
Differential Revision: D9562197
Differential Version: 56473286
Differential Revision: D9578398
Differential Version: 56517363
Differential Revision: D9578399
Differential Version: 56517362
Differential Revision: D9578734
Differential Version: 56519039
Differential Revision: D9578734
Differential Version: 56520207
Differential Revision: D9578734
Differential Version: 56526151
Differential Revision: D9581560
Differential Version: 56526196
Differential Revision: D9646190
Differential Version: 57070541
Differential Revision: D9648830
Differential Version: 57070631
Differential Revision: D9654871
Differential Version: 57070630
Differential Revision: D9656548
Differential Version: 57070632
Differential Revision: D9657449
Differential Version: 57070633
Differential Revision: D9646190
Differential Version: 57070993
Differential Revision: D9648830
Differential Version: 57071087
Differential Revision: D9654871
Differential Version: 57071085
Differential Revision: D9656548
Differential Version: 57071082
Differential Revision: D9657449
Differential Version: 57071086
struct VariableHooks : public at::VariableHooksInterface {
VariableHooks(at::VariableHooksArgs) {}
void registerVariableTypeFor(at::Context*, at::Backend, at::ScalarType) const override;
void registerVariableTypeFor(at::LegacyTypeDispatch*, at::Backend, at::ScalarType) const override;

This comment was marked as off-topic.

This comment was marked as off-topic.

Differential Revision: D9648830
Differential Version: 57150331
Differential Revision: D9654871
Differential Version: 57150324
Differential Revision: D9656548
Differential Version: 57150327
Differential Revision: D9657449
Differential Version: 57150325
@ezyang ezyang changed the base branch from export-D9656548 to master September 7, 2018 15:29
Differential Revision: D9657449
Differential Version: 57247571
zdevito pushed a commit to zdevito/ATen that referenced this pull request Sep 8, 2018
Summary:
Pull Request resolved: pytorch/pytorch#11274

We don't want to put all of Context into ATen/core, but one
particular part cannot be avoided: the type registry, because
implementations of TensorMethods will need to get a Type,
and then do a virtual call on it.

I needed to do a little bit of (temporary) footwork to get this
in without also moving Type, because unique_ptr<Type> expects
to be able to see the destructor of Type (but it's forward declared
right now).  So instead I put the destructor as an explicit functor.  We
can get rid of this once Type actually moves in ATen/core

Reviewed By: cpuhrsch

Differential Revision: D9657449

fbshipit-source-id: 940931493bf4f1f6a8dad03f34633cacdd63dd0b
PenghuiCheng pushed a commit to PenghuiCheng/pytorch that referenced this pull request Sep 11, 2018
…rch#11274)

Summary:
Pull Request resolved: pytorch#11274

We don't want to put all of Context into ATen/core, but one
particular part cannot be avoided: the type registry, because
implementations of TensorMethods will need to get a Type,
and then do a virtual call on it.

I needed to do a little bit of (temporary) footwork to get this
in without also moving Type, because unique_ptr<Type> expects
to be able to see the destructor of Type (but it's forward declared
right now).  So instead I put the destructor as an explicit functor.  We
can get rid of this once Type actually moves in ATen/core

Reviewed By: cpuhrsch

Differential Revision: D9657449

fbshipit-source-id: 940931493bf4f1f6a8dad03f34633cacdd63dd0b
@soumith soumith deleted the export-D9657449 branch February 21, 2019 23:25
@ezyang ezyang added the merged label Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants