Skip to content

Commit 107c889

Browse files
v1.6.43; adds some logging to RCMG to better understand the effect of the size argument
1 parent 8d49a97 commit 107c889

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "imt-ring"
7-
version = "1.6.42"
7+
version = "1.6.43"
88
authors = [
99
{ name="Simon Bachhuber", email="simon.bachhuber@fau.de" },
1010
]
@@ -57,3 +57,6 @@ where = ["src"]
5757
[tool.setuptools.package-data]
5858
"ring.io.examples" = ["**/*.xml"]
5959
"ring.ml.params" = ["**/*.pickle"]
60+
61+
[project.scripts]
62+
ring-view = "ring.extras.interactive_viewer:main"

src/ring/algorithms/generator/base.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from dataclasses import replace
22
from functools import partial
3+
import logging
34
import random
45
from typing import Callable, Optional
56
import warnings
@@ -20,6 +21,8 @@
2021
from ring.algorithms.generator import setup_fns
2122
from ring.algorithms.generator import types
2223

24+
logger = logging.getLogger(__name__)
25+
2326

2427
class RCMG:
2528
def __init__(
@@ -237,7 +240,9 @@ def _number_of_executions_required(size: int) -> int:
237240
def _generators_ncalls(self, sizes: int | list[int] = 1):
238241
"Returns list of unbatched sequences as numpy arrays."
239242
repeats = self._compute_repeats(sizes)
243+
logger.info(f"`repeats` = {repeats}")
240244
sizes = list(jnp.array(repeats) * jnp.array(self._size_of_generators))
245+
logger.info(f"`sizes` = {sizes}")
241246

242247
reduced_repeats = []
243248
n_calls = []
@@ -246,6 +251,9 @@ def _generators_ncalls(self, sizes: int | list[int] = 1):
246251
gcd = utils.gcd(n_call, repeat)
247252
n_calls.append(gcd)
248253
reduced_repeats.append(repeat // gcd)
254+
logger.info(f"`reduced_repeats` = {reduced_repeats}")
255+
logger.info(f"`n_calls` = {n_calls}")
256+
249257
jits = [N > 1 for N in n_calls]
250258

251259
gens = []

0 commit comments

Comments
 (0)