tirex-mirror 2025.9.24__tar.gz → 2025.10.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.
Files changed (32) hide show
  1. {tirex_mirror-2025.9.24/src/tirex_mirror.egg-info → tirex_mirror-2025.10.2}/PKG-INFO +6 -3
  2. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/pyproject.toml +5 -5
  3. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/base.py +1 -0
  4. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/models/slstm/block.py +4 -10
  5. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/models/slstm/cell.py +15 -12
  6. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2/src/tirex_mirror.egg-info}/PKG-INFO +6 -3
  7. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex_mirror.egg-info/requires.txt +5 -2
  8. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/tests/test_chronos_zs.py +3 -0
  9. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/tests/test_forecast.py +3 -0
  10. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/tests/test_slstm_torch_vs_cuda.py +3 -0
  11. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/LICENSE +0 -0
  12. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/LICENSE_MIRROR.txt +0 -0
  13. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/MANIFEST.in +0 -0
  14. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/NOTICE.txt +0 -0
  15. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/README.md +0 -0
  16. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/setup.cfg +0 -0
  17. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/__init__.py +0 -0
  18. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/api_adapter/__init__.py +0 -0
  19. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/api_adapter/forecast.py +0 -0
  20. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/api_adapter/gluon.py +0 -0
  21. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/api_adapter/hf_data.py +0 -0
  22. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/api_adapter/standard_adapter.py +0 -0
  23. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/models/__init__.py +0 -0
  24. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/models/patcher.py +0 -0
  25. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/models/slstm/layer.py +0 -0
  26. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/models/tirex.py +0 -0
  27. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex/util.py +0 -0
  28. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex_mirror.egg-info/SOURCES.txt +0 -0
  29. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex_mirror.egg-info/dependency_links.txt +0 -0
  30. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/src/tirex_mirror.egg-info/top_level.txt +0 -0
  31. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/tests/test_forecast_adapter.py +0 -0
  32. {tirex_mirror-2025.9.24 → tirex_mirror-2025.10.2}/tests/test_standard_adapter.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tirex-mirror
3
- Version: 2025.9.24
3
+ Version: 2025.10.2
4
4
  Summary: Unofficial mirror of NX-AI/tirex for packaging
5
5
  Author-email: Arpad Rozsas <rozsasarpi@gmail.com>
6
6
  License: NXAI COMMUNITY LICENSE AGREEMENT
@@ -67,16 +67,17 @@ Requires-Dist: torch
67
67
  Requires-Dist: einops
68
68
  Requires-Dist: huggingface-hub
69
69
  Requires-Dist: numpy
70
- Requires-Dist: pandas
71
- Requires-Dist: tqdm
72
70
  Provides-Extra: cuda
73
71
  Requires-Dist: xlstm; extra == "cuda"
74
72
  Requires-Dist: ninja; extra == "cuda"
75
73
  Provides-Extra: notebooks
76
74
  Requires-Dist: ipykernel; extra == "notebooks"
77
75
  Requires-Dist: matplotlib; extra == "notebooks"
76
+ Requires-Dist: pandas; extra == "notebooks"
77
+ Requires-Dist: python-dotenv; extra == "notebooks"
78
78
  Provides-Extra: gluonts
79
79
  Requires-Dist: gluonts; extra == "gluonts"
80
+ Requires-Dist: pandas; extra == "gluonts"
80
81
  Provides-Extra: hfdataset
81
82
  Requires-Dist: datasets; extra == "hfdataset"
82
83
  Provides-Extra: test
@@ -87,6 +88,8 @@ Requires-Dist: xlstm; extra == "all"
87
88
  Requires-Dist: ninja; extra == "all"
88
89
  Requires-Dist: ipykernel; extra == "all"
89
90
  Requires-Dist: matplotlib; extra == "all"
91
+ Requires-Dist: pandas; extra == "all"
92
+ Requires-Dist: python-dotenv; extra == "all"
90
93
  Requires-Dist: gluonts; extra == "all"
91
94
  Requires-Dist: datasets; extra == "all"
92
95
  Requires-Dist: pytest; extra == "all"
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "tirex-mirror"
3
- version = "2025.09.24"
3
+ version = "2025.10.02"
4
4
  description = "Unofficial mirror of NX-AI/tirex for packaging"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
7
7
  classifiers = [ "Programming Language :: Python :: 3", "Operating System :: OS Independent",]
8
8
  keywords = [ "TiRex", "xLSTM", "Time Series", "Zero-shot", "Deep Learning",]
9
- dependencies = [ "torch", "einops", "huggingface-hub", "numpy", "pandas", "tqdm",]
9
+ dependencies = [ "torch", "einops", "huggingface-hub", "numpy",]
10
10
  [[project.authors]]
