Skip to content

add feature / fix bug: I fixed the kNRows feature in forward #161

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

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*__pycache__/
*.egg-info/
build/
**.so
*.so
*.whl
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_bwd.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_bwd_kernel.cuh"

template void selective_scan_bwd_cuda<1, float, float>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<1, at::Half, float>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<1, at::BFloat16, float>(SSMParamsBwd &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_bwd2.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_bwd_kernel.cuh"

template void selective_scan_bwd_cuda<2, float, float>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<2, at::Half, float>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<2, at::BFloat16, float>(SSMParamsBwd &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_bwd2_complex.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_bwd_kernel.cuh"

template void selective_scan_bwd_cuda<2, float, complex_t>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<2, at::Half, complex_t>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<2, at::BFloat16, complex_t>(SSMParamsBwd &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_bwd3.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_bwd_kernel.cuh"

template void selective_scan_bwd_cuda<3, float, float>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<3, at::Half, float>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<3, at::BFloat16, float>(SSMParamsBwd &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_bwd3_complex.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_bwd_kernel.cuh"

template void selective_scan_bwd_cuda<3, float, complex_t>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<3, at::Half, complex_t>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<3, at::BFloat16, complex_t>(SSMParamsBwd &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_bwd4.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_bwd_kernel.cuh"

template void selective_scan_bwd_cuda<4, float, float>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<4, at::Half, float>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<4, at::BFloat16, float>(SSMParamsBwd &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_bwd4_complex.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_bwd_kernel.cuh"

template void selective_scan_bwd_cuda<4, float, complex_t>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<4, at::Half, complex_t>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<4, at::BFloat16, complex_t>(SSMParamsBwd &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_bwd_complex.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_bwd_kernel.cuh"

template void selective_scan_bwd_cuda<1, float, complex_t>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<1, at::Half, complex_t>(SSMParamsBwd &params, cudaStream_t stream);
template void selective_scan_bwd_cuda<1, at::BFloat16, complex_t>(SSMParamsBwd &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_fwd.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_fwd_kernel.cuh"

template void selective_scan_fwd_cuda<1, float, float>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<1, at::BFloat16, float>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<1, at::Half, float>(SSMParamsBase &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_fwd2.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_fwd_kernel.cuh"

template void selective_scan_fwd_cuda<2, at::BFloat16, float>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<2, at::Half, float>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<2, float, float>(SSMParamsBase &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_fwd2_complex.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_fwd_kernel.cuh"

template void selective_scan_fwd_cuda<2, at::BFloat16, complex_t>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<2, at::Half, complex_t>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<2, float, complex_t>(SSMParamsBase &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_fwd3.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_fwd_kernel.cuh"

template void selective_scan_fwd_cuda<3, at::BFloat16, float>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<3, at::Half, float>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<3, float, float>(SSMParamsBase &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_fwd3_complex.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_fwd_kernel.cuh"

template void selective_scan_fwd_cuda<3, at::BFloat16, complex_t>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<3, at::Half, complex_t>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<3, float, complex_t>(SSMParamsBase &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_fwd4.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_fwd_kernel.cuh"

template void selective_scan_fwd_cuda<4, at::BFloat16, float>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<4, at::Half, float>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<4, float, float>(SSMParamsBase &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_fwd4_complex.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_fwd_kernel.cuh"

template void selective_scan_fwd_cuda<4, at::BFloat16, complex_t>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<4, at::Half, complex_t>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<4, float, complex_t>(SSMParamsBase &params, cudaStream_t stream);
11 changes: 11 additions & 0 deletions csrc/selective_scan/cus/selective_scan_fwd_complex.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/******************************************************************************
* Copyright (c) 2023, Tri Dao.
******************************************************************************/

// Split into multiple files to compile in paralell

#include "../selective_scan_fwd_kernel.cuh"

template void selective_scan_fwd_cuda<1, at::BFloat16, complex_t>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<1, at::Half, complex_t>(SSMParamsBase &params, cudaStream_t stream);
template void selective_scan_fwd_cuda<1, float, complex_t>(SSMParamsBase &params, cudaStream_t stream);
Loading