Skip to content

Conversation

@ifedan
Copy link
Contributor

@ifedan ifedan commented May 3, 2019

Summary:

  • enable generation of conv2d for LongTensor
  • enable generation of avg_pool2d for LongTensor

Differential Revision: D15192353

@pytorchbot pytorchbot added module: cpu CPU specific problem (e.g., perf, algorithm) module: cublas Problem related to cublas support module: cuda Related to torch.cuda, and CUDA support in general module: internals Related to internal abstractions in c10 and ATen module: operators labels May 3, 2019
@ifedan ifedan force-pushed the export-D15192353 branch 2 times, most recently from 5c94fca to 1335a39 Compare May 3, 2019 18:06
Summary:
- enable generation of conv2d for LongTensor
- enable generation of avg_pool2d for LongTensor

Differential Revision: D15192353

fbshipit-source-id: fb293ca7fd647a20b1f8ded11c70b59af93937d4
@ifedan ifedan force-pushed the export-D15192353 branch from 1335a39 to 7f95e91 Compare May 3, 2019 18:07
Copy link
Contributor

@gchanan gchanan left a comment

Choose a reason for hiding this comment

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

testing? It also seems like you don't support a larger number of cases, e.g. depthwise, transposed, dilated convolutions.

Maybe similar on the AvgPool / SumPool too, but I'm not sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

instead of doing this, can you just include Long manually where you need it?

i.e.

#include "whatever"
#include "THGenerateFloatTypes.h"
#include "whatever
#include "THGenerateLongType.h"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed: #20370

Copy link
Contributor

Choose a reason for hiding this comment

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

we shouldn't define this if it's not supported (and won't be in the near future). Just throw an error in the implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed: #20370

scalar_check:
output: 'false'
grad_input: 'false'
scalar_types: ['Float', 'Double', 'Half', 'Long']
Copy link
Contributor

Choose a reason for hiding this comment

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

can we support cpu_scalar_types and cuda_scalar_types since we don't actually support conv2d for longs on CUDA anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added implementation: #20370

bool ceil_mode,
bool count_include_pad);

THC_API void THNN_(SpatialAveragePooling_updateGradInput)(
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think these backward definitions (updateGradInput, accGradParameters) make sense for integer types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed: #20370

int padW, int padH,
accreal scale);

TH_API void THNN_(SpatialAveragePooling_updateOutput)(
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this makes sense to implement for long because of the integer division (i.e. we don't support long on mean). Doesn't it make sense to implement SumPool instead?

@ifedan
Copy link
Contributor Author

ifedan commented May 10, 2019

There is another PR: #20370 that will track this FR. This one will be closed

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

Labels

module: cpu CPU specific problem (e.g., perf, algorithm) module: cublas Problem related to cublas support module: cuda Related to torch.cuda, and CUDA support in general module: internals Related to internal abstractions in c10 and ATen

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants