returnn 1.20250810.211220__py3-none-any.whl → 1.20250814.205214__py3-none-any.whl

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.

Potentially problematic release.


This version of returnn might be problematic. Click here for more details.

returnn/PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: returnn
3
- Version: 1.20250810.211220
3
+ Version: 1.20250814.205214
4
4
  Summary: The RWTH extensible training framework for universal recurrent neural networks
5
5
  Home-page: https://github.com/rwth-i6/returnn/
6
6
  Author: Albert Zeyer
@@ -1,2 +1,2 @@
1
- version = '1.20250810.211220'
2
- long_version = '1.20250810.211220+git.49e7afd'
1
+ version = '1.20250814.205214'
2
+ long_version = '1.20250814.205214+git.26a4c87'
returnn/datasets/basic.py CHANGED
@@ -564,14 +564,26 @@ class Dataset:
564
564
  reverse = -1 if seq_ordering_method == "sorted_reverse" else 1
565
565
  seq_lens = [reverse * get_seq_len(i) for i in range(num_seqs)]
566
566
  seq_index = numpy.argsort(seq_lens, kind="stable")
567
- elif seq_ordering_method.startswith("random"):
568
- tmp = seq_ordering_method.split(":")
567
+ elif seq_ordering_method == "random" or seq_ordering_method.startswith("random:"):
568
+ tmp = seq_ordering_method.split(":", 1)
569
569
  nth = int(tmp[1]) if len(tmp) > 1 else 1
570
570
  # Keep this deterministic! Use fixed seed.
571
571
  rnd_seed = self._get_random_seed_for_epoch(epoch=epoch, num_epochs_fixed=nth)
572
572
  random_generator = numpy.random.RandomState(rnd_seed)
573
573
  seq_index = random_generator.permutation(num_seqs)
574
- elif seq_ordering_method.startswith("sort_bin_shuffle"):
574
+ elif seq_ordering_method == "random_sample" or seq_ordering_method.startswith("random_sample:"):
575
+ tmp = seq_ordering_method.split(":", 1)
576
+ nth = int(tmp[1]) if len(tmp) > 1 else 1
577
+ # Keep this deterministic! Use fixed seed.
578
+ rnd_seed = self._get_random_seed_for_epoch(epoch=epoch, num_epochs_fixed=nth)
579
+ random_generator = numpy.random.RandomState(rnd_seed)
580
+ seq_index = random_generator.randint(0, num_seqs, size=num_seqs)
581
+ elif (
582
+ seq_ordering_method == "sort_bin_shuffle"
583
+ or seq_ordering_method.startswith("sort_bin_shuffle:")
584
+ or seq_ordering_method == "sort_bin_shuffle_x2"
585
+ or seq_ordering_method.startswith("sort_bin_shuffle_x2:")
586
+ ):
575
587
  # Shuffle seqs, sort by length, and shuffle bins (then shuffle seqs within each bin if sort_bin_shuffle_x2).
576
588
  assert get_seq_len
577
589
  tmp = seq_ordering_method.split(":")[1:]
@@ -602,7 +614,7 @@ class Dataset:
602
614
  random_generator.shuffle(part) # Shuffle within the bin.
603
615
  out_index.append(part)
604
616
  seq_index = numpy.concatenate(out_index)
605
- elif seq_ordering_method.startswith("laplace"):
617
+ elif seq_ordering_method == "laplace" or seq_ordering_method.startswith("laplace:"):
606
618
  assert get_seq_len
607
619
  tmp = seq_ordering_method.split(":")[1:]
608
620
  if len(tmp) == 0:
@@ -6,6 +6,7 @@ https://github.com/rwth-i6/returnn/issues/1519
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
+ from collections import deque
9
10
  from typing import Union, Optional, Any, Callable, Sequence, Tuple, List, Dict
10
11
  import os
11
12
  import sys
