November 3, 2026
reset_classifier()and checkpoint reconstruction: fixes across ViT, EVA, BEiT, NaFlexViT, RepViT and iFormer
preserve normalization placement and distillation settings when exporting / reloading models after changing the
classifier or pooling. Also fix unpooled PiT export and EfficientFormerV2 with distillation disabled.- NaFlex: fix ViT / EVA norm placement during conversion, support SwiGLU alignment for DINOv3 / Lingbot checkpoints,
and preserve grayscale / non-RGB input channels in data loaders. - Fix layer-wise LR decay grouping for RepViT, HGNet, MViTv2 and pre-norm ViTs, and InceptionNeXt feature sizes with
output_stride=8/16. - Release 1.0.31.
October 24, 2026
forward_intermediates()andprune_intermediate_layers()are now supported by every model. Newly added for CSPNet, NFNet, DLA, DenseNet (#2870, thanks ghaith-mq), CoaT, ConViT, ConvMixer, CrossViT, HRNet, Inception-v3, Inception-ResNet-v2, NASNet, PNASNet, SelecSLS, SENet, Sequencer2d, VGG, Visformer, Xception and Aligned Xception, withprune_intermediate_layers()for NaFlexViT and MobileNetV5 encoders. CoaT, ConViT, ConvMixer, CrossViT and Visformer gainfeatures_onlysupport.prune_intermediate_layers()fixesprune_head=Trueremoves the whole head (head norm, pre-logits layers, attention pooling) so the pruned model leaves no unused params (DDP w/ofind_unused_parameters), except CoaT, CrossViT and HRNet when only some of their parallel scales / branches are taken. Passprune_head=Falseto keep it.- Pruning a hierarchical model to an earlier stage removes the final norm and head sized for the last stage,
forward_features()ends at the last kept feature andnum_features/head_hidden_sizematch it. Pruning to the stem feature removes the stem pooling after it. - Fixes for grad checkpointing,
stop_early, class token / post network removal, and TorchScript of pruned /feature_cls='getter'models across many families.
head_hidden_sizeis the actual pre-logits (pooled) width in all models, including concat pooling (catavgmax) and afterreset_classifier(). Pool types a model can't apply now raise at creation / reset instead of being silently ignored or failing in forward.- Other fixes: VOLO
num_classes=0output is the class token embedding (matchingforward_head(pre_logits=True)),vit_pe_corereset_classifier()w/ a nonmappool removes the attention pool, pool type export viasave_for_hfreads the head's current pooling, and headless (num_classes=0) Swin, SwinV2, DaViT and NextViT checkpoints reload correctly.
October 13, 2026
- Hyperparameter sweeps via a new
sweep.py: grid / random search over anytrain.pyargument, one effective--configper job, run on a pool of local GPUs and resumable. WSD sweeps train one stable trunk per hyperparameter combination and branch independent cooldowns from its milestone checkpoints, comparing annealing at several budgets for a fraction of the cost of full runs. See the training docs. train.py:--resume autoresumes in place from the experiment's ownlast.pth.tar(checkpoint history,model_bestandsummary.csvstay consistent),--stop-epoch Nstops without changing the schedule,--save-epochs N [N ...]keepsmilestone-N.pth.tarsnapshots, and YAML--configvalues are validated against the script's arguments.- Deprecate
PlateauLRScheduler(--sched plateau).timmschedulers are stateless functions of the epoch or update count, the metric-driven plateau schedule never fit that and its state is not checkpointed, so resume was never exact. Usecosineorwsd. - Docs: new Model API page, generated model family pages for every model module replacing the old per-model pages, and expanded data / loss / models reference pages.
- Model API consistency fixes:
reset_classifier()keeps the current pooling in all models, unknown constructor args raiseTypeErroreverywhere, Swin familydynamic_img_size, LeViT layer-wise lr decay,no_weight_decaynames that matched no params (NesT, SwinV2, XCiT, FocalNet), resize state recorded for allset_input_sizefamilies. - Fixes: GCViT global query mixed images within a batch, gradient checkpointing for RDNet and MobileNetV5,
save_for_hfstale test input size, EfficientViT (MSRA) rectangular resize, ImageDataset image conversion errors (#2846).reparameterize_modelmoved totimm.models.
October 9, 2026
- Add CSPNeXt (RTMDet backbone)
cspnext_{tiny,s,m,l,x}with ImageNet-1k classification weights converted from OpenMMLab. Thanks Munehiro Kobayashi. - Optimizer improvements
- Foreach (multi-tensor) impls for RMSpropTF, LaProp, LAMB, LARS, AdaBelief. Foreach steps are chunked by device L2 cache size (
TIMM_FOREACH_CHUNK_SIZEto override). - RMS update clipping (
clipping_threshold) for AdamWLegacy / NAdamW, new decoupled / corrected weight decay NovoGrad variants (novogradw,novogradc). - Correctness fixes across many optimizers, including corrected weight decay w/ in-place updated tensor lr, FP16 update stalls at small lr, low precision state handling (Kron, AdaBelief, NovoGrad), and no more in-place
p.grad
modification. torch.compile/ CUDA graph fixes for Adopt, SGDW, AdafactorBV.- New optimizer docs covering usage, naming conventions, and families.
- Foreach (multi-tensor) impls for RMSpropTF, LaProp, LAMB, LARS, AdaBelief. Foreach steps are chunked by device L2 cache size (
- Add WSD (warmup-stable-decay) LR scheduler (
--sched wsd,--lr-decay-fn,--lr-stable-timescale). - Model EMA fixes for bfloat16 / float16 models. ModelEmaV3 bfloat16 EMAs use stochastic rounding by default, float16 models keep a float32 EMA.
- Model resizing via
set_input_size()- Expanded support for windowed models (MaxViT, CoAtNet, BEiT, EfficientViT-MSRA, relpos ViT, Swin family).
- Swin / SwinV2 / SwinV2-CR keep each stage's window to grid ratio on resize, a call at the current size is now a no-op. Per-stage
window_size/window_ratiosupported. Fixes Swin S3 and SwinV2window16/window12models
changing outputs on a same-size call. - Fix SwinV2 NaN w/ a window size of 1, odd stage feature sizes, and hybrid ViT resize on CUDA / low precision.
- Fix grad accumulation remainder handling (#2821), distributed sampling / repeated augmentation on small datasets, pretrained source overrides and distillation teacher setup,
train.pyw/--sched none, and eval center crop
interpolation for non-square inputs. - ONNX export compatibility fixes across PyTorch versions, dropout consistency fixes, and more meta-device init fixes.
September 25, 2026
- Multi-label classification support
- Add
--task multilabeltotrain.py/validate.py, trained with BCE (MultiLabelClassificationTask). See the
training docs for details. - Targets can be lists of class indices, dense multi-hot vectors (
--target-format multihot), or one binary field
per class (--target-key a,b,c), with/paths into nested fields. Supported by thehfds,hfids,tfds
(multi-field keys), andwdsreaders. - Mixup / CutMix and NaFlex loaders support multi-label targets. Label smoothing moves each target towards 0.5
and defaults to 0 for multi-label. - Validation reports mAP (the default
--eval-metric) plus micro, macro, and sample F1, with an F1 threshold set by
--multilabel-threshold. - New dataset-level evaluators compute metrics over the full validation set across distributed ranks, excluding
distributed sampler padding. - See the timm multi-label image datasets
collection on the Hub for example / benchmark datasets that work out of the box.
- Add
- New loss options via
--loss- Poly-1, Two-way, ZLPR, and Distribution-Balanced losses.
- Class-frequency weighting for BCE / ASL, computed from label counts gathered by
class_weights.py. - ASL is now fp16-safe and defaults to
batchmeanreduction
- RoPE Refactor
- Extend training-only RoPE coordinate augmentation (shift, jitter, rescale) to axial, mixed, and MRoPE embeddings,
sharing helpers with DINOv3 while preserving its existing augmentation behavior. - Add
grid_typeandnormalize_coordsoptions to the Fourier / rotary builders (build_fourier_pos_embed,
build_rotary_pos_embed) and axial RoPE modules, and configurable MRoPE sections in EVA. - Support
rotate_halfin the tuple-outputRotaryEmbeddingand thebasefactory variant. - Correct rotation-layout forwarding in EVA, NaFlexViT, and MRoPE attention pooling.
- Keep non-learned RoPE frequency and coordinate buffers at least float32 in half/bfloat16 models, and compute mixed
RoPE phases in float32 under autocast. These precision fixes can change low-precision model outputs. - Fix batched RoPE embeddings for pixel grids and reference-shape rescaling. DINOv3
grid_indexing='xy'now swaps
coordinate channels as requested; outputs for these previously incorrect configurations change. - Make
apply_rot_embed,apply_rot_embed_cat, andapply_rot_embed_listreturn each input's dtype, casting after
the rotation without first downcasting sin/cos. - Consolidate the two axial RoPE modules behind a private base. Existing calls remain compatible, but the
bands
buffer is now retained in both cached and dynamic modes (rope.bandsis no longerNonein cached mode).
- Extend training-only RoPE coordinate augmentation (shift, jitter, rescale) to axial, mixed, and MRoPE embeddings,
- Train/eval mode switch and dtype change fixes for LeViT and related models (EfficentFormer*, EfficientViT-MSRA, TinyViT) w/ cached attention biases.
What's Changed
- Fix convit GPSA rel_indices staying on stale device/dtype after .to() by @YHC66 in #2798
- multi-label classification by @rwightman in #2793
- Fix metric-less CheckpointSaver history tracking by @aswanth-07 in #2761
- fix(distributed): bind the device for
npu:<index>in init_distributed_device_so() by @li-lizhe in #2801 - Fix attention bias caches after dtype conversion by @aswanth-07 in #2802
- Refactor RoPE helpers, improve precision, and extend coordinate augme… by @rwightman in #2797
- Add loss type selection, new losses, and class-frequency weighting by @rwightman in #2803
- Fix sampler small dataset by @rwightman in #2807
- Pretrained source custom load by @rwightman in #2808
- Fix forward_intermediates grad checkpointing and head pruning in EfficientViT (MIT) by @yupengtang in #2810
- Harden _registry functions. Fix #2816 by @rwightman in #2818
- Address onnx export API compat issues across torch versions. by @rwightman in #2819
- Use the requested interpolation for non-square eval center crop by @Arthur031221 in #2824
- Fix/swin window resize by @rwightman in #2820
- Fix/dropout cleanup by @rwightman in #2826
- Fix #2821 grad accum remainder bug without args. use by @rwightman in #2827
- Pass --filename-col to inference results writers by @Arthur031221 in #2825
- Handle sliced Hugging Face dataset splits by @Arthur031221 in #2828
- Optim fixes / correctness by @rwightman in #2832
- Bump doc-builder workflow pin by @paulinebm in #2834
- A few more optimizers followup fixes by @rwightman in #2836
- Fix MKL thread chunks breakign exact float tests on GitHub CI runners by @rwightman in #2837
- Read class map .txt and write hub README as UTF-8 by @Aditya17-bot in #2839
- Fix model EMA for bfloat16 / float16 models by @rwightman in #2841
- Fix train.py crash with --sched none, raise on unknown scheduler names by @rwightman in #2843
- Improve model resize support via set_input_size() by @rwightman in #2842
- CSPNeXT by @rwightman in #2844
- Add CSPNeXt (RTMDet backbone) with ImageNet-1k classification weights by @munehiro-k in #2831
- Bump trufflesecurity/trufflehog from 3.97.4 to 3.97.9 in the actions group across 1 directory by @dependabot[bot] in #2835
- Clean up DPN model without changing the state dict by @rwightman in #2845
- Fix/model input config by @rwightman in #2785
- Fix GCViT global query mixing images within a batch by @tritsystem in #2848
- Sweep by @rwightman in #2853
- Fix/community prs 2849 2852 by @rwightman in #2854
- Fix features_only backward with grad checkpointing for in-place stem activations by @tritsystem in #2849
- Apply MobileNetV5 fusion to final intermediate features by @aswanth-07 in #2850
- Freeze root parameters in whole-model freeze and unfreeze by @aswanth-07 in #2851
- More sweep improvements, fix some failure cases, shared filesystem use by @rwightman in #2855
- Fix/community prs 2856 2858 by @rwightman in #2859
- Bunch of little fixes by @rwightman in #2862
- Only lowercase the dataset/reader prefix, keep HF / TFDS names case-sensitive by @rwightman in #2867
- Fix attention pooling for rectangular feature grids by @mottopanikeiku in #2866
- RADIO (C-RADIOv3/v4) support for NaFlexVit and VisionTransformer by @rwightman in #2864
- Fix InceptionNeXt MlpClassifierHead with num_classes=0 by @ghaith-mq in #2868
- Clean state dict prefixes by @rwightman in #2871
- A few hparam / train cmd doc additions by @rwightman in #2872
- Fix group_matcher layer groups for RepViT, HGNet, MViTv2 and pre-norm ViTs by @mottopanikeiku in #2876
- Fix InceptionNeXt feature map size with output_stride 8 / 16 by @mottopanikeiku in #2875
- Forward intermediates all by @rwightman in #2879
- Add forward_intermediates to CSPNet, NFNet, DLA and DenseNet by @ghaith-mq in #2870
- Fix reset classifier export by @rwightman in #2881
- Fix reloading saved models after reset_classifier in ViT, EVA, BEiT, NaFlexViT and RepViT by @patrasq in #2880
- Bump doc-builder to get the docs machine-translated by @mishig25 in #2884
- Preserve input channels in NaFlex data loaders by @aswanth-07 in #2886
- Bump the actions group across 1 directory with 5 updates by @dependabot[bot] in #2885
- Prep for release 1.0.31 by @rwightman in #2888
New Contributors
- @li-lizhe made their first contribution in #2801
- @yupengtang made their first contribution in #2810
- @Arthur031221 made their first contribution in #2824
- @Aditya17-bot made their first contribution in #2839
- @munehiro-k made their first contribution in #2831
- @tritsystem made their first contribution in #2848
- @mottopanikeiku made their first contribution in #2866
- @ghaith-mq made their first contribution in #2868
- @patrasq made their first contribution in #2880
Full Changelog: v1.0.30...v1.0.31