stackformers 3.8.0__tar.gz → 3.8.2__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.
- {stackformers-3.8.0 → stackformers-3.8.2}/PKG-INFO +1 -1
- {stackformers-3.8.0 → stackformers-3.8.2}/pyproject.toml +1 -1
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/attention/ops.py +3 -1
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/sequence.py +2 -2
- {stackformers-3.8.0 → stackformers-3.8.2}/uv.lock +1 -1
- {stackformers-3.8.0 → stackformers-3.8.2}/.claude/settings.json +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/.claudeignore +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/.gitignore +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/.python-version +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/.vscode/settings.json +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/CLAUDE.md +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/Justfile +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/LICENSE +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/PLAN.md +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/README.md +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/__init__.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/attention/README.md +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/attention/__init__.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/attention/bias.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/attention/config.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/attention/cross_attn.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/attention/protocols.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/attention/self_attn.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/config.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/cross_attender.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/decoder.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/encoder.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/feedforward/README.md +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/feedforward/__init__.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/feedforward/config.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/feedforward/factory.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/feedforward/geglu.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/feedforward/protocols.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/feedforward/relu_squared.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/feedforward/swiglu.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/layers.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/norm/README.md +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/norm/__init__.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/norm/config.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/norm/factory.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/norm/protocols.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/positional/README.md +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/positional/__init__.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/positional/config.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/positional/factory.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/positional/learned.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/positional/none.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/positional/protocols.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/positional/rope1d.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/positional/rope2d.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/presets/README.md +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/presets/__init__.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/presets/cross_attender.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/presets/decoder.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/stackformers/presets/encoder.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/__init__.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/attention/__init__.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/attention/test_cross_attn.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/attention/test_kernels.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/attention/test_ops.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/attention/test_self_attn.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/conftest.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/feedforward/__init__.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/feedforward/test_geglu.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/feedforward/test_relu_squared.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/feedforward/test_swiglu.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/positional/__init__.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/positional/test_learned_pos.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/positional/test_rope.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/presets/__init__.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/presets/test_cross_attender.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/presets/test_decoder.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/presets/test_encoder.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/test_cross_attender.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/test_decoder.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/test_encoder.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/test_layers.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/test_norm.py +0 -0
- {stackformers-3.8.0 → stackformers-3.8.2}/tests/test_sequence.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: stackformers
|
|
3
|
-
Version: 3.8.
|
|
3
|
+
Version: 3.8.2
|
|
4
4
|
Summary: Typed, composable, SOLID transformer library for PyTorch
|
|
5
5
|
Project-URL: Homepage, https://github.com/Red-Eyed/stackformers
|
|
6
6
|
Project-URL: Repository, https://github.com/Red-Eyed/stackformers
|
|
@@ -159,7 +159,9 @@ def packed_attn_or_fallback(
|
|
|
159
159
|
stacklevel=2,
|
|
160
160
|
)
|
|
161
161
|
|
|
162
|
-
b
|
|
162
|
+
# Keep b as SymInt-friendly: int(SymInt) forces specialization under torch.export.
|
|
163
|
+
# Downstream consumers (_packed_heads_to_padded) accept SymInt for shape args.
|
|
164
|
+
b = q_seq.cu_seqlens.shape[0] - 1
|
|
163
165
|
q_pad, q_mask = _packed_heads_to_padded(q, q_seq.cu_seqlens, b, q_seq.max_seqlen)
|
|
164
166
|
k_pad, k_mask = _packed_heads_to_padded(k, k_seq.cu_seqlens, b, k_seq.max_seqlen)
|
|
165
167
|
v_pad, _ = _packed_heads_to_padded(v, k_seq.cu_seqlens, b, k_seq.max_seqlen)
|
|
@@ -58,7 +58,7 @@ def to_seq_info(inp: SequenceInput) -> SequenceInfo:
|
|
|
58
58
|
def make_padded_input(x: Tensor, mask: Bool[Tensor, "b n"]) -> PaddedInput:
|
|
59
59
|
"""Build PaddedInput with sequential 1-D positions (shape b n 1)."""
|
|
60
60
|
n = x.shape[1]
|
|
61
|
-
pos = torch.arange(n, device=x.device, dtype=
|
|
61
|
+
pos = torch.arange(n, device=x.device, dtype=torch.float32)
|
|
62
62
|
positions = pos.unsqueeze(0).unsqueeze(-1).expand(x.shape[0], -1, -1) # b n 1
|
|
63
63
|
return PaddedInput(x=x, mask=mask, abs_positions=positions)
|
|
64
64
|
|
|
@@ -69,7 +69,7 @@ def make_packed_input(x: Tensor, cu_seqlens: Int[Tensor, "bp1"], max_seqlen: int
|
|
|
69
69
|
Delegates to :func:`position_ids_from_packed`, which is ``torch.export``-compatible.
|
|
70
70
|
"""
|
|
71
71
|
seq = PackedSequence(cu_seqlens=cu_seqlens, max_seqlen=max_seqlen)
|
|
72
|
-
positions = position_ids_from_packed(seq).to(
|
|
72
|
+
positions = position_ids_from_packed(seq).to(torch.float32).unsqueeze(-1) # nt 1
|
|
73
73
|
return PackedInput(x=x, cu_seqlens=cu_seqlens, max_seqlen=max_seqlen, abs_positions=positions)
|
|
74
74
|
|
|
75
75
|
|
|
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
|
|
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
|