@@ -636,7 +637,7 @@ def _worker_proc_loop(
636
637
  dataset = init_dataset(dataset_dict)
637
638
 
638
639
  got_init_seq_order = False
639
- cache: List[DatasetSeq] = []
640
+ cache: deque[DatasetSeq] = deque()
640
641
  next_seq_idx = 0
641
642
 
642
643
  # noinspection PyShadowingNames
@@ -701,7 +702,7 @@ def _worker_proc_loop(
701
702
  elif msg == "get_data_seq":
702
703
  seq_idx = kwargs["seq_idx"]
703
704
  while cache and cache[0].seq_idx < seq_idx:
704
- cache.pop(0)
705
+ cache.popleft()
705
706
  res = _get(seq_idx)
706
707
  parent_conn.send(("data_seq", res))
707
708
  elif msg == "init_seq_order":
@@ -714,7 +715,7 @@ def _worker_proc_loop(
714
715
  parent_conn.send(("num_seqs", num_seqs))
715
716
  got_init_seq_order = True
716
717
  next_seq_idx = 0
717
- cache[:] = []
718
+ cache.clear()
718
719
  else:
719
720
  raise Exception(f"unknown msg {msg!r}")
720
721
  except KeyboardInterrupt: # when parent dies
@@ -3,6 +3,7 @@ Multi-processing dataset
3
3
  """
4
4
 
5
5
  from __future__ import annotations
6
+ from collections import deque
6
7
  from typing import Optional, Any, Dict, List
7
8
  import sys
8
9
  import gc
@@ -234,7 +235,7 @@ class MultiProcDataset(CachedDataset2):
234
235
  dataset: Optional[Dataset] = None
235
236
 
236
237
  got_init_seq_order = False
237
- cache = [] # type: List[DatasetSeq]
238
+ cache: deque[DatasetSeq] = deque()
238
239
  next_seq_idx = 0
239
240
 
240
241
  # noinspection PyShadowingNames
@@ -299,7 +300,7 @@ class MultiProcDataset(CachedDataset2):
299
300
  elif msg == "get_data_seq":
300
301
  seq_idx = kwargs["seq_idx"]
301
302
  while cache and cache[0].seq_idx < seq_idx:
302
- cache.pop(0)
303
+ cache.popleft()
303
304
  res = _get(seq_idx)
304
305
  parent_conn.send(("data_seq", res))
305
306
  elif msg == "init":
@@ -372,11 +373,11 @@ class MultiProcDataset(CachedDataset2):
372
373
  raise ValueError(f"{MultiProcDataset.__name__}: unknown sharding_method: {sharding_method}")
373
374
  got_init_seq_order = True
374
375
  next_seq_idx = 0
375
- cache[:] = []
376
+ cache.clear()
376
377
  elif msg == "finish_epoch":
377
378
  got_init_seq_order = False
378
379
  next_seq_idx = 0
379
- cache[:] = []
380
+ cache.clear()
380
381
  if dataset:
381
382
  dataset.finish_epoch(**kwargs)
382
383
  if kwargs["free_resources"]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: returnn
3
- Version: 1.20250810.211220
3
+ Version: 1.20250814.205214
4
4
  Summary: The RWTH extensible training framework for universal recurrent neural networks
5
5
  Home-page: https://github.com/rwth-i6/returnn/
6
6
  Author: Albert Zeyer
@@ -1,9 +1,9 @@
1
- returnn/PKG-INFO,sha256=os7SMsZDIE8iA3rqu8Yv3il3m8BO4WeHIcMrHhEGMzs,5215
1
+ returnn/PKG-INFO,sha256=dDWKCPCaWRWqMS1-os5IZOo9uFYqHjXcDFKcI19Hqzo,5215
2
2
  returnn/__init__.py,sha256=biBtRsM0WZ406vShaeH-9WFoqJ8XwTbn6g0EeFJ7l8E,1012
3
3
  returnn/__main__.py,sha256=lHyZcu_0yc9f7Vf_Kfdy9PmeU0T76XVXnpalHi5WKro,31740
4
4
  returnn/__old_mod_loader__.py,sha256=nvsNY-xELdS_IPNkv66Q9Rmvg4dbGW0-EBRDcCmctos,7654
5
5
  returnn/__setup__.py,sha256=22kQn2fh11iPM0hLb2Fy5sLmoU1JGvmDxXRYuRgQkwU,4659
6
- returnn/_setup_info_generated.py,sha256=DRGtGuwT8umaoAEnnZhmbwwrp5N9ngkeq-F3eNVVKEI,77
6
+ returnn/_setup_info_generated.py,sha256=Z6UV10sIpgDmM1cDSqz87OBlBD3G32Ss3yF09lnHfnQ,77
7
7
  returnn/config.py,sha256=3tmKhB6FnQZaNdtcYsiB61JnEY--iZ2qmJ4yq0b6tE0,29140
8
8
  returnn/forward_iface.py,sha256=A_OJiaXsX4MlXQRzST86ylyxSUZbC402PQL1REcqHjM,911
9
9
  returnn/learning_rate_control.py,sha256=ZvWryAn_tv9DhV8sh1LV3eE34Yltl3On3mYZAG4hR9s,34684
@@ -13,17 +13,17 @@ returnn/native_op.py,sha256=4_NnvfNxsM8GE_FsD6yOg6PZegqIdtJ3Sl1GdBWmFvg,244424
13
13
  returnn/pretrain.py,sha256=MHiXJZqkQFmDVyaYsGpd_Acv20wxl7Pr6s6qJzAT2FI,22648
14
14
  returnn/datasets/__init__.py,sha256=PvDlfDOaaopIeUIt0OSvHD2eHZkdkyE-sjMXf35EH5U,390
15
15
  returnn/datasets/audio.py,sha256=Gmj7a08dnvYh7Z-G1TNapz42L50AIcDE9JeIZaO1s1M,23334
16
- returnn/datasets/basic.py,sha256=IJhytVPiQZi7BD8-JVziKKT__PE528FwLQmbeiVQHzc,72303
16
+ returnn/datasets/basic.py,sha256=_42fQztTZq7jNQrWdFBwulB1bNta17LOTyrD8XJ-7_E,73089
17
17
  returnn/datasets/bundle_file.py,sha256=KQNrS1MSf-4_idlK0c0KFwON-f5sEK0sWU15WpoMYpE,2380
18
18
  returnn/datasets/cached.py,sha256=RyefRjSDdp-HveK-2vLy2C6BIHcpqQ_lNvUKlIa4QAI,25412
19
19
  returnn/datasets/cached2.py,sha256=oJOq2lWRQpxm6kyUKW1w5qZBd4kdKEpwM7KY_QnXbq4,11922
20
- returnn/datasets/distrib_files.py,sha256=TDkuZL_1c-QJyCzGw56alLrWmLRnppNFLtPhqzXm7Tc,30194
20
+ returnn/datasets/distrib_files.py,sha256=MA4BuqJEyen-3aA_naS9RWOHrP3OjVjP63VeWfLWigs,30233
21
21
  returnn/datasets/generating.py,sha256=9U_w6URIrv-Rb-hDbPOzYW9qYXzJbw32N6G268IKyoM,99833
22
22
  returnn/datasets/hdf.py,sha256=v5sjBenURR9Z-g7AQ9tsL84yDSye5RtbLpym3M6HSDE,67833
23
23
  returnn/datasets/lm.py,sha256=rQ3jV43lSnlGkKu7m5jTTH7aK0BOMXQocsHfJ8OGec8,99950
24
24
  returnn/datasets/map.py,sha256=kOBJVZmwDhLsOplzDNByIfa0NRSUaMo2Lsy36lBvxrM,10907
25
25
  returnn/datasets/meta.py,sha256=6XPPxhiNSxWw9Hu5Z6wG8dD9Zk82FqiI-k9HGQSTKgw,95658
26
- returnn/datasets/multi_proc.py,sha256=aVjsLt2qjHnHOrEYCgIPCwNYE-f1fiGP6eZ8NGAr3A4,22583
26
+ returnn/datasets/multi_proc.py,sha256=3kZNXbwfuEdQrlOaiY-XnADrQrz7QOqZIQTZUwIWuS8,22614
27
27
  returnn/datasets/normalization_data.py,sha256=J3njQCMvWAbIAVPepO2L_Xdau9eWYB7Zyd6STeGzTbc,14615
28
28
  returnn/datasets/numpy_dump.py,sha256=wl8bKIKAlff2HPJPtuu5wBg3TLOf16d2wLVB4lLAwTM,5158
29
29
  returnn/datasets/postprocessing.py,sha256=6SfT58BxbHYO2QlGzOgIV04Zqkp-kl0B85168DQaB9A,24060
@@ -253,8 +253,8 @@ returnn/util/sig_proc.py,sha256=Tjz0VOAVyqu2qDCF5HZ1JjALjcFsHcNkcd96WgZeKfE,7265
253
253
  returnn/util/task_system.py,sha256=y4sMVXQ25Qd2z0rx03uOlXlkE-jbCYC1Sjfn-XlraVU,26003
254
254
  returnn/util/train_proc_manager.py,sha256=Pjht28k6uz6BNQ47uW6Gf880iyq5q4wx7P_K2tmoAM8,3266
255
255
  returnn/util/watch_memory.py,sha256=BR5P2kvBN6UI81cE0_1WAA6Hd1SByLbBaiDxvLhPOew,4213
256
- returnn-1.20250810.211220.dist-info/LICENSE,sha256=ywBD_U2aD4vpuoIgNAsjIGBYydl0tVKll3De0Z8s77c,11041
257
- returnn-1.20250810.211220.dist-info/METADATA,sha256=os7SMsZDIE8iA3rqu8Yv3il3m8BO4WeHIcMrHhEGMzs,5215
258
- returnn-1.20250810.211220.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
259
- returnn-1.20250810.211220.dist-info/top_level.txt,sha256=Lsn4WZc5Pbfk0-xDQOgnFCxOoqxL4CyeM3N1TFbJncw,8
260
- returnn-1.20250810.211220.dist-info/RECORD,,
256
+ returnn-1.20250814.205214.dist-info/LICENSE,sha256=ywBD_U2aD4vpuoIgNAsjIGBYydl0tVKll3De0Z8s77c,11041
257
+ returnn-1.20250814.205214.dist-info/METADATA,sha256=dDWKCPCaWRWqMS1-os5IZOo9uFYqHjXcDFKcI19Hqzo,5215
258
+ returnn-1.20250814.205214.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
259
+ returnn-1.20250814.205214.dist-info/top_level.txt,sha256=Lsn4WZc5Pbfk0-xDQOgnFCxOoqxL4CyeM3N1TFbJncw,8
260
+ returnn-1.20250814.205214.dist-info/RECORD,,