FlashRWKV2 0.1.0a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. flashrwkv2-0.1.0a1/FlashRWKV2.egg-info/PKG-INFO +102 -0
  2. flashrwkv2-0.1.0a1/FlashRWKV2.egg-info/SOURCES.txt +109 -0
  3. flashrwkv2-0.1.0a1/FlashRWKV2.egg-info/dependency_links.txt +1 -0
  4. flashrwkv2-0.1.0a1/FlashRWKV2.egg-info/not-zip-safe +1 -0
  5. flashrwkv2-0.1.0a1/FlashRWKV2.egg-info/requires.txt +1 -0
  6. flashrwkv2-0.1.0a1/FlashRWKV2.egg-info/top_level.txt +1 -0
  7. flashrwkv2-0.1.0a1/LICENSE +22 -0
  8. flashrwkv2-0.1.0a1/LICENSES/Apache-2.0.txt +201 -0
  9. flashrwkv2-0.1.0a1/MANIFEST.in +7 -0
  10. flashrwkv2-0.1.0a1/NOTICE +82 -0
  11. flashrwkv2-0.1.0a1/PKG-INFO +102 -0
  12. flashrwkv2-0.1.0a1/README.md +89 -0
  13. flashrwkv2-0.1.0a1/csrc/bindings.cpp +39 -0
  14. flashrwkv2-0.1.0a1/csrc/bindings.h +40 -0
  15. flashrwkv2-0.1.0a1/csrc/registration.cpp +8 -0
  16. flashrwkv2-0.1.0a1/csrc/sm120/cmix/mix/infer_fp16_forward_varlen.cpp +255 -0
  17. flashrwkv2-0.1.0a1/csrc/sm120/cmix/mix/infer_fp16_forward_varlen.cu +288 -0
  18. flashrwkv2-0.1.0a1/csrc/sm120/cmix/sparse/infer_fp16_forward_varlen.cpp +298 -0
  19. flashrwkv2-0.1.0a1/csrc/sm120/cmix/sparse/infer_fp16_forward_varlen.cu +1156 -0
  20. flashrwkv2-0.1.0a1/csrc/sm120/embedding/infer_fp16_forward_varlen.cpp +48 -0
  21. flashrwkv2-0.1.0a1/csrc/sm120/embedding/infer_fp16_forward_varlen.cu +154 -0
  22. flashrwkv2-0.1.0a1/csrc/sm120/head/linear/infer_fp16_forward_varlen.cpp +103 -0
  23. flashrwkv2-0.1.0a1/csrc/sm120/head/linear/infer_fp16_forward_varlen.cu +87 -0
  24. flashrwkv2-0.1.0a1/csrc/sm120/tmix/kk_a_gate/infer_fp16_forward_varlen.cpp +83 -0
  25. flashrwkv2-0.1.0a1/csrc/sm120/tmix/kk_a_gate/infer_fp16_forward_varlen.cu +193 -0
  26. flashrwkv2-0.1.0a1/csrc/sm120/tmix/linear/infer_fp16_forward_varlen.cpp +464 -0
  27. flashrwkv2-0.1.0a1/csrc/sm120/tmix/linear/infer_fp16_forward_varlen.cu +3100 -0
  28. flashrwkv2-0.1.0a1/csrc/sm120/tmix/lnx_rkvres_xg/infer_fp16_forward_varlen.cpp +88 -0
  29. flashrwkv2-0.1.0a1/csrc/sm120/tmix/lnx_rkvres_xg/infer_fp16_forward_varlen.cu +277 -0
  30. flashrwkv2-0.1.0a1/csrc/sm120/tmix/mix6/infer_fp16_forward_varlen.cpp +262 -0
  31. flashrwkv2-0.1.0a1/csrc/sm120/tmix/mix6/infer_fp16_forward_varlen.cu +295 -0
  32. flashrwkv2-0.1.0a1/csrc/sm120/tmix/normalization/infer_fp16_forward_varlen.cpp +121 -0
  33. flashrwkv2-0.1.0a1/csrc/sm120/tmix/normalization/infer_fp16_forward_varlen.cu +2103 -0
  34. flashrwkv2-0.1.0a1/csrc/sm120/tmix/vres_gate/infer_fp16_forward_varlen.cpp +61 -0
  35. flashrwkv2-0.1.0a1/csrc/sm120/tmix/vres_gate/infer_fp16_forward_varlen.cu +146 -0
  36. flashrwkv2-0.1.0a1/csrc/sm120/tmix/wkv7/infer_chunk_bf16_forward_varlen.cpp +183 -0
  37. flashrwkv2-0.1.0a1/csrc/sm120/tmix/wkv7/infer_chunk_bf16_forward_varlen.cu +334 -0
  38. flashrwkv2-0.1.0a1/csrc/sm120/tmix/wkv7/infer_recurrent_fp16_forward_varlen.cpp +302 -0
  39. flashrwkv2-0.1.0a1/csrc/sm120/tmix/wkv7/infer_recurrent_fp16_forward_varlen.cu +1213 -0
  40. flashrwkv2-0.1.0a1/csrc/sm120/tmix/wkv7/infer_recurrent_fp32io16_forward_varlen.cpp +362 -0
  41. flashrwkv2-0.1.0a1/csrc/sm120/tmix/wkv7/infer_recurrent_fp32io16_forward_varlen.cu +498 -0
  42. flashrwkv2-0.1.0a1/csrc/sm120/tmix/wkv7/recurrent_decay.cuh +48 -0
  43. flashrwkv2-0.1.0a1/csrc/sm90/cmix/mix/pretrain_bf16_backward.cpp +50 -0
  44. flashrwkv2-0.1.0a1/csrc/sm90/cmix/mix/pretrain_bf16_backward.cu +308 -0
  45. flashrwkv2-0.1.0a1/csrc/sm90/cmix/mix/pretrain_bf16_forward.cpp +46 -0
  46. flashrwkv2-0.1.0a1/csrc/sm90/cmix/mix/pretrain_bf16_forward.cu +296 -0
  47. flashrwkv2-0.1.0a1/csrc/sm90/head/l2wrap_ce/pretrain_bf16_forward.cpp +70 -0
  48. flashrwkv2-0.1.0a1/csrc/sm90/head/l2wrap_ce/pretrain_bf16_forward.cu +293 -0
  49. flashrwkv2-0.1.0a1/csrc/sm90/loss/l2wrap_ce/pretrain_bf16_backward.cpp +47 -0
  50. flashrwkv2-0.1.0a1/csrc/sm90/loss/l2wrap_ce/pretrain_bf16_backward.cu +306 -0
  51. flashrwkv2-0.1.0a1/csrc/sm90/loss/l2wrap_ce/pretrain_bf16_forward.cpp +43 -0
  52. flashrwkv2-0.1.0a1/csrc/sm90/loss/l2wrap_ce/pretrain_bf16_forward.cu +309 -0
  53. flashrwkv2-0.1.0a1/csrc/sm90/rl_infctx/wkv7/rl_infctx_chunk_fp32io16_backward.cpp +136 -0
  54. flashrwkv2-0.1.0a1/csrc/sm90/rl_infctx/wkv7/rl_infctx_chunk_fp32io16_backward.cu +226 -0
  55. flashrwkv2-0.1.0a1/csrc/sm90/rl_infctx/wkv7/rl_infctx_chunk_fp32io16_forward.cpp +225 -0
  56. flashrwkv2-0.1.0a1/csrc/sm90/rl_infctx/wkv7/rl_infctx_chunk_fp32io16_forward.cu +864 -0
  57. flashrwkv2-0.1.0a1/csrc/sm90/rl_infctx/wkv7/rl_infctx_chunk_fp32io16_replay.cuh +42 -0
  58. flashrwkv2-0.1.0a1/csrc/sm90/tmix/a_gate/pretrain_bf16_backward.cpp +40 -0
  59. flashrwkv2-0.1.0a1/csrc/sm90/tmix/a_gate/pretrain_bf16_backward.cu +158 -0
  60. flashrwkv2-0.1.0a1/csrc/sm90/tmix/a_gate/pretrain_bf16_forward.cpp +41 -0
  61. flashrwkv2-0.1.0a1/csrc/sm90/tmix/a_gate/pretrain_bf16_forward.cu +153 -0
  62. flashrwkv2-0.1.0a1/csrc/sm90/tmix/kk_pre/pretrain_bf16_backward.cpp +105 -0
  63. flashrwkv2-0.1.0a1/csrc/sm90/tmix/kk_pre/pretrain_bf16_backward.cu +246 -0
  64. flashrwkv2-0.1.0a1/csrc/sm90/tmix/kk_pre/pretrain_bf16_forward.cpp +74 -0
  65. flashrwkv2-0.1.0a1/csrc/sm90/tmix/kk_pre/pretrain_bf16_forward.cu +221 -0
  66. flashrwkv2-0.1.0a1/csrc/sm90/tmix/lnx_rkvres_xg/pretrain_bf16_backward.cpp +104 -0
  67. flashrwkv2-0.1.0a1/csrc/sm90/tmix/lnx_rkvres_xg/pretrain_bf16_backward.cu +353 -0
  68. flashrwkv2-0.1.0a1/csrc/sm90/tmix/lnx_rkvres_xg/pretrain_bf16_forward.cpp +93 -0
  69. flashrwkv2-0.1.0a1/csrc/sm90/tmix/lnx_rkvres_xg/pretrain_bf16_forward.cu +314 -0
  70. flashrwkv2-0.1.0a1/csrc/sm90/tmix/mix6/pretrain_bf16_backward.cpp +57 -0
  71. flashrwkv2-0.1.0a1/csrc/sm90/tmix/mix6/pretrain_bf16_backward.cu +314 -0
  72. flashrwkv2-0.1.0a1/csrc/sm90/tmix/mix6/pretrain_bf16_forward.cpp +44 -0
  73. flashrwkv2-0.1.0a1/csrc/sm90/tmix/mix6/pretrain_bf16_forward.cu +280 -0
  74. flashrwkv2-0.1.0a1/csrc/sm90/tmix/vres_gate/pretrain_bf16_backward.cpp +47 -0
  75. flashrwkv2-0.1.0a1/csrc/sm90/tmix/vres_gate/pretrain_bf16_backward.cu +186 -0
  76. flashrwkv2-0.1.0a1/csrc/sm90/tmix/vres_gate/pretrain_bf16_forward.cpp +46 -0
  77. flashrwkv2-0.1.0a1/csrc/sm90/tmix/vres_gate/pretrain_bf16_forward.cu +173 -0
  78. flashrwkv2-0.1.0a1/csrc/sm90/tmix/wkv7/pretrain_recurrent_bf16_forward.cpp +35 -0
  79. flashrwkv2-0.1.0a1/csrc/sm90/tmix/wkv7/pretrain_recurrent_bf16_forward.cu +230 -0
  80. flashrwkv2-0.1.0a1/csrc/sm90/tmix/wkv7/statetune_recurrent_fp32io16_backward.cpp +82 -0
  81. flashrwkv2-0.1.0a1/csrc/sm90/tmix/wkv7/statetune_recurrent_fp32io16_backward.cu +707 -0
  82. flashrwkv2-0.1.0a1/csrc/sm90/tmix/wkv7/statetune_recurrent_fp32io16_forward.cpp +56 -0
  83. flashrwkv2-0.1.0a1/csrc/sm90/tmix/wkv7/statetune_recurrent_fp32io16_forward.cu +245 -0
  84. flashrwkv2-0.1.0a1/csrc/validation/recurrent_metadata.cu +142 -0
  85. flashrwkv2-0.1.0a1/csrc/validation.cpp +131 -0
  86. flashrwkv2-0.1.0a1/csrc/validation.h +47 -0
  87. flashrwkv2-0.1.0a1/flashrwkv2/__init__.py +151 -0
  88. flashrwkv2-0.1.0a1/flashrwkv2/cmix/mix/__init__.py +261 -0
  89. flashrwkv2-0.1.0a1/flashrwkv2/cmix/sparse/__init__.py +187 -0
  90. flashrwkv2-0.1.0a1/flashrwkv2/embedding/__init__.py +33 -0
  91. flashrwkv2-0.1.0a1/flashrwkv2/head/l2wrap_ce/__init__.py +64 -0
  92. flashrwkv2-0.1.0a1/flashrwkv2/head/linear/__init__.py +114 -0
  93. flashrwkv2-0.1.0a1/flashrwkv2/loss/l2wrap_ce/__init__.py +54 -0
  94. flashrwkv2-0.1.0a1/flashrwkv2/rl_infctx/__init__.py +1 -0
  95. flashrwkv2-0.1.0a1/flashrwkv2/rl_infctx/wkv7/__init__.py +162 -0
  96. flashrwkv2-0.1.0a1/flashrwkv2/tmix/a_gate/__init__.py +47 -0
  97. flashrwkv2-0.1.0a1/flashrwkv2/tmix/kk_a_gate/__init__.py +60 -0
  98. flashrwkv2-0.1.0a1/flashrwkv2/tmix/kk_pre/__init__.py +68 -0
  99. flashrwkv2-0.1.0a1/flashrwkv2/tmix/linear/__init__.py +496 -0
  100. flashrwkv2-0.1.0a1/flashrwkv2/tmix/lnx_rkvres_xg/__init__.py +71 -0
  101. flashrwkv2-0.1.0a1/flashrwkv2/tmix/lnx_rkvres_xg/pretrain.py +72 -0
  102. flashrwkv2-0.1.0a1/flashrwkv2/tmix/mix6/__init__.py +253 -0
  103. flashrwkv2-0.1.0a1/flashrwkv2/tmix/normalization/__init__.py +99 -0
  104. flashrwkv2-0.1.0a1/flashrwkv2/tmix/vres_gate/__init__.py +77 -0
  105. flashrwkv2-0.1.0a1/flashrwkv2/tmix/wkv7/__init__.py +354 -0
  106. flashrwkv2-0.1.0a1/flashrwkv2/tmix/wkv7/chunk.py +128 -0
  107. flashrwkv2-0.1.0a1/flashrwkv2/tmix/wkv7/pretrain.py +123 -0
  108. flashrwkv2-0.1.0a1/flashrwkv2/tmix/wkv7/statetune.py +239 -0
  109. flashrwkv2-0.1.0a1/pyproject.toml +37 -0
  110. flashrwkv2-0.1.0a1/setup.cfg +4 -0
  111. flashrwkv2-0.1.0a1/setup.py +239 -0
