nshtrainer 0.11.0__py3-none-any.whl → 0.11.1__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.
@@ -1,4 +1,3 @@
1
- import contextlib
2
1
  import logging
3
2
  import os
4
3
  from collections.abc import Sequence
@@ -58,13 +57,10 @@ def _is_bf16_supported_no_emulation():
58
57
 
59
58
  class Trainer(LightningTrainer):
60
59
  @classmethod
61
- @contextlib.contextmanager
62
- def context(cls, config: BaseConfig):
60
+ def _pre_init(cls, config: BaseConfig):
63
61
  if (precision := config.trainer.set_float32_matmul_precision) is not None:
64
62
  torch.set_float32_matmul_precision(precision)
65
63
 
66
- yield
67
-
68
64
  @classmethod
69
65
  def _update_kwargs(
70
66
  cls,
@@ -288,6 +284,8 @@ class Trainer(LightningTrainer):
288
284
  /,
289
285
  **kwargs: Unpack[LightningTrainerKwargs],
290
286
  ):
287
+ self._pre_init(config)
288
+
291
289
  kwargs = self._update_kwargs(config, kwargs)
292
290
  log.critical(f"LightningTrainer.__init__ with {kwargs=}.")
293
291
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nshtrainer
3
- Version: 0.11.0
3
+ Version: 0.11.1
4
4
  Summary:
5
5
  Author: Nima Shoghi
6
6
  Author-email: nimashoghi@gmail.com
@@ -72,13 +72,13 @@ nshtrainer/trainer/__init__.py,sha256=P2rmr8oBVTHk-HJHYPcUwWqDEArMbPR4_rPpATbWK3
72
72
  nshtrainer/trainer/_runtime_callback.py,sha256=sd2cUdRJG-UCdQr9ruZvEYpNGNF1t2W2fuxwwVlQD9E,4164
73
73
  nshtrainer/trainer/checkpoint_connector.py,sha256=xoqI2dcPnlNFPPLVIU6dBOvRPC9PtfX5qu__xV1lx0Y,2124
74
74
  nshtrainer/trainer/signal_connector.py,sha256=llwc8pdKAWxREFpjdi14Bpy8rGVMEJsmJx_s2p4gI8E,10689
75
- nshtrainer/trainer/trainer.py,sha256=tFyzIsF8c-FABTH6wwDOR9y8kydVJqeVO7PDNFMvhSU,16950
75
+ nshtrainer/trainer/trainer.py,sha256=MrSG83TC1woQ-NqzxcWUerJ3JoFi_gOTh2IMnjNO65Y,16920
76
76
  nshtrainer/util/_environment_info.py,sha256=yPtAbgjCY4tkvh5wp9sjNsF0Z45TYwzEAM_N2_b5BbY,23123
77
77
  nshtrainer/util/environment.py,sha256=AeW_kLl-N70wmb6L_JLz1wRj0kA70xs6RCmc9iUqczE,4159
78
78
  nshtrainer/util/seed.py,sha256=Or2wMPsnQxfnZ2xfBiyMcHFIUt3tGTNeMMyOEanCkqs,280
79
79
  nshtrainer/util/slurm.py,sha256=rofIU26z3SdL79SF45tNez6juou1cyDLz07oXEZb9Hg,1566
80
80
  nshtrainer/util/typed.py,sha256=NGuDkDzFlc1fAoaXjOFZVbmj0mRFjsQi1E_hPa7Bn5U,128
81
81
  nshtrainer/util/typing_utils.py,sha256=8ptjSSLZxlmy4FY6lzzkoGoF5fGNClo8-B_c0XHQaNU,385
82
- nshtrainer-0.11.0.dist-info/METADATA,sha256=IE_faJS_HOMLLu67UPzCAO1aBPZvjWZT3YBCaQ_YpC0,860
83
- nshtrainer-0.11.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
84
- nshtrainer-0.11.0.dist-info/RECORD,,
82
+ nshtrainer-0.11.1.dist-info/METADATA,sha256=lnInZUp-YIr3dp53nyGDQSRFFB2ecLYbYcb_vydhvUs,860
83
+ nshtrainer-0.11.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
84
+ nshtrainer-0.11.1.dist-info/RECORD,,