FlashRWKV2 0.2.0a2__tar.gz → 0.2.0a3__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.
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/FlashRWKV2.egg-info/PKG-INFO +1 -1
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/PKG-INFO +1 -1
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/cmix/__init__.py +3 -2
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/tmix/tokenshift/__init__.py +11 -14
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/pyproject.toml +1 -1
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/FlashRWKV2.egg-info/SOURCES.txt +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/FlashRWKV2.egg-info/dependency_links.txt +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/FlashRWKV2.egg-info/not-zip-safe +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/FlashRWKV2.egg-info/requires.txt +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/FlashRWKV2.egg-info/top_level.txt +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/LICENSE +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/LICENSES/Apache-2.0.txt +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/MANIFEST.in +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/NOTICE +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/README.md +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/csrc/bindings.cpp +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/csrc/bindings.h +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/csrc/registration.cpp +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/csrc/sm80/sampling/infer_fp32_forward_varlen.cpp +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/csrc/sm80/sampling/infer_fp32_forward_varlen.cu +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/csrc/validation/recurrent_metadata.cpp +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/csrc/validation/recurrent_metadata.cu +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/csrc/validation.cpp +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/csrc/validation.h +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/__init__.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/_internal/elementwise.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/_internal/execution.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/_internal/linear.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/_internal/logprob.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/_internal/state.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/compile.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/embedding/__init__.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/head/ce/__init__.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/head/ce/tilelang.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/head/l2wrap_ce/__init__.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/head/linear/__init__.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/loss/l2wrap_ce/__init__.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/loss/l2wrap_ce/tilelang.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/mtp/__init__.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/post_norm/__init__.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/post_norm/tilelang.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/sampling/__init__.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/tmix/kk_pre/tilelang.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/tmix/readout/__init__.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/tmix/readout/pretrain.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/tmix/readout/tilelang.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/tmix/tokenshift/tilelang.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/tmix/vres_gate/tilelang.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/tmix/wkv7/__init__.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/tmix/wkv7/pretrain.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/tmix/wkv7/tilelang.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/tmix/wkv_prepare/__init__.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/flashrwkv2/tmix/wkv_prepare/tilelang.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/setup.cfg +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/setup.py +0 -0
- {flashrwkv2-0.2.0a2 → flashrwkv2-0.2.0a3}/tests/test_runtime.py +0 -0
|
@@ -64,6 +64,7 @@ def infer_cmix_forward_varlen(
|
|
|
64
64
|
|
|
65
65
|
The inference value weight retains its runtime [F,C] layout. A transpose
|
|
66
66
|
view feeds the same projection as the training [C,F] weight.
|
|
67
|
+
Projection weights and adapters must use storage separate from ``shift_state_pool``.
|
|
67
68
|
``save_normalized`` optionally receives the BF16 shift state of each
|
|
68
69
|
active input row.
|
|
69
70
|
"""
|
|
@@ -77,12 +78,12 @@ def infer_cmix_forward_varlen(
|
|
|
77
78
|
(value_lora_a, value_lora_b, value_lora_scale, value_use_nora),
|
|
78
79
|
),
|
|
79
80
|
)
|
|
80
|
-
|
|
81
|
+
residual, (mixed,) = _postnorm_tokenshift_varlen(
|
|
81
82
|
x, res, weight, bias, (x_k,), shift_state_pool, cu_seqlens, state_indices,
|
|
82
83
|
max_seqlen, eps, validated_metadata, save_normalized=save_normalized,
|
|
83
84
|
save_inputs=(key_weight, value_weight, key_lora_a, key_lora_b, value_lora_a, value_lora_b),
|
|
84
|
-
project=lambda mixed: _project(mixed[0], key_weight, value_weight, adapters),
|
|
85
85
|
)
|
|
86
|
+
return residual, _project(mixed, key_weight, value_weight, adapters)
|
|
86
87
|
|
|
87
88
|
|
|
88
89
|
def pretrain_cmix_bf16(
|
|
@@ -47,7 +47,7 @@ def infer_tmix_postnorm_tokenshift_forward_varlen(
|
|
|
47
47
|
|
|
48
48
|
def _postnorm_tokenshift_varlen(
|
|
49
49
|
x, res, weight, bias, mixes, shift_state_pool, cu_seqlens, state_indices,
|
|
50
|
-
max_seqlen, eps, validated_metadata, *, save_normalized=None, save_inputs=(),
|
|
50
|
+
max_seqlen, eps, validated_metadata, *, save_normalized=None, save_inputs=(),
|
|
51
51
|
):
|
|
52
52
|
from ..._internal.state import gather_state, scatter_state
|
|
53
53
|
from ...post_norm.tilelang import norm
|
|
@@ -74,22 +74,19 @@ def _postnorm_tokenshift_varlen(
|
|
|
74
74
|
)
|
|
75
75
|
cu = ticket._query_start_loc_snapshot()
|
|
76
76
|
indices, status = ticket._state_indices_snapshot(), ticket._status()
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
total, mixed = fused_post_norm_tokenshift(
|
|
77
|
+
if ticket._max_seqlen() == 1 and x.shape[0] == indices.numel():
|
|
78
|
+
return fused_post_norm_tokenshift(
|
|
80
79
|
x, res, weight, bias, mixes, shift_state_pool, indices, status, eps,
|
|
81
80
|
save_normalized=save_normalized,
|
|
82
81
|
)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
scatter_state(shift_state_pool, final, indices, status)
|
|
92
|
-
return total, output
|
|
82
|
+
|
|
83
|
+
normalized, total = norm(x, weight, bias, eps, res, return_res=True)
|
|
84
|
+
initial = gather_state(shift_state_pool, indices, status)
|
|
85
|
+
mixed, final = tokenshift(
|
|
86
|
+
normalized, mixes, cu, initial, _status=status, _save_normalized=save_normalized,
|
|
87
|
+
)
|
|
88
|
+
scatter_state(shift_state_pool, final, indices, status)
|
|
89
|
+
return total, mixed
|
|
93
90
|
|
|
94
91
|
|
|
95
92
|
def pretrain_tmix_tokenshift_bf16(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|