@@ -0,0 +1,102 @@
1
+ Metadata-Version: 2.4
2
+ Name: FlashRWKV2
3
+ Version: 0.1.0a1
4
+ Summary: High-performance CUDA operator library for RWKV-7
5
+ License-Expression: MIT
6
+ Project-URL: Repository, https://github.com/rwkv-rs/FlashRWKV2
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ License-File: NOTICE
11
+ Requires-Dist: torch==2.11.0
12
+ Dynamic: license-file
13
+
14
+ # FlashRWKV2
15
+
16
+ FlashRWKV2 is a high-performance CUDA operator library for RWKV-7. It provides
17
+ composable inference and training operators; complete models, schedulers, and
18
+ training frameworks remain the responsibility of downstream projects.
19
+
20
+ ## Requirements
21
+
22
+ - Python 3.10 or newer
23
+ - An NVIDIA CUDA build environment and a supported CUDA device
24
+ - `uv`, using the repository-local `./.venv`
25
+ - SM120 or newer for the current native build
26
+
27
+ The runtime and reproducible source-build contracts currently pin PyTorch
28
+ 2.11.0. When the build cannot detect a local GPU, set
29
+ `TORCH_CUDA_ARCH_LIST=12.0` explicitly.
30
+
31
+ ## Installation
32
+
33
+ The current alpha is distributed as source and builds the CUDA extension on the
34
+ target machine:
35
+
36
+ ```bash
37
+ TORCH_CUDA_ARCH_LIST=12.0 \
38
+ python -m pip install --pre FlashRWKV2
39
+ ```
40
+
41
+ For development from a checkout:
42
+
43
+ ```bash
44
+ git clone https://github.com/rwkv-rs/FlashRWKV2.git
45
+ cd FlashRWKV2
46
+ uv sync
47
+ TORCH_CUDA_ARCH_LIST=12.0 \
48
+ ./.venv/bin/python -m pip install -v --no-build-isolation -e .
49
+ ```
50
+
51
+ ## Kernel API
52
+
53
+ See the [Kernel API reference](https://github.com/rwkv-rs/FlashRWKV2/blob/main/docs/kernel_api.md)
54
+ for the complete public operator surface and tensor contracts.
55
+
56
+ ## Tests
57
+
58
+ ```bash
59
+ ./.venv/bin/python -m pytest -q
60
+ ```
61
+
62
+ CUDA tests require a successfully built `flashrwkv2._C` extension and a
63
+ supported GPU.
64
+
65
+ ## Benchmarks
66
+
67
+ Operator benchmarks live in [`benchmarks/`](benchmarks/). For example, run the
68
+ WKV7 recurrent correctness benchmark with:
69
+
70
+ ```bash
71
+ ./.venv/bin/python -m benchmarks.tmix.wkv7.bench \
72
+ --shapes h32d64 \
73
+ --dtype bfloat16 \
74
+ --correctness-only \
75
+ --output /tmp/flashrwkv2-wkv7-correctness.json
76
+ ```
77
+
78
+ These benchmarks measure individual operators. They do not report or infer
79
+ model-level latency.
80
+
81
+ For Albatross-compatible TMix low-rank inference, `varlen` means that the
82
+ operator consumes packed token rows; it does not mean that one fused kernel is
83
+ used for every row count. The public composite callers automatically use the
84
+ canonical fused rank-in window at `M<=7`, the fused rank-out/value-residual
85
+ window at `M<=4`, and the canonical large-row linear dispatcher otherwise.
86
+ Callers may provide both the original checkpoint layout and a runtime layout.
87
+ Both layouts must be prepared outside the timed forward region and retained for
88
+ the lifetime of the inference weights; FlashRWKV2 never transposes or copies a
89
+ missing layout during dispatch.
90
+
91
+ The existing low-rank operator benchmark reports correctness and latency as
92
+ JSON without adding a model-level benchmark:
93
+
94
+ ```bash
95
+ ./.venv/bin/python benchmarks/tmix/linear/bench.py \
96
+ --operator projection-group --layout both --channels 4096
97
+ ```
98
+
99
+ ## License
100
+
101
+ FlashRWKV2 is distributed under the
102
+ [MIT License](https://github.com/rwkv-rs/FlashRWKV2/blob/main/LICENSE).
@@ -0,0 +1,109 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ NOTICE
4
+ README.md
5
+ pyproject.toml
6
+ setup.py
7
+ FlashRWKV2.egg-info/PKG-INFO
8
+ FlashRWKV2.egg-info/SOURCES.txt
9
+ FlashRWKV2.egg-info/dependency_links.txt
10
+ FlashRWKV2.egg-info/not-zip-safe
11
+ FlashRWKV2.egg-info/requires.txt
12
+ FlashRWKV2.egg-info/top_level.txt
13
+ LICENSES/Apache-2.0.txt
14
+ csrc/bindings.cpp
15
+ csrc/bindings.h
16
+ csrc/registration.cpp
17
+ csrc/validation.cpp
18
+ csrc/validation.h
19
+ csrc/sm120/cmix/mix/infer_fp16_forward_varlen.cpp
20
+ csrc/sm120/cmix/mix/infer_fp16_forward_varlen.cu
21
+ csrc/sm120/cmix/sparse/infer_fp16_forward_varlen.cpp
22
+ csrc/sm120/cmix/sparse/infer_fp16_forward_varlen.cu
23
+ csrc/sm120/embedding/infer_fp16_forward_varlen.cpp
24
+ csrc/sm120/embedding/infer_fp16_forward_varlen.cu
25
+ csrc/sm120/head/linear/infer_fp16_forward_varlen.cpp
26
+ csrc/sm120/head/linear/infer_fp16_forward_varlen.cu
27
+ csrc/sm120/tmix/kk_a_gate/infer_fp16_forward_varlen.cpp
28
+ csrc/sm120/tmix/kk_a_gate/infer_fp16_forward_varlen.cu
29
+ csrc/sm120/tmix/linear/infer_fp16_forward_varlen.cpp
30
+ csrc/sm120/tmix/linear/infer_fp16_forward_varlen.cu
31
+ csrc/sm120/tmix/lnx_rkvres_xg/infer_fp16_forward_varlen.cpp
32
+ csrc/sm120/tmix/lnx_rkvres_xg/infer_fp16_forward_varlen.cu
33
+ csrc/sm120/tmix/mix6/infer_fp16_forward_varlen.cpp
34
+ csrc/sm120/tmix/mix6/infer_fp16_forward_varlen.cu
35
+ csrc/sm120/tmix/normalization/infer_fp16_forward_varlen.cpp
36
+ csrc/sm120/tmix/normalization/infer_fp16_forward_varlen.cu
37
+ csrc/sm120/tmix/vres_gate/infer_fp16_forward_varlen.cpp
38
+ csrc/sm120/tmix/vres_gate/infer_fp16_forward_varlen.cu
39
+ csrc/sm120/tmix/wkv7/infer_chunk_bf16_forward_varlen.cpp
40
+ csrc/sm120/tmix/wkv7/infer_chunk_bf16_forward_varlen.cu
41
+ csrc/sm120/tmix/wkv7/infer_recurrent_fp16_forward_varlen.cpp
42
+ csrc/sm120/tmix/wkv7/infer_recurrent_fp16_forward_varlen.cu
43
+ csrc/sm120/tmix/wkv7/infer_recurrent_fp32io16_forward_varlen.cpp
44
+ csrc/sm120/tmix/wkv7/infer_recurrent_fp32io16_forward_varlen.cu
45
+ csrc/sm120/tmix/wkv7/recurrent_decay.cuh
46
+ csrc/sm90/cmix/mix/pretrain_bf16_backward.cpp
47
+ csrc/sm90/cmix/mix/pretrain_bf16_backward.cu
48
+ csrc/sm90/cmix/mix/pretrain_bf16_forward.cpp
49
+ csrc/sm90/cmix/mix/pretrain_bf16_forward.cu
50
+ csrc/sm90/head/l2wrap_ce/pretrain_bf16_forward.cpp
51
+ csrc/sm90/head/l2wrap_ce/pretrain_bf16_forward.cu
52
+ csrc/sm90/loss/l2wrap_ce/pretrain_bf16_backward.cpp
53
+ csrc/sm90/loss/l2wrap_ce/pretrain_bf16_backward.cu
54
+ csrc/sm90/loss/l2wrap_ce/pretrain_bf16_forward.cpp
55
+ csrc/sm90/loss/l2wrap_ce/pretrain_bf16_forward.cu
56
+ csrc/sm90/rl_infctx/wkv7/rl_infctx_chunk_fp32io16_backward.cpp
57
+ csrc/sm90/rl_infctx/wkv7/rl_infctx_chunk_fp32io16_backward.cu
58
+ csrc/sm90/rl_infctx/wkv7/rl_infctx_chunk_fp32io16_forward.cpp
59
+ csrc/sm90/rl_infctx/wkv7/rl_infctx_chunk_fp32io16_forward.cu
60
+ csrc/sm90/rl_infctx/wkv7/rl_infctx_chunk_fp32io16_replay.cuh
61
+ csrc/sm90/tmix/a_gate/pretrain_bf16_backward.cpp
62
+ csrc/sm90/tmix/a_gate/pretrain_bf16_backward.cu
63
+ csrc/sm90/tmix/a_gate/pretrain_bf16_forward.cpp
64
+ csrc/sm90/tmix/a_gate/pretrain_bf16_forward.cu
65
+ csrc/sm90/tmix/kk_pre/pretrain_bf16_backward.cpp
66
+ csrc/sm90/tmix/kk_pre/pretrain_bf16_backward.cu
67
+ csrc/sm90/tmix/kk_pre/pretrain_bf16_forward.cpp
68
+ csrc/sm90/tmix/kk_pre/pretrain_bf16_forward.cu
69
+ csrc/sm90/tmix/lnx_rkvres_xg/pretrain_bf16_backward.cpp
70
+ csrc/sm90/tmix/lnx_rkvres_xg/pretrain_bf16_backward.cu
71
+ csrc/sm90/tmix/lnx_rkvres_xg/pretrain_bf16_forward.cpp
72
+ csrc/sm90/tmix/lnx_rkvres_xg/pretrain_bf16_forward.cu
73
+ csrc/sm90/tmix/mix6/pretrain_bf16_backward.cpp
74
+ csrc/sm90/tmix/mix6/pretrain_bf16_backward.cu
75
+ csrc/sm90/tmix/mix6/pretrain_bf16_forward.cpp
76
+ csrc/sm90/tmix/mix6/pretrain_bf16_forward.cu
77
+ csrc/sm90/tmix/vres_gate/pretrain_bf16_backward.cpp
78
+ csrc/sm90/tmix/vres_gate/pretrain_bf16_backward.cu
79
+ csrc/sm90/tmix/vres_gate/pretrain_bf16_forward.cpp
80
+ csrc/sm90/tmix/vres_gate/pretrain_bf16_forward.cu
81
+ csrc/sm90/tmix/wkv7/pretrain_recurrent_bf16_forward.cpp
82
+ csrc/sm90/tmix/wkv7/pretrain_recurrent_bf16_forward.cu
83
+ csrc/sm90/tmix/wkv7/statetune_recurrent_fp32io16_backward.cpp
84
+ csrc/sm90/tmix/wkv7/statetune_recurrent_fp32io16_backward.cu
85
+ csrc/sm90/tmix/wkv7/statetune_recurrent_fp32io16_forward.cpp
86
+ csrc/sm90/tmix/wkv7/statetune_recurrent_fp32io16_forward.cu
87
+ csrc/validation/recurrent_metadata.cu
88
+ flashrwkv2/__init__.py
89
+ flashrwkv2/cmix/mix/__init__.py
90
+ flashrwkv2/cmix/sparse/__init__.py
91
+ flashrwkv2/embedding/__init__.py
92
+ flashrwkv2/head/l2wrap_ce/__init__.py
93
+ flashrwkv2/head/linear/__init__.py
94
+ flashrwkv2/loss/l2wrap_ce/__init__.py
95
+ flashrwkv2/rl_infctx/__init__.py
96
+ flashrwkv2/rl_infctx/wkv7/__init__.py
97
+ flashrwkv2/tmix/a_gate/__init__.py
98
+ flashrwkv2/tmix/kk_a_gate/__init__.py
99
+ flashrwkv2/tmix/kk_pre/__init__.py
100
+ flashrwkv2/tmix/linear/__init__.py
101
+ flashrwkv2/tmix/lnx_rkvres_xg/__init__.py
102
+ flashrwkv2/tmix/lnx_rkvres_xg/pretrain.py
103
+ flashrwkv2/tmix/mix6/__init__.py
104
+ flashrwkv2/tmix/normalization/__init__.py
105
+ flashrwkv2/tmix/vres_gate/__init__.py
106
+ flashrwkv2/tmix/wkv7/__init__.py
107
+ flashrwkv2/tmix/wkv7/chunk.py
108
+ flashrwkv2/tmix/wkv7/pretrain.py
109
+ flashrwkv2/tmix/wkv7/statetune.py
@@ -0,0 +1 @@
1
+ torch==2.11.0
@@ -0,0 +1 @@
1
+ flashrwkv2
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MoonshotAI
4
+ Copyright (c) 2026 FlashRWKV2 contributors
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,7 @@
1
+ include LICENSE
2
+ include NOTICE
3
+ include README.md
4
+ include pyproject.toml
5
+ include setup.py
6
+ recursive-include LICENSES *.txt
7
+ recursive-include csrc *.cpp *.cu *.cuh *.h *.hpp
@@ -0,0 +1,82 @@
1
+ FlashRWKV2
2
+
3
+ This repository began from MoonshotAI/FlashKDA, distributed under the MIT
4
+ License. The original KDA attention operator, Python package, tests, and
5
+ benchmark data-plane were removed. The following new RWKV-7 files retain the
6
+ MIT boundary and derive their explicit K1/K2 launch separation from
7
+ MoonshotAI/FlashKDA commit
8
+ 1ce47ea3bb22c84eb9cc665028399cf35e8ffb0b:
9
+
10
+ - csrc/infer/wkv7/infer_common_chunk_bf16_forward_k1_prepare.cu
11
+ - csrc/infer/wkv7/infer_common_chunk_bf16_forward_k2_recurrence.cu
12
+ - csrc/infer/wkv7/infer_common_chunk_bf16_bindings.cpp
13
+
14
+ They implement the canonical RWKV-7 recurrence, not the KDA attention
15
+ mathematics.
16
+
17
+ The following files contain material adapted from the vLLM project and its
18
+ RWKV/Albatross integration at rwkv-rs/vllm-rwkv commit
19
+ 6d683f9e49a2997e405c47edc147872c8609513b:
20
+
21
+ - csrc/infer/wkv7/infer_common_recurrent_varlen_bindings.cpp
22
+ - csrc/infer/wkv7/infer_common_recurrent_fp32io16_forward_varlen.cu
23
+ - csrc/infer/wkv7/infer_sm80_recurrent_fp16_forward_varlen.cu
24
+ - benchmarks/infer/wkv7/benchmark_infer_recurrent_fp16_fp32io16_forward_varlen.py
25
+ - benchmarks/benchmark_rwkv7.py
26
+ - benchmarks/benchmark_training.py
27
+ - benchmarks/kernel_benchmark.py
28
+
29
+ The FP16 recurrent lineage includes BlinkDL/Albatross faster3a_2607 commit
30
+ 63c53f4abf2cd891dd3a18c8f44f5b2cccc8c64b.
31
+
32
+ The following fused FP16 inference block operators are adapted from
33
+ BlinkDL/Albatross faster3a_2607 commit
34
+ ee3308f6922e59f2166c7fac3c5a192340a2b48e:
35
+
36
+ - csrc/infer/tmix/infer_common_tmix_fp16_forward_registration.cpp
37
+ - csrc/infer/tmix/infer_common_tmix_fp16_forward.cu
38
+ - csrc/infer/cmix/infer_common_cmix_fp16_forward_registration.cpp
39
+ - csrc/infer/cmix/infer_common_cmix_fp16_forward.cu
40
+ - csrc/infer/elementwise/infer_common_elementwise_fp16_forward_registration.cpp
41
+ - csrc/infer/elementwise/infer_common_elementwise_fp16_forward.cu
42
+
43
+ The already-owned FP16/FP32 WKV recurrence files from that source are not
44
+ duplicated. These derived files are licensed under the Apache License,
45
+ Version 2.0; see LICENSES/Apache-2.0.txt.
46
+
47
+ The following files contain recurrent checkpoint and reverse-recurrence
48
+ methods adapted from BlinkDL/RWKV-LM commit
49
+ 952102498e9ed367ea0a59ee64106916d474d30f:
50
+
51
+ - csrc/common/wkv7/recurrent_common_fp32io16.cpp
52
+ - csrc/common/wkv7/recurrent_common_fp32io16.h
53
+ - csrc/common/wkv7/recurrent_common_fp32io16_forward.cu
54
+ - csrc/common/wkv7/recurrent_common_fp32io16_backward.cu
55
+ - csrc/pretrain/wkv7/pretrain_common_recurrent_fp32io16_bindings.cpp
56
+ - csrc/statetune/wkv7/statetune_common_recurrent_fp32io16_bindings.cpp
57
+ - csrc/pretrain/wkv7/pretrain_common_head_l2wrap_ce_bf16_forward_registration.cpp
58
+ - csrc/pretrain/wkv7/pretrain_common_head_l2wrap_ce_bf16_forward.cu
59
+ - csrc/pretrain/wkv7/pretrain_common_cmix_bf16_forward_backward_registration.cpp
60
+ - csrc/pretrain/wkv7/pretrain_sm90_cmix_bf16_forward_backward.cu
61
+ - csrc/pretrain/wkv7/pretrain_common_l2wrap_ce_bf16_forward_backward_registration.cpp
62
+ - csrc/pretrain/wkv7/pretrain_common_l2wrap_ce_bf16_forward_backward.cu
63
+ - csrc/pretrain/wkv7/pretrain_common_tmix_a_gate_bf16_forward_backward_registration.cpp
64
+ - csrc/pretrain/wkv7/pretrain_common_tmix_a_gate_bf16_forward_backward.cu
65
+ - csrc/pretrain/wkv7/pretrain_common_tmix_kk_pre_bf16_forward_backward_registration.cpp
66
+ - csrc/pretrain/wkv7/pretrain_sm90_tmix_kk_pre_bf16_forward_backward.cu
67
+ - csrc/pretrain/wkv7/pretrain_common_tmix_lnx_rkvres_xg_bf16_forward_backward_registration.cpp
68
+ - csrc/pretrain/wkv7/pretrain_common_tmix_lnx_rkvres_xg_bf16_forward_backward.cu
69
+ - csrc/pretrain/wkv7/pretrain_common_tmix_mix6_bf16_forward_backward_registration.cpp
70
+ - csrc/pretrain/wkv7/pretrain_sm90_tmix_mix6_bf16_forward_backward.cu
71
+ - csrc/pretrain/wkv7/pretrain_common_tmix_vres_gate_bf16_forward_backward_registration.cpp
72
+ - csrc/pretrain/wkv7/pretrain_common_tmix_vres_gate_bf16_forward_backward.cu
73
+
74
+ Those derived files are licensed under the Apache License, Version 2.0 and
75
+ retain SPDX/source-revision headers. See LICENSES/Apache-2.0.txt.
76
+
77
+ The FLA chunk_rwkv7 and fused_recurrent_rwkv7 implementations are used only
78
+ through an external correctness and benchmark dependency. No FLA
79
+ implementation source is bundled here.
80
+
81
+ All other original FlashRWKV2 work is licensed under the repository's MIT
82
+ license unless a file states otherwise.
@@ -0,0 +1,102 @@
1
+ Metadata-Version: 2.4
2
+ Name: FlashRWKV2
3
+ Version: 0.1.0a1
4
+ Summary: High-performance CUDA operator library for RWKV-7
5
+ License-Expression: MIT
6
+ Project-URL: Repository, https://github.com/rwkv-rs/FlashRWKV2
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ License-File: NOTICE
11
+ Requires-Dist: torch==2.11.0
12
+ Dynamic: license-file
13
+
14
+ # FlashRWKV2
15
+
16
+ FlashRWKV2 is a high-performance CUDA operator library for RWKV-7. It provides
17
+ composable inference and training operators; complete models, schedulers, and
18
+ training frameworks remain the responsibility of downstream projects.
19
+
20
+ ## Requirements
21
+
22
+ - Python 3.10 or newer
23
+ - An NVIDIA CUDA build environment and a supported CUDA device
24
+ - `uv`, using the repository-local `./.venv`
25
+ - SM120 or newer for the current native build
26
+
27
+ The runtime and reproducible source-build contracts currently pin PyTorch
28
+ 2.11.0. When the build cannot detect a local GPU, set
29
+ `TORCH_CUDA_ARCH_LIST=12.0` explicitly.
30
+
31
+ ## Installation
32
+
33
+ The current alpha is distributed as source and builds the CUDA extension on the
34
+ target machine:
35
+
36
+ ```bash
37
+ TORCH_CUDA_ARCH_LIST=12.0 \
38
+ python -m pip install --pre FlashRWKV2
39
+ ```
40
+
41
+ For development from a checkout:
42
+
43
+ ```bash
44
+ git clone https://github.com/rwkv-rs/FlashRWKV2.git
45
+ cd FlashRWKV2
46
+ uv sync
47
+ TORCH_CUDA_ARCH_LIST=12.0 \
48
+ ./.venv/bin/python -m pip install -v --no-build-isolation -e .
49
+ ```
50
+
51
+ ## Kernel API
52
+
53
+ See the [Kernel API reference](https://github.com/rwkv-rs/FlashRWKV2/blob/main/docs/kernel_api.md)
54
+ for the complete public operator surface and tensor contracts.
55
+
56
+ ## Tests
57
+
58
+ ```bash
59
+ ./.venv/bin/python -m pytest -q
60
+ ```
61
+
62
+ CUDA tests require a successfully built `flashrwkv2._C` extension and a
63
+ supported GPU.
64
+
65
+ ## Benchmarks
66
+
67
+ Operator benchmarks live in [`benchmarks/`](benchmarks/). For example, run the
68
+ WKV7 recurrent correctness benchmark with:
69
+
70
+ ```bash
71
+ ./.venv/bin/python -m benchmarks.tmix.wkv7.bench \
72
+ --shapes h32d64 \
73
+ --dtype bfloat16 \
74
+ --correctness-only \
75
+ --output /tmp/flashrwkv2-wkv7-correctness.json
76
+ ```
77
+
78
+ These benchmarks measure individual operators. They do not report or infer
79
+ model-level latency.
80
+
81
+ For Albatross-compatible TMix low-rank inference, `varlen` means that the
82
+ operator consumes packed token rows; it does not mean that one fused kernel is
83
+ used for every row count. The public composite callers automatically use the
84
+ canonical fused rank-in window at `M<=7`, the fused rank-out/value-residual
85
+ window at `M<=4`, and the canonical large-row linear dispatcher otherwise.
86
+ Callers may provide both the original checkpoint layout and a runtime layout.
87
+ Both layouts must be prepared outside the timed forward region and retained for
88
+ the lifetime of the inference weights; FlashRWKV2 never transposes or copies a
89
+ missing layout during dispatch.
90
+
91
+ The existing low-rank operator benchmark reports correctness and latency as
92
+ JSON without adding a model-level benchmark:
93
+
94
+ ```bash
95
+ ./.venv/bin/python benchmarks/tmix/linear/bench.py \
96
+ --operator projection-group --layout both --channels 4096
97
+ ```
98
+
99
+ ## License
100
+
101
+ FlashRWKV2 is distributed under the
102
+ [MIT License](https://github.com/rwkv-rs/FlashRWKV2/blob/main/LICENSE).