Download cuda/wkv7s_op.cpp from Ilikemechuri/quail-test: direct link, hf CLI and curl.
- Browser
- Download file 730 Bytes
-
https://huggingface.co/Ilikemechuri/quail-test/resolve/main/cuda/wkv7s_op.cpp
- Command line
-
hf download hf://Ilikemechuri/quail-test/cuda/wkv7s_op.cpp
-
curl -L -o wkv7s_op.cpp https://huggingface.co/Ilikemechuri/quail-test/resolve/main/cuda/wkv7s_op.cpp
730 Bytes
| typedef at::BFloat16 bf16; // model runs in bfloat16 (upstream default was at::Half) | |
| void cuda_forward(int B, int T, int C, int H, float *state, bf16 *r, bf16 *w, bf16 *k, bf16 *v, bf16 *a, bf16 *b, bf16 *y); | |
| void forward(int64_t B, int64_t T, int64_t C, int64_t H, torch::Tensor &state, torch::Tensor &r, torch::Tensor &w, torch::Tensor &k, torch::Tensor &v, torch::Tensor &a, torch::Tensor &b, torch::Tensor &y) { | |
| cuda_forward(B, T, C, H, state.data_ptr<float>(), r.data_ptr<bf16>(), w.data_ptr<bf16>(), k.data_ptr<bf16>(), v.data_ptr<bf16>(), a.data_ptr<bf16>(), b.data_ptr<bf16>(), y.data_ptr<bf16>()); | |
| } | |
| TORCH_LIBRARY(wkv7s, m) { | |
| m.def("forward", forward); | |
| } | |