From 81ef4f7f71466ca40d205b60bcb6d92543ade98d Mon Sep 17 00:00:00 2001 From: TOPAPEC Date: Thu, 11 Jun 2026 17:35:03 +0300 Subject: [PATCH 1/2] release/0.19.0: bump version, update changelog, fix copyright headers --- .gitignore | 4 ++++ CHANGELOG.md | 2 +- benchmark/compare_sasrec_unisrec.py | 14 ++++++++++++++ pyproject.toml | 2 +- rectools/fast_transformers/__init__.py | 14 ++++++++++++++ rectools/fast_transformers/metrics.py | 14 ++++++++++++++ rectools/fast_transformers/net.py | 14 ++++++++++++++ .../fast_transformers/preprocessing/__init__.py | 14 ++++++++++++++ .../preprocessing/sequence_data.py | 14 ++++++++++++++ rectools/fast_transformers/unisrec/__init__.py | 14 ++++++++++++++ rectools/fast_transformers/unisrec/lightning.py | 14 ++++++++++++++ rectools/fast_transformers/unisrec/model.py | 14 ++++++++++++++ rectools/fast_transformers/unisrec/net.py | 14 ++++++++++++++ rectools/version.py | 2 +- tests/fast_transformers/__init__.py | 13 +++++++++++++ tests/fast_transformers/test_metrics.py | 14 ++++++++++++++ tests/fast_transformers/test_net.py | 14 ++++++++++++++ tests/fast_transformers/test_onnx_export.py | 14 ++++++++++++++ tests/fast_transformers/test_sequence_data.py | 14 ++++++++++++++ tests/fast_transformers/test_unisrec_lightning.py | 14 ++++++++++++++ tests/fast_transformers/test_unisrec_model.py | 14 ++++++++++++++ tests/fast_transformers/test_unisrec_net.py | 14 ++++++++++++++ 22 files changed, 258 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d1f34d2c..c94081ee 100644 --- a/.gitignore +++ b/.gitignore @@ -100,3 +100,7 @@ catboost_info/ # Dev artifacts *.pt data/* + +# OpenCode +opencode.json +.opencode/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 070e44c9..7bb8cd98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [0.19.0] - 11.06.2026 ### Added - `rectools.fast_transformers` module — standalone transformer-based sequential recommenders that work directly with torch tensors, bypassing the `Dataset`/pandas pipeline. GPU-native sequence building via `build_sequences()` gives ~30x preprocessing speedup over `SASRecDataPreparator` on ML-20M ([#306](https://github.com/MTSWebServices/RecTools/pull/306)) diff --git a/benchmark/compare_sasrec_unisrec.py b/benchmark/compare_sasrec_unisrec.py index 7dce6816..398e9a9c 100644 --- a/benchmark/compare_sasrec_unisrec.py +++ b/benchmark/compare_sasrec_unisrec.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Compare RecTools SASRec vs UniSRec-ID on ML-20M. Both use full softmax, Adam, n_factors=256, 10 epochs. diff --git a/pyproject.toml b/pyproject.toml index 8423c7ef..a4c5736f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "RecTools" -version = "0.18.0" +version = "0.19.0" description = "An easy-to-use Python library for building recommendation systems" license = "Apache-2.0" authors = [ diff --git a/rectools/fast_transformers/__init__.py b/rectools/fast_transformers/__init__.py index 24e0d0da..4c66901f 100644 --- a/rectools/fast_transformers/__init__.py +++ b/rectools/fast_transformers/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Fast Transformers: flat sequential recommenders without ItemNet hierarchy.""" from .metrics import compute_metrics, hitrate_at_k, mrr_at_k, ndcg_at_k diff --git a/rectools/fast_transformers/metrics.py b/rectools/fast_transformers/metrics.py index 2ec41488..5e84dd60 100644 --- a/rectools/fast_transformers/metrics.py +++ b/rectools/fast_transformers/metrics.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """GPU-friendly ranking metrics for leave-one-out evaluation. All functions operate on PyTorch tensors and stay on the original device diff --git a/rectools/fast_transformers/net.py b/rectools/fast_transformers/net.py index 55017ee0..f6d51357 100644 --- a/rectools/fast_transformers/net.py +++ b/rectools/fast_transformers/net.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Flat SASRec network: pre-norm transformer encoder with plain id embeddings.""" import typing as tp diff --git a/rectools/fast_transformers/preprocessing/__init__.py b/rectools/fast_transformers/preprocessing/__init__.py index 4cc69c9d..698ce517 100644 --- a/rectools/fast_transformers/preprocessing/__init__.py +++ b/rectools/fast_transformers/preprocessing/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Vectorized sequence preprocessing for transformer recommenders.""" from .sequence_data import SequenceBatchDataset, align_embeddings, build_sequences diff --git a/rectools/fast_transformers/preprocessing/sequence_data.py b/rectools/fast_transformers/preprocessing/sequence_data.py index 0669d5c7..58f01a17 100644 --- a/rectools/fast_transformers/preprocessing/sequence_data.py +++ b/rectools/fast_transformers/preprocessing/sequence_data.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Vectorized sequence building for transformer recommender training. All operations use pure PyTorch tensor ops, avoiding pandas/numpy overhead. diff --git a/rectools/fast_transformers/unisrec/__init__.py b/rectools/fast_transformers/unisrec/__init__.py index 5dd3eb91..9dd7427b 100644 --- a/rectools/fast_transformers/unisrec/__init__.py +++ b/rectools/fast_transformers/unisrec/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """UniSRec: sequential recommender with pretrained text embeddings.""" from .lightning import UniSRecLightning diff --git a/rectools/fast_transformers/unisrec/lightning.py b/rectools/fast_transformers/unisrec/lightning.py index 99bbab5c..5214e8e1 100644 --- a/rectools/fast_transformers/unisrec/lightning.py +++ b/rectools/fast_transformers/unisrec/lightning.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Lightning wrapper for UniSRec with configurable loss, optimizer, scheduler.""" import math diff --git a/rectools/fast_transformers/unisrec/model.py b/rectools/fast_transformers/unisrec/model.py index aeb031f5..165867d0 100644 --- a/rectools/fast_transformers/unisrec/model.py +++ b/rectools/fast_transformers/unisrec/model.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """UniSRecModel: standalone sequential recommender with pretrained text embeddings.""" import logging diff --git a/rectools/fast_transformers/unisrec/net.py b/rectools/fast_transformers/unisrec/net.py index c9ac4bed..da041c7e 100644 --- a/rectools/fast_transformers/unisrec/net.py +++ b/rectools/fast_transformers/unisrec/net.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """UniSRec network: SASRec encoder with pretrained text embeddings and learnable adaptor.""" import typing as tp diff --git a/rectools/version.py b/rectools/version.py index bba64e9c..c251cc63 100644 --- a/rectools/version.py +++ b/rectools/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = "0.18.0" +VERSION = "0.19.0" diff --git a/tests/fast_transformers/__init__.py b/tests/fast_transformers/__init__.py index e69de29b..f8c4825c 100644 --- a/tests/fast_transformers/__init__.py +++ b/tests/fast_transformers/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/tests/fast_transformers/test_metrics.py b/tests/fast_transformers/test_metrics.py index eac98ae9..dea459b1 100644 --- a/tests/fast_transformers/test_metrics.py +++ b/tests/fast_transformers/test_metrics.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for GPU-friendly ranking metrics. Tests verify: diff --git a/tests/fast_transformers/test_net.py b/tests/fast_transformers/test_net.py index bdee143d..73bc68ca 100644 --- a/tests/fast_transformers/test_net.py +++ b/tests/fast_transformers/test_net.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for FlatSASRecNet network.""" # pylint: disable=redefined-outer-name diff --git a/tests/fast_transformers/test_onnx_export.py b/tests/fast_transformers/test_onnx_export.py index 4afea9ce..72db22b8 100644 --- a/tests/fast_transformers/test_onnx_export.py +++ b/tests/fast_transformers/test_onnx_export.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for ONNX export of UniSRecNet network and UniSRecModel.export_to_onnx.""" # pylint: disable=redefined-outer-name,protected-access,import-outside-toplevel diff --git a/tests/fast_transformers/test_sequence_data.py b/tests/fast_transformers/test_sequence_data.py index f836e658..d7766e61 100644 --- a/tests/fast_transformers/test_sequence_data.py +++ b/tests/fast_transformers/test_sequence_data.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for vectorized sequence building and data utilities.""" import torch diff --git a/tests/fast_transformers/test_unisrec_lightning.py b/tests/fast_transformers/test_unisrec_lightning.py index 4b361b93..5ad04ef3 100644 --- a/tests/fast_transformers/test_unisrec_lightning.py +++ b/tests/fast_transformers/test_unisrec_lightning.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for UniSRecLightning wrapper and _cosine_warmup_scheduler.""" # pylint: disable=redefined-outer-name,protected-access diff --git a/tests/fast_transformers/test_unisrec_model.py b/tests/fast_transformers/test_unisrec_model.py index f7a8716d..01b93834 100644 --- a/tests/fast_transformers/test_unisrec_model.py +++ b/tests/fast_transformers/test_unisrec_model.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for UniSRecModel (standalone, tensor-based API).""" import typing as tp diff --git a/tests/fast_transformers/test_unisrec_net.py b/tests/fast_transformers/test_unisrec_net.py index 053bc513..075200b1 100644 --- a/tests/fast_transformers/test_unisrec_net.py +++ b/tests/fast_transformers/test_unisrec_net.py @@ -1,3 +1,17 @@ +# Copyright 2026 MTS (Mobile Telesystems) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for UniSRecNet network.""" # pylint: disable=redefined-outer-name From a0b8b613e13318dbc616bc7313abb05768cb9c8e Mon Sep 17 00:00:00 2001 From: TOPAPEC Date: Thu, 11 Jun 2026 17:49:29 +0300 Subject: [PATCH 2/2] Bump version to 0.19.0rc1 for test PyPI --- pyproject.toml | 2 +- rectools/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a4c5736f..92ddcc1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "RecTools" -version = "0.19.0" +version = "0.19.0rc1" description = "An easy-to-use Python library for building recommendation systems" license = "Apache-2.0" authors = [ diff --git a/rectools/version.py b/rectools/version.py index c251cc63..07d53b49 100644 --- a/rectools/version.py +++ b/rectools/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = "0.19.0" +VERSION = "0.19.0rc1"