11
11
  name = "Arpad Rozsas"
12
12
  email = "rozsasarpi@gmail.com"
@@ -24,11 +24,11 @@ Issues = "https://github.com/rozsasarpi/tirex-mirror/issues"
24
24
 
25
25
  [project.optional-dependencies]
26
26
  cuda = [ "xlstm", "ninja",]
27
- notebooks = [ "ipykernel", "matplotlib",]
28
- gluonts = [ "gluonts",]
27
+ notebooks = [ "ipykernel", "matplotlib", "pandas", "python-dotenv",]
28
+ gluonts = [ "gluonts", "pandas",]
29
29
  hfdataset = [ "datasets",]
30
30
  test = [ "fev>=0.6.0", "pytest",]
31
- all = [ "xlstm", "ninja", "ipykernel", "matplotlib", "gluonts", "datasets", "pytest", "fev>=0.6.0",]
31
+ all = [ "xlstm", "ninja", "ipykernel", "matplotlib", "pandas", "python-dotenv", "gluonts", "datasets", "pytest", "fev>=0.6.0",]
32
32
 
33
33
  [tool.docformatter]
34
34
  diff = false
@@ -84,6 +84,7 @@ def load_model(
84
84
  Args:
85
85
  path (str): Hugging Face path to the model (e.g. NX-AI/TiRex)
86
86
  device (str, optional): The device on which to load the model (e.g., "cuda:0", "cpu").
87
+ backend (torch | cuda): What backend to use, torch or the custom CUDA kernels. Defaults to cuda when xlstm is installed, else torch.
87
88
  hf_kwargs (dict, optional): Keyword arguments to pass to the Hugging Face Hub download method.
88
89
  ckp_kwargs (dict, optional): Keyword arguments to pass when loading the checkpoint.
89
90
 
@@ -21,14 +21,8 @@ class sLSTMBlock(nn.Module):
21
21
  self.ffn = FeedForward(config.embedding_dim, up_proj_dim)
22
22
 
23
23
  def forward(self, x: torch.Tensor) -> torch.Tensor:
24
- x_slstm = self.norm_slstm(x)
25
-
26
- x_slstm = self.slstm_layer(x_slstm, slstm_state=None)
27
- x = x + x_slstm
28
-
29
- x_ffn = self.norm_ffn(x)
30
- x_ffn = self.ffn(x_ffn)
31
- x = x + x_ffn
24
+ x = x + self.slstm_layer(self.norm_slstm(x), slstm_state=None)
25
+ x = x + self.ffn(self.norm_ffn(x))
32
26
  return x
33
27
 
34
28
 
@@ -41,8 +35,8 @@ class FeedForward(nn.Module):
41
35
 
42
36
  def forward(self, x: torch.Tensor) -> torch.Tensor:
43
37
  x = F.silu(self.proj_up_gate(x)) * self.proj_up(x)
44
- y = self.proj_down(x)
45
- return y
38
+ x = self.proj_down(x)
39
+ return x
46
40
 
47
41
 
48
42
  class RMSNorm(nn.Module):
@@ -168,21 +168,24 @@ def slstm_forward_pointwise(
168
168
  states: torch.Tensor, # dim [4, B, H]
169
169
  ) -> tuple[torch.Tensor, torch.Tensor]:
170
170
  raw = Wx + Ry + b
171
- y, c, n, m = torch.unbind(states.view(4, states.shape[1], -1), dim=0)
172
171
 
173
172
  iraw, fraw, zraw, oraw = torch.unbind(raw.view(raw.shape[0], 4, -1), dim=1)
173
+ y, c, n, m = torch.unbind(states.view(4, states.shape[1], -1), dim=0)
174
+
174
175
  # with torch.no_grad(): # THE difference to maxg aka max_gradient (here max / max_static)
175
- logfplusm = m + F.logsigmoid(fraw)
176
+ # Equations reference the xlstm paper on page 4: https://arxiv.org/pdf/2405.04517
177
+ logfplusm = m + F.logsigmoid(fraw) # eq 15
176
178
  if torch.all(n == 0.0):
177
179
  mnew = iraw
178
180
  else:
179
- mnew = torch.max(iraw, logfplusm)
180
- ogate = torch.sigmoid(oraw)
181
- igate = torch.minimum(torch.exp(iraw - mnew), torch.ones_like(iraw))
182
- fgate = torch.minimum(torch.exp(logfplusm - mnew), torch.ones_like(iraw))
183
- cnew = fgate * c + igate * torch.tanh(zraw)
184
- nnew = fgate * n + igate
185
- ynew = ogate * cnew / nnew
186
-
187
- # shapes ([B,H], [B,H], [B,H]), ([B,H],[B,H],[B,H],[B,H])
188
- return torch.stack((ynew, cnew, nnew, mnew), dim=0), torch.stack((igate, fgate, zraw, ogate), dim=0)
181
+ mnew = torch.max(iraw, logfplusm) # eq 15
182
+ ogate = torch.sigmoid(oraw) # eq 14
183
+ igate = torch.minimum(torch.exp(iraw - mnew), torch.ones_like(iraw)) # eq 16
184
+ fgate = torch.minimum(torch.exp(logfplusm - mnew), torch.ones_like(iraw)) # eq 17
185
+ zgate = torch.tanh(zraw) # eq 11
186
+ cnew = fgate * c + igate * zgate # eq 8
187
+ nnew = fgate * n + igate # eq 9
188
+ hnew = ogate * cnew / nnew # eq 10
189
+
190
+ # y (4, B, H), state (4, B, H)
191
+ return torch.stack((hnew, cnew, nnew, mnew), dim=0), torch.stack((igate, fgate, zraw, ogate), dim=0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tirex-mirror
3
- Version: 2025.9.24
3
+ Version: 2025.10.2
4
4
  Summary: Unofficial mirror of NX-AI/tirex for packaging
5
5
  Author-email: Arpad Rozsas <rozsasarpi@gmail.com>
6
6
  License: NXAI COMMUNITY LICENSE AGREEMENT
@@ -67,16 +67,17 @@ Requires-Dist: torch
67
67
  Requires-Dist: einops
68
68
  Requires-Dist: huggingface-hub
69
69
  Requires-Dist: numpy
70
- Requires-Dist: pandas
71
- Requires-Dist: tqdm
72
70
  Provides-Extra: cuda
73
71
  Requires-Dist: xlstm; extra == "cuda"
74
72
  Requires-Dist: ninja; extra == "cuda"
75
73
  Provides-Extra: notebooks
76
74
  Requires-Dist: ipykernel; extra == "notebooks"
77
75
  Requires-Dist: matplotlib; extra == "notebooks"
76
+ Requires-Dist: pandas; extra == "notebooks"
77
+ Requires-Dist: python-dotenv; extra == "notebooks"
78
78
  Provides-Extra: gluonts
79
79
  Requires-Dist: gluonts; extra == "gluonts"
80
+ Requires-Dist: pandas; extra == "gluonts"
80
81
  Provides-Extra: hfdataset
81
82
  Requires-Dist: datasets; extra == "hfdataset"
82
83
  Provides-Extra: test
@@ -87,6 +88,8 @@ Requires-Dist: xlstm; extra == "all"
87
88
  Requires-Dist: ninja; extra == "all"
88
89
  Requires-Dist: ipykernel; extra == "all"
89
90
  Requires-Dist: matplotlib; extra == "all"
91
+ Requires-Dist: pandas; extra == "all"
92
+ Requires-Dist: python-dotenv; extra == "all"
90
93
  Requires-Dist: gluonts; extra == "all"
91
94
  Requires-Dist: datasets; extra == "all"
92
95
  Requires-Dist: pytest; extra == "all"
@@ -2,14 +2,14 @@ torch
2
2
  einops
3
3
  huggingface-hub
4
4
  numpy
5
- pandas
6
- tqdm
7
5
 
8
6
  [all]
9
7
  xlstm
10
8
  ninja
11
9
  ipykernel
12
10
  matplotlib
11
+ pandas
12
+ python-dotenv
13
13
  gluonts
14
14
  datasets
15
15
  pytest
@@ -21,6 +21,7 @@ ninja
21
21
 
22
22
  [gluonts]
23
23
  gluonts
24
+ pandas
24
25
 
25
26
  [hfdataset]
26
27
  datasets
@@ -28,6 +29,8 @@ datasets
28
29
  [notebooks]
29
30
  ipykernel
30
31
  matplotlib
32
+ pandas
33
+ python-dotenv
31
34
 
32
35
  [test]
33
36
  fev>=0.6.0
@@ -1,3 +1,6 @@
1
+ # Copyright (c) NXAI GmbH.
2
+ # This software may be used and distributed according to the terms of the NXAI Community License Agreement.
3
+
1
4
  import math
2
5
  import os
3
6
  import time
@@ -1,3 +1,6 @@
1
+ # Copyright (c) NXAI GmbH.
2
+ # This software may be used and distributed according to the terms of the NXAI Community License Agreement.
3
+
1
4
  from pathlib import Path
2
5
 
3
6
  import numpy as np
@@ -1,3 +1,6 @@
1
+ # Copyright (c) NXAI GmbH.
2
+ # This software may be used and distributed according to the terms of the NXAI Community License Agreement.
3
+
1
4
  import copy
2
5
 
3
6
  import pytest