-
Notifications
You must be signed in to change notification settings - Fork 34
Adding dinov3 collection of vit models #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Can you please review my PR @chapman20j |
|
Hi @coder0143. Thanks for the nice PR! I left a few comments. Having explicit configs here can help make it more clear what hyperparameters are used in constructing the model and could simplify some parts of the code. Also, including more testing ensures model correctness. Looking forward to the final version! |
|
Thankyou so much for reviewing and replying @chapman20j , I have made the following changes:
|
|
Hi, could you ensure that the tests above are passing? i.e.
|
|
Thankyou for reviewing @jenriver , I have made the following changes:
|
|
Hi, we're still seeing pre-commit failures as above -- could you ensure you have run pre-commit hooks? i.e. |
| raw_path = "~/.cache/huggingface/dinov3_vitb16" | ||
| self.save_dir = os.path.expanduser(raw_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you not use local directory paths?
i.e. Something like
self.save_dir = snapshot_download(...)
|
I have made the necessary changes and everything will pass now, thankyou for reviewing and guiding my pr @chapman20j and @jenriver, btw I have sent connect request on LinkedIn! |
| np_y = np.asarray(jax.device_get(jy)) | ||
| ty_bonsai = torch.tensor(np_y, dtype=torch.float32) | ||
|
|
||
| torch.testing.assert_close(ty_bonsai, ty, rtol=1e-5, atol=3e-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite a high tolerance. If RoPE casting and LayerNorms are correctly aligned, we should be seeing a value much tighter than this.
|
Yeah, actually things are working just fine, I just updated the atol values and tested it many times, for first layer, setting atol to 2e-3 is ok but in a very worse case, we get atol as 0.0024 max, I have also updated and tested for other output functions. Actually pytorch casts to |
Resolves #98
Reference
Checklist
run_model.pyfor model usage,test_outputs.pyand/ormodel_validation_colab.ipynbfor quality).