From 94c35b38ca8fd2f782d405bb43a068e3064b56b8 Mon Sep 17 00:00:00 2001 From: Benjamin Warner Date: Fri, 27 Jan 2023 16:20:12 -0600 Subject: [PATCH] Prep for release --- fastxtend/__init__.py | 2 +- fastxtend/callback/progresize.py | 10 ++++++++-- nbs/callback.progresize.ipynb | 10 ++++++++-- nbs/optimizer.adan.ipynb | 2 +- nbs/optimizer.fused.ipynb | 2 +- settings.ini | 2 +- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/fastxtend/__init__.py b/fastxtend/__init__.py index 6561790..d62d967 100644 --- a/fastxtend/__init__.py +++ b/fastxtend/__init__.py @@ -1 +1 @@ -__version__ = "0.0.15" +__version__ = "0.0.16" diff --git a/fastxtend/callback/progresize.py b/fastxtend/callback/progresize.py index 11af1ab..a7f0d2b 100644 --- a/fastxtend/callback/progresize.py +++ b/fastxtend/callback/progresize.py @@ -143,8 +143,14 @@ def before_fit(self): if self.resize_batch: # Set when the progressive resizing step is applied in training percent - self.start = self.start/self.n_epoch if isinstance(self.start, int) else self.start - self.finish = self.finish/self.n_epoch if isinstance(self.finish, int) else self.finish + if self.start >= 1 and isinstance(self.start, int): + self.start = self.start/self.n_epoch + if self.finish >= 1 and isinstance(self.finish, int): + self.finish = self.finish/self.n_epoch + if self.start >= 1: + warn(f'ProgressiveResize start {self.start} is equal or greater than one and will not start in this training run') + if self.finish >= 1: + warn(f'ProgressiveResize finish {self.finish} is equal or greater than one and will not finish in this training run') n_steps = ((self.final_size-self.current_size) / self.increase_by).int() if sum(n_steps.shape)==2: n_steps = n_steps[0].item() diff --git a/nbs/callback.progresize.ipynb b/nbs/callback.progresize.ipynb index c49cf57..b9a1d10 100644 --- a/nbs/callback.progresize.ipynb +++ b/nbs/callback.progresize.ipynb @@ -216,8 +216,14 @@ "\n", " if self.resize_batch:\n", " # Set when the progressive resizing step is applied in training percent\n", - " self.start = self.start/self.n_epoch if isinstance(self.start, int) else self.start\n", - " self.finish = self.finish/self.n_epoch if isinstance(self.finish, int) else self.finish\n", + " if self.start >= 1 and isinstance(self.start, int):\n", + " self.start = self.start/self.n_epoch\n", + " if self.finish >= 1 and isinstance(self.finish, int):\n", + " self.finish = self.finish/self.n_epoch\n", + " if self.start >= 1:\n", + " warn(f'ProgressiveResize start {self.start} is equal or greater than one and will not start in this training run')\n", + " if self.finish >= 1:\n", + " warn(f'ProgressiveResize finish {self.finish} is equal or greater than one and will not finish in this training run')\n", " n_steps = ((self.final_size-self.current_size) / self.increase_by).int()\n", " if sum(n_steps.shape)==2:\n", " n_steps = n_steps[0].item()\n", diff --git a/nbs/optimizer.adan.ipynb b/nbs/optimizer.adan.ipynb index 1a4ce28..cfeaaaf 100644 --- a/nbs/optimizer.adan.ipynb +++ b/nbs/optimizer.adan.ipynb @@ -551,7 +551,7 @@ "AdamW vs Adan Training Speed\n", ":::\n", "\n", - "[^faster]: Benchmarked on a GeForce 3080 Ti using PyTorch 1.13.1 on Cuda 11.7, Mixed Precision, [Channels Last](callback.channelslast.html) (except DeBERTa and ViT), and fastxtend's [Simple Profiler Callback](callback.simpleprofiler.html). Results may differ on other models, hardware, and across benchmarking runs. Speedup and slowdown are calculated from the total time spent on the optimization step." + "[^faster]: Benchmarked on a GeForce 3080 Ti using PyTorch 1.13.1 Cuda 11.7, Mixed Precision, [Channels Last](callback.channelslast.html) (except DeBERTa and ViT), and fastxtend's [Simple Profiler Callback](callback.simpleprofiler.html). Results may differ on other models, hardware, and across benchmarking runs. Speedup and slowdown are calculated from the total time spent on the optimization step." ] } ], diff --git a/nbs/optimizer.fused.ipynb b/nbs/optimizer.fused.ipynb index 5261d74..cd7c611 100644 --- a/nbs/optimizer.fused.ipynb +++ b/nbs/optimizer.fused.ipynb @@ -80,7 +80,7 @@ "\n", ": Increase in [AdamW](#adam-optimizer) `opt_step` Speed With Multiple Param Groups vs fastai Native Optimizer {#tbl-layers} {tbl-colwidths=\"[10,2,8,8,8,8,8]\"}\n", "\n", - "[^faster]: All optimizers benchmarked on a GeForce 3080 Ti using PyTorch 1.12.1 on Cuda 11.6, Mixed Precision, [Channels Last](callback.channelslast.html) (except ViT and DeBERTa), and fastxtend's [Simple Profiler Callback](callback.simpleprofiler.html). Results may differ with other optimizers, models, hardware, and across benchmarking runs. Speedup is calculated from the total time spent on the optimization step.\n", + "[^faster]: All optimizers benchmarked on a GeForce 3080 Ti using PyTorch 1.12.1 Cuda 11.6, Mixed Precision, [Channels Last](callback.channelslast.html) (except ViT and DeBERTa), and fastxtend's [Simple Profiler Callback](callback.simpleprofiler.html). Results may differ with other optimizers, models, hardware, and across benchmarking runs. Speedup is calculated from the total time spent on the optimization step.\n", "\n", "## Examples\n", "\n", diff --git a/settings.ini b/settings.ini index 7552725..ade127d 100644 --- a/settings.ini +++ b/settings.ini @@ -8,7 +8,7 @@ author = Benjamin Warner author_email = me@benjaminwarner.dev copyright = Benjamin Warner branch = main -version = 0.0.15 +version = 0.0.16 min_python = 3.8 audience = Developers language = English