Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
77b6b63
rollout WIP
0xideas Nov 7, 2026
255010d
policy increment WIP
0xideas Nov 7, 2026
04090e3
move policy to transformer
0xideas Nov 7, 2026
43e44a9
unify
0xideas Nov 7, 2026
07e4994
integrate
0xideas Nov 7, 2026
8995be2
unify
0xideas Nov 7, 2026
8e7cd9b
reduce
0xideas Nov 7, 2026
a52d731
consolidation
0xideas Nov 7, 2026
090c9ac
consolidate
0xideas Nov 7, 2026
f3d148e
consolidate
0xideas Nov 7, 2026
65e2a3a
rename
0xideas Nov 9, 2026
6dfa067
rename
0xideas Nov 9, 2026
231a1bc
iql
0xideas Nov 9, 2026
080cad4
Add PPO
0xideas Nov 9, 2026
c178e18
implement fixes
0xideas Nov 9, 2026
51583f3
implement fixes
0xideas Nov 9, 2026
26caeab
GRPO and DPO
0xideas Nov 9, 2026
1137e73
cleanup
0xideas Nov 9, 2026
ee0e411
consolidate
0xideas Nov 9, 2026
23197b7
cleanup
0xideas Nov 9, 2026
afd1839
cleanup
0xideas Nov 9, 2026
0386666
cleanup
0xideas Nov 10, 2026
0822258
unify supervised and policy
0xideas Nov 10, 2026
afe3e99
clean up config surface
0xideas Nov 10, 2026
0dce86c
clean up
0xideas Nov 10, 2026
6964c10
shorten
0xideas Nov 11, 2026
055c09a
shorten
0xideas Nov 11, 2026
d5d2d42
config improvements
0xideas Nov 11, 2026
83a4615
unify naming
0xideas Nov 11, 2026
6037b4c
unify schema
0xideas Nov 12, 2026
dca04e2
clean up schema
0xideas Nov 12, 2026
b42f6b9
small changes
0xideas Nov 12, 2026
59573f3
small changes
0xideas Nov 12, 2026
6e7f056
change
0xideas Nov 13, 2026
4bcd151
reverse computation changes
0xideas Nov 13, 2026
a72ba2f
continue best model across phases
0xideas Nov 13, 2026
60d6441
reinstate prior behaviour
0xideas Nov 13, 2026
e9f4206
update docs/tests compatible
0xideas Nov 13, 2026
22a8a79
improve grpo efficiency
0xideas Nov 16, 2026
2a2b95d
grpo microbatch
0xideas Nov 16, 2026
926ca52
grpo efficiency
0xideas Nov 16, 2026
df588e8
grpo efficiency
0xideas Nov 16, 2026
6fc6f52
Fix ineffective config options
0xideas Nov 17, 2026
0d5dd8a
unify interfaces
0xideas Nov 17, 2026
afdf803
fix path
0xideas Nov 17, 2026
5ff782f
clean up
0xideas Nov 17, 2026
08fc8af
export dtypes to onnx artifact
0xideas Nov 17, 2026
34c7f45
initialization from earlier phases for support networks
0xideas Nov 18, 2026
b9b19b5
single plan coordinator
0xideas Nov 18, 2026
02aa9cc
clean up model execution
0xideas Nov 18, 2026
84bc48b
mutable runtime state
0xideas Nov 18, 2026
49204a0
remove unnecessary heads in support networks
0xideas Nov 18, 2026
4c94978
refactor telemetry
0xideas Nov 18, 2026
58b7e12
action plan
0xideas Nov 18, 2026
8417851
centralised resource accounting
0xideas Nov 18, 2026
cd7936a
unify contracts
0xideas Nov 18, 2026
1686c86
unify phase transitions
0xideas Nov 18, 2026
8086fc2
typed execution
0xideas Nov 18, 2026
4f08da2
refactor phase execution
0xideas Nov 18, 2026
9d4923f
unify action sampling and replay
0xideas Nov 18, 2026
80aa515
prevent outputs overwriting inputs
0xideas Nov 19, 2026
52154f8
fix metadata path handling
0xideas Nov 19, 2026
33db606
make random run resumable
0xideas Nov 19, 2026
24ccd21
Fix rollout serialization
0xideas Nov 19, 2026
19deada
fix grpo eval field
0xideas Nov 19, 2026
09b3525
remove logical names
0xideas Nov 19, 2026
95e3679
separate out contracts
0xideas Nov 19, 2026
4720cb1
reset contracts
0xideas Nov 19, 2026
790625c
clean up bugs
0xideas Nov 19, 2026
a483516
cleanup
0xideas Nov 19, 2026
4a94301
remove metaprogramming elements
0xideas Nov 19, 2026
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
19 changes: 19 additions & 0 deletions .github/workflows/contract-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Contract versions

