tirex-mirror 2025.10.18__tar.gz → 2025.10.25__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.
- {tirex_mirror-2025.10.18/src/tirex_mirror.egg-info → tirex_mirror-2025.10.25}/PKG-INFO +1 -1
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/pyproject.toml +1 -1
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/base.py +3 -1
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/models/slstm/cell.py +3 -1
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25/src/tirex_mirror.egg-info}/PKG-INFO +1 -1
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex_mirror.egg-info/SOURCES.txt +1 -1
- tirex_mirror-2025.10.25/tests/test_compile.py +39 -0
- tirex_mirror-2025.10.18/tests/test_jupyterlab.py +0 -52
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/LICENSE +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/LICENSE_MIRROR.txt +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/MANIFEST.in +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/NOTICE.txt +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/README.md +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/setup.cfg +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/__init__.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/api_adapter/__init__.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/api_adapter/forecast.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/api_adapter/gluon.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/api_adapter/hf_data.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/api_adapter/standard_adapter.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/models/__init__.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/models/patcher.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/models/slstm/block.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/models/slstm/layer.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/models/tirex.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/util.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex_mirror.egg-info/dependency_links.txt +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex_mirror.egg-info/requires.txt +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex_mirror.egg-info/top_level.txt +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/tests/test_chronos_zs.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/tests/test_forecast.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/tests/test_forecast_adapter.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/tests/test_slstm_torch_vs_cuda.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/tests/test_standard_adapter.py +0 -0
- {tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/tests/test_util_freq.py +0 -0
|
@@ -76,7 +76,9 @@ class PretrainedModel(ABC):
|
|
|
76
76
|
model = model.to(device)
|
|
77
77
|
|
|
78
78
|
if compile and backend == "torch":
|
|
79
|
-
|
|
79
|
+
compiled_slstm_forward = torch.compile(sLSTMCellTorch.slstm_forward)
|
|
80
|
+
for block in model.blocks:
|
|
81
|
+
block.slstm_layer.slstm_cell._impl_forward_torch = compiled_slstm_forward
|
|
80
82
|
return model
|
|
81
83
|
|
|
82
84
|
@classmethod
|
|
@@ -38,6 +38,8 @@ class sLSTMCell(nn.Module):
|
|
|
38
38
|
|
|
39
39
|
self._bias_ = nn.Parameter(torch.empty((config.num_heads * config.num_gates * config.head_dim), dtype=None))
|
|
40
40
|
|
|
41
|
+
self._impl_forward_torch = sLSTMCellTorch.slstm_forward
|
|
42
|
+
|
|
41
43
|
def forward(self, input: torch.Tensor, state: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]:
|
|
42
44
|
input = self._get_input(input)
|
|
43
45
|
state = self._get_state(input, state)
|
|
@@ -62,7 +64,7 @@ class sLSTMCell(nn.Module):
|
|
|
62
64
|
.reshape(-1)
|
|
63
65
|
)
|
|
64
66
|
|
|
65
|
-
return
|
|
67
|
+
return self._impl_forward_torch(input, state, recurrent_kernel, bias)
|
|
66
68
|
|
|
67
69
|
def _impl_cuda(self, input: torch.Tensor, state: torch.Tensor) -> torch.Tensor:
|
|
68
70
|
if input.device.type != "cuda":
|
|
@@ -24,9 +24,9 @@ src/tirex_mirror.egg-info/dependency_links.txt
|
|
|
24
24
|
src/tirex_mirror.egg-info/requires.txt
|
|
25
25
|
src/tirex_mirror.egg-info/top_level.txt
|
|
26
26
|
tests/test_chronos_zs.py
|
|
27
|
+
tests/test_compile.py
|
|
27
28
|
tests/test_forecast.py
|
|
28
29
|
tests/test_forecast_adapter.py
|
|
29
|
-
tests/test_jupyterlab.py
|
|
30
30
|
tests/test_slstm_torch_vs_cuda.py
|
|
31
31
|
tests/test_standard_adapter.py
|
|
32
32
|
tests/test_util_freq.py
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Copyright (c) NXAI GmbH.
|
|
2
|
+
# This software may be used and distributed according to the terms of the NXAI Community License Agreement.
|
|
3
|
+
|
|
4
|
+
import time
|
|
5
|
+
|
|
6
|
+
import torch
|
|
7
|
+
|
|
8
|
+
from tirex import load_model
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def measure_model_execution_time(model):
|
|
12
|
+
context = torch.randn((1, 128))
|
|
13
|
+
|
|
14
|
+
_, __ = model.forecast(context, prediction_length=32) # warmup
|
|
15
|
+
|
|
16
|
+
start = time.time()
|
|
17
|
+
_, __ = model.forecast(context, prediction_length=32)
|
|
18
|
+
end = time.time()
|
|
19
|
+
|
|
20
|
+
return end - start
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def test_compileable():
|
|
24
|
+
model = load_model("NX-AI/TiRex", backend="torch", compile=True)
|
|
25
|
+
|
|
26
|
+
context = torch.randn((1, 128))
|
|
27
|
+
_, mean = model.forecast(context, prediction_length=32)
|
|
28
|
+
|
|
29
|
+
assert mean.shape == (1, 32)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def test_compiled_faster():
|
|
33
|
+
model_uncompiled = load_model("NX-AI/TiRex", backend="torch", compile=False)
|
|
34
|
+
model_compiled = load_model("NX-AI/TiRex", backend="torch", compile=True)
|
|
35
|
+
|
|
36
|
+
time_uncompiled = measure_model_execution_time(model_uncompiled)
|
|
37
|
+
time_compiled = measure_model_execution_time(model_compiled)
|
|
38
|
+
|
|
39
|
+
assert time_compiled < time_uncompiled, "Compiled model has to be faster than uncompiled one!"
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# Copyright (c) NXAI GmbH.
|
|
2
|
-
# This software may be used and distributed according to the terms of the NXAI Community License Agreement.
|
|
3
|
-
|
|
4
|
-
import logging
|
|
5
|
-
import subprocess
|
|
6
|
-
|
|
7
|
-
import pytest
|
|
8
|
-
import requests
|
|
9
|
-
|
|
10
|
-
cpu_url = "http://localhost:8889"
|
|
11
|
-
# gpu_url = "http://localhost:8888" - will be added as soon as self-hosted gpu runner is available
|
|
12
|
-
|
|
13
|
-
logger = logging.getLogger(__name__)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def _docker_container_running() -> bool:
|
|
17
|
-
"""Return True if any Docker container is currently running."""
|
|
18
|
-
try:
|
|
19
|
-
result = subprocess.run(
|
|
20
|
-
["docker", "ps", "-q"],
|
|
21
|
-
check=True,
|
|
22
|
-
text=True,
|
|
23
|
-
stdout=subprocess.PIPE,
|
|
24
|
-
stderr=subprocess.DEVNULL,
|
|
25
|
-
)
|
|
26
|
-
except (FileNotFoundError, subprocess.CalledProcessError):
|
|
27
|
-
return False
|
|
28
|
-
|
|
29
|
-
return bool(result.stdout.strip())
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
pytestmark = pytest.mark.skipif(
|
|
33
|
-
not _docker_container_running(),
|
|
34
|
-
reason="requires Docker with a running container exposing JupyterLab",
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def test_jupyterlab_running():
|
|
39
|
-
"""Check that the JupyterLab instance inside the container is reachable."""
|
|
40
|
-
try:
|
|
41
|
-
response = requests.get(cpu_url, timeout=5) # timeout prevents hanging
|
|
42
|
-
logger.info("✅ Connected to %s, status code: %s", cpu_url, response.status_code)
|
|
43
|
-
assert response.status_code in [200, 302], f"Unexpected status code: {response.status_code}"
|
|
44
|
-
|
|
45
|
-
except requests.exceptions.ConnectionError:
|
|
46
|
-
pytest.fail(f"❌ Could not connect to {cpu_url} (connection refused or server not running)")
|
|
47
|
-
|
|
48
|
-
except requests.exceptions.Timeout:
|
|
49
|
-
pytest.fail(f"⏰ Connection to {cpu_url} timed out")
|
|
50
|
-
|
|
51
|
-
except requests.exceptions.RequestException as e:
|
|
52
|
-
pytest.fail(f"⚠️ General error connecting to {cpu_url}: {e}")
|
|
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
|
{tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex/api_adapter/standard_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tirex_mirror-2025.10.18 → tirex_mirror-2025.10.25}/src/tirex_mirror.egg-info/dependency_links.txt
RENAMED
|
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
|