Skip to content

Conversation

@gchanan
Copy link
Contributor

@gchanan gchanan commented Dec 3, 2018

This isn't hooked up to anything yet, this is just putting the skeleton in place.
The idea here is that the functions generated via Declarations.cwrap and nn.yaml are not actually operators, they are implementation details of operators, and thus don't need to participate in VariableType, JIT dispatch generation.

So, we will split these functions out from the usual Type/operator hierarchy; for now the dispatch will be done by a Type-like class called LegacyTHDispatcher. Once this is done this probably means we can collapse Type to be backend-specific, not Type/ScalarType specific, because all the ScalarType specific code will live in the LegacyTHDispatcher.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@gchanan has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.


namespace at {

// TODO: This could be bad juju if someone calls globalContext() in the
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment out of date

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is it? This is the same comment as in globalLegacyTypeDispatch -- is it out of date there? I'll admit I don't know what the comment is referring to.


// LegacyTHDispatcher is the legacy mechanism for dispatching directly
// to TH/THNN/THC/THCUNN functions in ATen, which is essentially a giant virtual
// dispatch table for every TH function we support dynamically dispatching over.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think what you want to add to the comment here is:

  1. Why you need another dispatcher, as opposed to using the existing LegacyTypeDispatch (you say that it's similar to the LegacyTypeDispatch with some simplifications, but that doesn't explain the "why")
  2. Under what situation we can delete this (when all the TH functions go away right)

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

I'm OK with this because we've discussed it in person, but I think you need to make sure @dzhulgakov and @smessmer understand what's going on here.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@gchanan has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@gchanan gchanan force-pushed the legacy_th_dispatcher branch from 58be3c0 to f0dcc50 Compare December 3, 2018 20:03
@gchanan gchanan force-pushed the legacy_th_dispatcher branch from f0dcc50 to a7e6f4d Compare December 3, 2018 20:33
…h#14708)

Summary:
This isn't hooked up to anything yet, this is just putting the skeleton in place.
The idea here is that the functions generated via Declarations.cwrap and nn.yaml are not actually operators, they are implementation details of operators, and thus don't need to participate in VariableType, JIT dispatch generation.

So, we will split these functions out from the usual Type/operator hierarchy; for now the dispatch will be done by a Type-like class called LegacyTHDispatcher.  Once this is done this probably means we can collapse Type to be backend-specific, not Type/ScalarType specific, because all the ScalarType specific code will live in the LegacyTHDispatcher.
Pull Request resolved: pytorch#14708

Reviewed By: ezyang

Differential Revision: D13304654

Pulled By: ezyang

fbshipit-source-id: dac7c7fba8b58d52836f48466e986487c58e78b0
@gchanan gchanan force-pushed the legacy_th_dispatcher branch from a7e6f4d to 65defe1 Compare December 3, 2018 23:41
zdevito pushed a commit to zdevito/ATen that referenced this pull request Dec 4, 2018
Summary:
This isn't hooked up to anything yet, this is just putting the skeleton in place.
The idea here is that the functions generated via Declarations.cwrap and nn.yaml are not actually operators, they are implementation details of operators, and thus don't need to participate in VariableType, JIT dispatch generation.

So, we will split these functions out from the usual Type/operator hierarchy; for now the dispatch will be done by a Type-like class called LegacyTHDispatcher.  Once this is done this probably means we can collapse Type to be backend-specific, not Type/ScalarType specific, because all the ScalarType specific code will live in the LegacyTHDispatcher.
Pull Request resolved: pytorch/pytorch#14708

Reviewed By: ezyang

Differential Revision: D13304654

Pulled By: gchanan

fbshipit-source-id: cfe3e1a28adcc355f67fe143495ee7e5c5118606
@ezyang ezyang added the merged label Jun 25, 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