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

Add aten::maxunpool2d and aten::maxunpool3d #856

Merged
merged 17 commits into from
Oct 24, 2024
Merged

Add aten::maxunpool2d and aten::maxunpool3d #856

merged 17 commits into from
Oct 24, 2024

Conversation

yucai-intel
Copy link
Contributor

@yucai-intel yucai-intel commented Aug 30, 2024

  • max_unpool2d
  • max_unpool2d.out
  • max_unpool3d
  • max_unpool3d.out

@huaiyuzh huaiyuzh force-pushed the maxunpool branch 2 times, most recently from b047ddd to b1087b8 Compare September 5, 2024 05:59
const Tensor& indices,
IntArrayRef output_size,
Tensor& out) {
native::xpu::max_unpooling2d_forward_template(
Copy link
Contributor

Choose a reason for hiding this comment

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

rename: max_unpooling2d_forward_kernel

IntArrayRef stride,
IntArrayRef padding,
Tensor& out) {
native::xpu::max_unpooling3d_forward_template(
Copy link
Contributor

Choose a reason for hiding this comment

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

max_unpooling3d_forward_kernel

is_channels_last(is_channels_last_) {}

private:
const int64_t numInputElements;
Copy link
Contributor

Choose a reason for hiding this comment

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

using numInputElements_ as private variable name


private:
scalar_t* input_data;
int64_t* indices_data;
Copy link
Contributor

Choose a reason for hiding this comment

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

input_data_

output_data(output_data_) {}

private:
const int64_t numInputElements;
Copy link
Contributor

Choose a reason for hiding this comment

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

numInputElements_

oH,
oW,
offsetZ);
totalZ -= 65535;
Copy link
Contributor

Choose a reason for hiding this comment

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

65535 is CUDA restriction, we don't need to follow, just launch totalZ number.

#include <c10/util/Exception.h>
#include <comm/MemoryFormat.h>
#include <comm/SYCLHelpers.h>
#include <torch/library.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this head file ?
<ATen/native/xpu/sycl/Atomics.h>
<ATen/native/xpu/sycl/BatchKernel.h>
#include <ATen/native/xpu/sycl/NumericLimits.h>
#include <c10/core/Scalar.h>
#include <c10/util/Exception.h>
#include <torch/library.h>
please check

#pragma GCC diagnostic push
// Avoid SYCL compiler return-type error
#pragma clang diagnostic ignored "-Wreturn-type"
#pragma GCC diagnostic ignored "-Wreturn-type"
Copy link
Contributor

Choose a reason for hiding this comment

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

if atomic is no needed please remove above code

src/ATen/native/xpu/MaxUnpooling.cpp Show resolved Hide resolved
int64_t slice =
(item.get_group()[0] + offsetZ_) / iT_; // input slice/feature
if (iRow < iH_ && iColumn < iW_) {
scalar_t val = input_ptr
Copy link
Contributor

Choose a reason for hiding this comment

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

Pls use PackedTensorAccessor64

@xytintel
Copy link
Contributor

Pls check:
image

@xytintel xytintel added this pull request to the merge queue Oct 24, 2024
Merged via the queue into main with commit d974f63 Oct 24, 2024
3 checks passed
@xytintel xytintel deleted the maxunpool branch October 24, 2024 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants