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::_thnn_fused_gru_cell and _thnn_fused_lstm_cell #926

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

yucai-intel
Copy link
Contributor

@yucai-intel yucai-intel commented Sep 20, 2024

_thnn_fused_gru_cell_forward
_thnn_fused_gru_cell_backward
_thnn_fused_lstm_cell_forward
_thnn_fused_lstm_cell_backward

#include <ATen/core/op_registration/adaption.h>
#include <ATen/native/cpu/mixed_data_type.h>
#include <ATen/native/xpu/sycl/GRUFusedCellKernels.h>
#include <ATen/xpu/XPUNativeFunctions.h>
Copy link

Choose a reason for hiding this comment

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

This header file seems to be non-existent from the build logs.
Would changing to XPUFunctions.h instead of XPUNativeFunctions.h make it work?

#include <ATen/core/op_registration/adaption.h>
#include <ATen/native/cpu/mixed_data_type.h>
#include <ATen/native/xpu/sycl/RNNKernels.h>

Copy link
Contributor

Choose a reason for hiding this comment

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

#include <ATen/core/op_registration/adaption.h>
#include <ATen/native/cpu/mixed_data_type.h>

please check if we need head files


auto hy = at::empty_like(hx, LEGACY_CONTIGUOUS_MEMORY_FORMAT);

AT_DISPATCH_FLOATING_TYPES_AND2(
Copy link
Contributor

Choose a reason for hiding this comment

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

How we handle non-contiguous input ? CUDA uses tensorInfo, but we just use raw data pointer, without stride information

const Tensor& hidden_bias =
c10::value_or_else(hidden_bias_opt, [] { return Tensor(); });

auto batched_input = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

If hard code true, can we remove it

@yucai-intel yucai-intel changed the title Add aten::_thnn_fused_gru_cell (forward and backward) Add aten::_thnn_fused_gru_cell and _thnn_fused_lstm_cell Nov 8, 2024
@xytintel
Copy link
Contributor

xytintel commented Nov 8, 2024

@yucai-intel Pls show the testcase

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