Ross Wightman
b7ced7c40c
torch.fx.wrap not working with older pytorch, trying register_notrace instead
2025-05-25 14:13:36 -07:00
Ross Wightman
842a786626
A few more maybe_add_mask situations
2025-05-25 08:51:56 -07:00
Ross Wightman
dd2c1418d0
Fix tracing of attention module with attn_mask support
2025-05-24 21:13:01 -07:00
Ross Wightman
7bfe606d9f
Merge remote-tracking branch 'origin/main' into naflex
2025-05-23 09:41:49 -07:00
Ross Wightman
fa7287faee
Add EVA ViT based PE (Perceptual Encoder) impl
2025-05-10 13:13:12 -07:00
Xihua Dong
0c136f7dab
fix img_size type
2025-04-18 21:05:05 -07:00
Ross Wightman
ea728f67fa
Improve several typing issues for flex vit, can (almost) work with jit if we bash h,w key into an int or str
2025-04-14 11:01:56 -07:00
Ross Wightman
97341fec51
A much faster resample_patch_embed, can be used at train/validation time
2025-04-10 15:58:24 -07:00
Ross Wightman
0893f5d296
Initial NaFlex ViT model and training support
2025-04-07 21:27:10 -07:00
Ross Wightman
9758e0b8b0
Prep for siglip2 release
2025-02-21 13:10:51 -08:00
Collin McCarthy
84631cb5c6
Add missing training flag to convert_sync_batchnorm
2025-01-21 11:51:55 -08:00
Josua Rieder
8d81fdf3d9
Fix typos
2025-01-19 13:39:40 -08:00
Adam J. Stewart
f5c4d5cbb7
Add missing imports
2025-01-11 15:13:16 +01:00
Adam J. Stewart
19aaea3c8f
Fix nn.Module type hints
2025-01-11 15:09:21 +01:00
Ross Wightman
155f6e7fea
Update README, few minor fixups.
2025-01-06 13:09:15 -08:00
Ross Wightman
2b251fb291
Wrap torch checkpoint() fn to default use_reentrant flag to False and allow env var override
2025-01-06 11:28:39 -08:00
Ross Wightman
131518c15c
Add comments to MLP layers re expected layouts
2025-01-02 09:41:35 -08:00
Louis Lac
2d5277e858
Merge branch 'main' into fix-mqa-v2
2025-01-02 00:11:22 +01:00
Louis Lac
2d734d9058
Fixed unfused attn2d scale
2025-01-01 12:34:07 -08:00
Louis Lac
6171e756d3
Fix MQA V2 scale and out shape
2025-01-01 15:37:28 +01:00
Ross Wightman
de35fd87f5
Add SimpleNorm to create_norm factory
2024-12-30 19:24:21 -08:00
Ross Wightman
d5375ca769
Use torch F.rms_norm when possible, select fast vs normal paths appropriately and test with torchscript
2024-12-30 19:24:21 -08:00
Ross Wightman
5804d92e4b
Switch aimv2 to used packed SwiGLU
2024-12-30 19:24:21 -08:00
Ross Wightman
15406a939e
Fixing RmsNorm to fix #2380 and noticed with aimv2 when comparing outputs. Still some work to do, need to look at AMP / fast mode behaviour, dispatch to torch when possible. Add SimpleNorm for 'LayerNorm w/o centering and bias'
2024-12-30 19:24:21 -08:00
Ross Wightman
a648a04834
Supporting aimv2 encoders
2024-12-30 19:24:21 -08:00
Ross Wightman
464885e135
See if we can avoid some model / layer pickle issues with the aa attr in ConvNormAct
2024-12-03 08:02:55 -08:00
Ross Wightman
1766a01f96
Cleanup some amp related behaviour to better support different (non-cuda) devices
2024-10-18 13:54:16 -07:00
Ross Wightman
5d7bd2973e
convnext zepto, rmsnorm experiments
2024-09-30 11:43:23 -07:00
Ross Wightman
962958723c
More Hiera updates. Add forward_intermediates to hieradat/sam2 impl. Make both use same classifier module. Add coarse bool to intermediates.
2024-08-16 11:10:04 -07:00
Ross Wightman
f2cfb4c677
Add WIP HieraDet impl (SAM2 backbone support)
2024-08-15 17:58:15 -07:00
Ross Wightman
a50e53d41f
Rename global pos embed for Hiera abswin, factor out commonly used vit weight init fns to layers. Add a channels-last ver of normmlp head.
2024-08-15 17:46:36 -07:00
Ross Wightman
2f3fed43b8
Fix hiera init with num_classes=0, fix weight tag names for sbb2 hiera/vit weights, add LayerScale/LayerScale2d to layers
2024-08-15 11:14:38 -07:00
Ross Wightman
ab8cb070fc
Add xavier_uniform init of MNVC hybrid attention modules. Small improvement in training stability.
2024-07-26 17:03:40 -07:00
Ross Wightman
cec70b6779
Merge pull request #2225 from huggingface/small_things
...
Small things
2024-07-25 20:29:13 -07:00
Ross Wightman
7e0caa1ba3
Padding helpers work if tuples/lists passed
2024-07-19 14:28:03 -07:00
Ross Wightman
2180800646
MQA query_strides bugs fix #2237 . No padding for avg_pool2d if not 'same', use scale_factor for Upsample.
2024-07-19 14:26:54 -07:00
Ross Wightman
392b78aee7
set_input_size initial impl for vit & swin v1. Move HybridEmbed to own location in timm/layers
2024-07-17 15:25:48 -07:00
Ross Wightman
57adc1acc8
Fix rotary embed version of attn pool. Bit of cleanup/naming
2024-06-11 23:49:17 -07:00
Ross Wightman
cdc7bcea69
Make 2d attention pool modules compatible with head interface. Use attention pool in CLIP ResNets as head. Make separate set of GAP models w/ avg pool instead of attn pool.
2024-06-11 21:32:07 -07:00
Ross Wightman
30ffa152de
Fix load of larger ResNet CLIP models, experimenting with making AttentionPool *the* head, seems to fine-tune better, one less layer.
2024-06-10 12:07:14 -07:00
Ross Wightman
5e9ff5798f
Adding pos embed resize fns to FX autowrap exceptions
2024-06-10 12:06:47 -07:00
Ross Wightman
f0fb471b26
Remove separate ConvNormActAa class, merge with ConvNormAct
2024-06-10 12:05:35 -07:00
Ross Wightman
5efa15b2a2
Mapping OpenAI CLIP Modified ResNet weights -> ByobNet. Improve AttentionPool2d layers. Fix #1731
2024-06-09 16:54:48 -07:00
Ross Wightman
cc8a03daac
Add ConvStem and MobileCLIP hybrid model for B variant. Add full norm disable support to ConvNormAct layers
2024-06-06 09:15:27 -07:00
Ross Wightman
5fa6efa158
Add anti-aliasing support to mobilenetv3 and efficientnet family models. Update MobileNetV4 model defs, resolutions. Fix #599
...
* create_aa helper function centralized for all timm uses (resnet, convbnact helper)
* allow BlurPool w/ pre-defined channels (expand)
* mobilenetv4 UIB block using ConvNormAct layers for improved clarity, esp with AA added
* improve more mobilenetv3 and efficientnet related type annotations
2024-05-27 22:06:22 -07:00
Ross Wightman
7fe96e7a92
More MobileNet-v4 fixes
...
* missed final norm after post pooling 1x1 PW head conv
* improve repr of model by flipping a few modules to None when not used, nn.Sequential for MultiQueryAttention query/key/value/output
* allow layer scaling to be enabled/disabled at model variant level, conv variants don't use it
2024-05-24 15:09:29 -07:00
Ross Wightman
70176a2dae
torchscript typing fixes
2024-05-23 11:43:05 -07:00
Ross Wightman
2a1a6b1236
Adding missing attention2d.py
2024-05-23 11:06:32 -07:00
Ross Wightman
cee79dada0
Merge remote-tracking branch 'origin/main' into efficientnet_x
2024-05-23 11:01:39 -07:00
Ross Wightman
6a8bb03330
Initial MobileNetV4 pass
2024-05-23 10:49:18 -07:00