on:
pull_request:
merge_group:

permissions:
contents: read

jobs:
contract-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Validate contract versions and shipped examples on the merge result
run: python tools/check_contract_versions.py
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,6 @@ cython_debug/
#.idea/

.aider*

# Documentation is assembled into wheels by the build command.
src/sequifier/consolidated-docs.md
9 changes: 0 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,3 @@ repos:
files: ^(pyproject\.toml|.github/workflows/docs.yml)$
pass_filenames: false
additional_dependencies: [tomli]

- repo: local
hooks:
- id: consolidate-docs
name: Consolidate configuration documentation
entry: python hooks/consolidate_docs.py
language: python
files: ^(README\.md|documentation/configs/(preprocess|train|infer|hyperparameter-search)\.md|documentation/commands/visualize-training\.md|documentation/training/multi-gpu-training\.md|src/sequifier/consolidated-docs\.md)$
pass_filenames: false
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include documentation *.md
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ There are seven standalone commands within sequifier: `make`, `preprocess`, `tra
| --- | --- |
| `make` | Create a new sequifier project with config templates. |
| `preprocess` | Convert input data into fixed-length subsequences. |
| `train` | Train a model on preprocessed data. |
| `infer` | Generate predictions, probabilities, or embeddings. |
| `train` | Train supervised models or ordered imitation, IQL, PPO, DPO and GRPO policy phases. |
| `infer` | Generate predictions, probabilities, embeddings, or policy actions and rollouts. |
| `hyperparameter-search` | Use Optuna to find optimal configurations across multiple training runs. |
| `visualize-training` | Generate interactive HTML plots from structured training metrics. |
| `docs` | Print the consolidated documentation, or the guide for `train`, `preprocess`, or `infer`. |
Expand All @@ -114,8 +114,10 @@ Run `sequifier docs` for all documentation, or `sequifier docs train`, `sequifie

The processing and visualization commands have dedicated documentation pages:

- [canonical configuration names](./documentation/configs/naming.md)
- [preprocess documentation](./documentation/configs/preprocess.md)
- [train documentation](./documentation/configs/train.md)
- [policy training](./documentation/policy-learning.md), including BC, IQL, DPO, GRPO and [online categorical PPO](./documentation/policy-learning.md#online-categorical-ppo)
- [infer documentation](./documentation/configs/infer.md)
- [hyperparameter-search documentation](./documentation/configs/hyperparameter-search.md)
- [visualize-training documentation](./documentation/commands/visualize-training.md)
Expand Down Expand Up @@ -168,7 +170,7 @@ The basic input data format is this:

The two columns "sequenceId" and "itemPosition" have to be present, and there must be one or more feature columns.

`sequifier preprocess` splits sequences into subsequences, normalises real variables and maps categorical variables to integers/tokens. Each stored subsequence contains `window_length` positions; `max_target_offset` reserves positions within that window for future targets.
`sequifier preprocess` splits sequences into subsequences, normalises real variables and maps categorical variables to integers/tokens. Each stored subsequence contains the number of positions selected by its split in `window_lengths`; `max_target_offset` reserves positions within that window for future targets.

| sequenceId | subsequenceId | startItemPosition | leftPadLength | inputCol | [window_length - 1] | [window_length - 2] | ... | 0 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
Expand Down Expand Up @@ -214,17 +216,17 @@ Once you have your data in the input format described above, you can train a tra
sequifier preprocess
```

5. **Reference the generated metadata.** Preprocessing outputs metadata at `configs/metadata_configs/[INPUT BASENAME].json`. For a single dataset and part, reference that file from `dataset.part.metadata_config_path` in `train.yaml`; named configurations use `dataset_training.<dataset>.parts.<part>.metadata_config_path`. Inference may still use `preprocessing_data_path` or `metadata_config_path`.
5. **Reference the generated metadata.** Preprocessing outputs metadata at `configs/metadata_configs/[INPUT BASENAME].json`. Reference that file from `dataset_training.<dataset>.parts.<part>.metadata_config_path` in `train.yaml`. Inference uses `metadata_config_path` or the selected artifact metadata.

6. **Configure and train the model.** Adapt `train.yaml` with your transformer hyperparameters, then run:

```console
sequifier train
```

7. **Configure inference.** Point `model_path` in `infer.yaml` at the default ONNX export. Keep the scaffold's explicit contract, or replace it with `training_config_path` and `dataset`; see the [ONNX/PT trade-offs](./documentation/configs/infer.md#onnx-or-pt).
7. **Configure inference.** Point `model_paths` in `infer.yaml` at the default ONNX export. Keep the scaffold's explicit contract, or replace it with `training_config_path` and `dataset`; see the [ONNX/PT trade-offs](./documentation/configs/infer.md#onnx-or-pt).

**GPU ONNX inference:** `device: cuda` requires `onnxruntime-gpu` built for
**GPU ONNX inference:** `run.execution.device: cuda` requires `onnxruntime-gpu` built for
your CUDA and cuDNN versions. The CPU-only `onnxruntime` package does not
provide `CUDAExecutionProvider`.

Expand Down Expand Up @@ -254,7 +256,7 @@ current loss calculation uses all valid decoded positions, regardless of

### Autoregressive Inference

Autoregressive inference is allowed when the model is causal, all input variables are target variables, `target_offset` equals 1 and `prediction_length` equals 1. It is enabled by setting `autoregressive: true`, and `generation_steps` to the desired integer value. The number of generation_steps will be generated starting from the *first* complete subsequence in a sequence.
Autoregressive inference is allowed when the model is causal, all input variables are target variables, `target_offset` equals 1 and `prediction_length` equals 1. It is enabled by setting `autoregressive_generation: true`, and `generation_steps` to the desired integer value. The number of generation_steps will be generated starting from the *first* complete subsequence in a sequence.

It iteratively predicts future values, by returning predictions at step t-1 as input for generating a prediction at t. Predictions for categorical target variables can be made using argmax or sampling.

Expand All @@ -279,13 +281,13 @@ Next-occurrence causal modelling is a generalisation of final-value causal model

### Causal Embedding Model

sequifier also supports the export of causal embeddings, instead of predictions. It requires the following settings: `export_embedding_model: true` in the training config and `model_type: embedding` in the inference config. Selected activations are restricted to the configured final `prediction_length` positions and concatenated in configuration order along the feature dimension.
sequifier also supports the export of causal embeddings, instead of predictions. It requires the following settings: `export_embedding_model: true` in the training config and `task: embedding` in the inference config. Selected activations are restricted to the configured final `prediction_length` positions and concatenated in configuration order along the feature dimension.

If you are interested in activations *other* than the last backbone layer, you can configure the exact layers you want to contribute to the export using `embedding_layer_names`. You can pass an ordered list, such as `[backbone.layers.1, decoder.branches.default.hidden_blocks.0]`, and the activations of these layers will be concatenated and output.

Layer names follow the network hierarchy using zero-based indices: `backbone.layers.<index>` selects a transformer block output, `backbone.final_norm` the normalized backbone output, and `decoder.branches.<branch>.hidden_blocks.<index>` an MLP decoder hidden-block output; the same scheme applies to BERT embedding models.

Backbone selectors contribute `dim_model` activations. Decoder MLP hidden-block selectors contribute their configured hidden width and receive the same flattened `decoding_support * dim_model` windows used during training. The default, `embedding_layer_names: [backbone.final_norm]`, preserves the final normalised backbone representation.
Backbone selectors contribute `model_dim` activations. Decoder MLP hidden-block selectors contribute their configured hidden width and receive the same flattened `support_length * model_dim` windows used during training. The default, `embedding_layer_names: [backbone.final_norm]`, preserves the final normalised backbone representation.

### BERT Model

Expand All @@ -295,7 +297,7 @@ Configuration:

- Preprocessing: Set `max_target_offset: 0` for equal-width input and target windows.
- Training: Set `training_objective: bert`, configure `bert_spec`, and set decoder `prediction_length` equal to `context_length`. Enable generative and/or embedding export according to the desired inference.
- Inference: Set `model_type: generative` to reconstruct explicitly masked input, or `model_type: embedding` to output contextual representations.
- Inference: Set `task: forecast` to reconstruct explicitly masked input, or `task: embedding` to output contextual representations.

Technical Details: BERT-style models use bidirectional attention and learn by reconstructing positions sampled according to `bert_spec`. Inference does not apply random masking; inputs that should be reconstructed must be masked explicitly, for example using `mask_column` during preprocessing. Embedding inference returns one contextual representation for every valid position in the input window.

Expand Down Expand Up @@ -336,11 +338,11 @@ Separately, `temporal_conv` enables temporal convolutions on pass-through or emb

`temporal_conv` uses causal, left-padded convolutions by default (`causal: true`).
For causal models, keep the default `orientation: within_item_position` when
using `post_conv_norm: layer_norm` or `rmsnorm`. With
using `post_conv_normalization: layer_norm` or `rmsnorm`. With
`orientation: within_column`, these norms operate across the full time axis, so
earlier positions can depend on later ones despite the causal convolution and
the transformer's attention mask. If `within_column` is needed in a causal
model, set `post_conv_norm: none`.
model, set `post_conv_normalization: none`.

#### Categorical multi-hash embeddings and targets

Expand All @@ -352,8 +354,10 @@ logical column name:
model:
interfaces:
default:
input_columns: [product_id]
target_columns: [product_id]
input_columns:
- product_id
target_columns:
- product_id
categorical_hashing:
product_id:
type: multi_hash
Expand Down Expand Up @@ -421,3 +425,5 @@ Please cite with:
}

```

Policy runs support ordered imitation, IQL, DPO, GRPO and PPO phases; see the [policy learning guide](documentation/policy-learning.md).
2 changes: 2 additions & 0 deletions docs/source/guides/artifacts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. include:: ../../../documentation/training/artifacts.md
:parser: myst_parser.sphinx_
2 changes: 2 additions & 0 deletions docs/source/guides/naming.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. include:: ../../../documentation/configs/naming.md
:parser: myst_parser.sphinx_
2 changes: 2 additions & 0 deletions docs/source/guides/ownership.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. include:: ../../../documentation/configs/ownership.md
:parser: myst_parser.sphinx_
3 changes: 3 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ Welcome to Sequifier's documentation!
Training <guides/train>
Inference <guides/infer>
Hyperparameter search <guides/hyperparameter-search>
Configuration naming <guides/naming>
Configuration ownership <guides/ownership>
Visualizing training <guides/visualize-training>
Distributed and multi-node training <guides/multi-gpu-training>
Training runtime architecture <guides/runtime-architecture>
Training artifacts <guides/artifacts>

.. toctree::
:maxdepth: 1
Expand Down
Loading
Loading