-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Adding hiera #30356
Adding hiera #30356
Conversation
c.c. @amyeroberts |
@EduardoPach Sure! Just to confirm, should all of these checkpoints be moved? |
Yeap, we have one for each (HieraModel, HieraForPreTraining, HieraForImageClassification) and 6 different sizes |
Hi @EduardoPach so, it seems that @NielsRogge was handling this and was in contact with people from meta regarding the weights transfers. Niels is coming back from holiday I think next week, so let's wait for him to confirm! |
@amyeroberts, @NielsRogge doesn't have permission to move the checkpoints from my account to the facebook orq and I was talking to @dbolya and he is only a part of facebookresearch org and therefore can't add Niels or me as contributors to the org. Could someone with the appropriate permissions just transfer the checkpoints from my account to the Facebook org? (or perhaps facebookresearch idk) |
@amyeroberts Any updates regarding the same ? |
Hi both, finally got to transfer the checkpoints :) they're now all here: https://huggingface.co/models?other=hiera&sort=created |
Thankyou @NielsRogge. @amyeroberts, is there anything else required from our side ? |
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.
@EduardoPach @Namangarg110 Two final updates I can see needed before merge:
- Updating checkpoints for tests
- Removing imports in
model_name/__init__.py
for objects which don't exist
|
||
self.assertTrue(torch.allclose(outputs.logits[0, :5], expected_slice, atol=1e-4)) | ||
|
||
def test_inference_interpolate_pos_encoding(self): |
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.
Checkpoints here need to be updated too
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.
@amyeroberts fixed the checkpoints and cleaned the |
@EduardoPach Great! The last thing is to have a run of the slow tests before merge. Could you push an empty commit with: |
Thank you for your response, @amyeroberts. I have pushed the empty commit, and all tests are green. |
@Namangarg110 It seems there's some slow tests which fail and need to be addressed before merge: Single-GPU tests
Multi-GPU tests
|
c.c. @amyeroberts |
Thanks for addressing all the slow tests - we're good to merge! |
* initialized Structure * Updated variable names * Added Config class, basic HF setup, convert_to_hf * Fixed Convert function, added hiera to HF files, Initilized test files * better naming for x in forward pass * Moved utils to hiera * Change hiera -> hiera_model * Fixed integration into tranformers * Fix: Convert Checkpoint * added documentation for hiera * added documentation for hiera * added Docstings to models, Transformers based changes * make style and quality * make style and quality * Integration & Block tests running * Fixed bugs * initialized Structure * Updated variable names * Added Config class, basic HF setup, convert_to_hf * Fixed Convert function, added hiera to HF files, Initilized test files * better naming for x in forward pass * Moved utils to hiera * Change hiera -> hiera_model * Fixed integration into tranformers * Fix: Convert Checkpoint * added documentation for hiera * added documentation for hiera * added Docstings to models, Transformers based changes * make style and quality * make style and quality * Integration & Block tests running * Fixed bugs * Removed tim dependency * added HieraBlock * fixed: Model name * added tests for HieraModel, HieraBlock * fixed imports * fixed quality & copies * Fixes * Update docs/source/en/model_doc/hiera.md Fix name Co-authored-by: Steven Liu <[email protected]> * Update docs/source/en/model_doc/hiera.md Co-authored-by: Steven Liu <[email protected]> * Update docs/source/en/model_doc/hiera.md Co-authored-by: Steven Liu <[email protected]> * Update src/transformers/models/hiera/configuration_hiera.py Co-authored-by: Steven Liu <[email protected]> * Update src/transformers/models/hiera/configuration_hiera.py Co-authored-by: Steven Liu <[email protected]> * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: Steven Liu <[email protected]> * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: Steven Liu <[email protected]> * Fixed formatting * Code quality & Import differences * quality and repo-consistency fix * fixed no torch error * Docstring fix * Docstring fix * doc string fix * fixed example usage * Resolved issues in modeling_hiera * Removed Hiera MAE * Added test and resolved bug * fixed doc string * First commit * Finished conversion script and model forward working * Resolved all issues * nits * Improving tests * Nits * More nits * Improving HieraForMaskedImageModeling * More improvements and nits * Fixed docstrings of outputs * More fixes * More imrpovments * Updated conversion script * Fixed docstrings * Improved tests * Fixed attentou outputs test * All tests green * Removed unnecessary file * contribution attribution * Resolved a few issues * Resolved Comments * Updated model repo id and fixed bugs * Removed loss print * Make tests green * Updated docstrings * Fix style * Fixed num_heads in config * Removed unnecessary video checkpoint related code in the conversion script * Fix style * Changed atol in conversion script * HieraConfig * Fix copies * Fixed typo * Resolved few issues * make * converted conv_nd -> nn.Module * Removed video complexities * Removed video complexities * fix style * Addressing comments * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: amyeroberts <[email protected]> * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: amyeroberts <[email protected]> * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: amyeroberts <[email protected]> * Fix style * Fixed tests * Fixed typo * Fixed interpolate test * Made torch fx compatible * Made sure imageprocesor is correct * Addressed comments * Noise directly as torch * Remove unnecesary attr * Added return_dit * Update src/transformers/models/hiera/__init__.py Co-authored-by: amyeroberts <[email protected]> * Updated checkpoints * [run_slow] hiera * Fixed device mismatch * [run_slow] hiera * Fixed GPU tests * [run_slow] hiera --------- Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Steven Liu <[email protected]> Co-authored-by: Eduardo Pacheco <[email protected]> Co-authored-by: Eduardo Pacheco <[email protected]> Co-authored-by: amyeroberts <[email protected]>
* initialized Structure * Updated variable names * Added Config class, basic HF setup, convert_to_hf * Fixed Convert function, added hiera to HF files, Initilized test files * better naming for x in forward pass * Moved utils to hiera * Change hiera -> hiera_model * Fixed integration into tranformers * Fix: Convert Checkpoint * added documentation for hiera * added documentation for hiera * added Docstings to models, Transformers based changes * make style and quality * make style and quality * Integration & Block tests running * Fixed bugs * initialized Structure * Updated variable names * Added Config class, basic HF setup, convert_to_hf * Fixed Convert function, added hiera to HF files, Initilized test files * better naming for x in forward pass * Moved utils to hiera * Change hiera -> hiera_model * Fixed integration into tranformers * Fix: Convert Checkpoint * added documentation for hiera * added documentation for hiera * added Docstings to models, Transformers based changes * make style and quality * make style and quality * Integration & Block tests running * Fixed bugs * Removed tim dependency * added HieraBlock * fixed: Model name * added tests for HieraModel, HieraBlock * fixed imports * fixed quality & copies * Fixes * Update docs/source/en/model_doc/hiera.md Fix name Co-authored-by: Steven Liu <[email protected]> * Update docs/source/en/model_doc/hiera.md Co-authored-by: Steven Liu <[email protected]> * Update docs/source/en/model_doc/hiera.md Co-authored-by: Steven Liu <[email protected]> * Update src/transformers/models/hiera/configuration_hiera.py Co-authored-by: Steven Liu <[email protected]> * Update src/transformers/models/hiera/configuration_hiera.py Co-authored-by: Steven Liu <[email protected]> * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: Steven Liu <[email protected]> * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: Steven Liu <[email protected]> * Fixed formatting * Code quality & Import differences * quality and repo-consistency fix * fixed no torch error * Docstring fix * Docstring fix * doc string fix * fixed example usage * Resolved issues in modeling_hiera * Removed Hiera MAE * Added test and resolved bug * fixed doc string * First commit * Finished conversion script and model forward working * Resolved all issues * nits * Improving tests * Nits * More nits * Improving HieraForMaskedImageModeling * More improvements and nits * Fixed docstrings of outputs * More fixes * More imrpovments * Updated conversion script * Fixed docstrings * Improved tests * Fixed attentou outputs test * All tests green * Removed unnecessary file * contribution attribution * Resolved a few issues * Resolved Comments * Updated model repo id and fixed bugs * Removed loss print * Make tests green * Updated docstrings * Fix style * Fixed num_heads in config * Removed unnecessary video checkpoint related code in the conversion script * Fix style * Changed atol in conversion script * HieraConfig * Fix copies * Fixed typo * Resolved few issues * make * converted conv_nd -> nn.Module * Removed video complexities * Removed video complexities * fix style * Addressing comments * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: amyeroberts <[email protected]> * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: amyeroberts <[email protected]> * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: amyeroberts <[email protected]> * Fix style * Fixed tests * Fixed typo * Fixed interpolate test * Made torch fx compatible * Made sure imageprocesor is correct * Addressed comments * Noise directly as torch * Remove unnecesary attr * Added return_dit * Update src/transformers/models/hiera/__init__.py Co-authored-by: amyeroberts <[email protected]> * Updated checkpoints * [run_slow] hiera * Fixed device mismatch * [run_slow] hiera * Fixed GPU tests * [run_slow] hiera --------- Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Steven Liu <[email protected]> Co-authored-by: Eduardo Pacheco <[email protected]> Co-authored-by: Eduardo Pacheco <[email protected]> Co-authored-by: amyeroberts <[email protected]>
* initialized Structure * Updated variable names * Added Config class, basic HF setup, convert_to_hf * Fixed Convert function, added hiera to HF files, Initilized test files * better naming for x in forward pass * Moved utils to hiera * Change hiera -> hiera_model * Fixed integration into tranformers * Fix: Convert Checkpoint * added documentation for hiera * added documentation for hiera * added Docstings to models, Transformers based changes * make style and quality * make style and quality * Integration & Block tests running * Fixed bugs * initialized Structure * Updated variable names * Added Config class, basic HF setup, convert_to_hf * Fixed Convert function, added hiera to HF files, Initilized test files * better naming for x in forward pass * Moved utils to hiera * Change hiera -> hiera_model * Fixed integration into tranformers * Fix: Convert Checkpoint * added documentation for hiera * added documentation for hiera * added Docstings to models, Transformers based changes * make style and quality * make style and quality * Integration & Block tests running * Fixed bugs * Removed tim dependency * added HieraBlock * fixed: Model name * added tests for HieraModel, HieraBlock * fixed imports * fixed quality & copies * Fixes * Update docs/source/en/model_doc/hiera.md Fix name Co-authored-by: Steven Liu <[email protected]> * Update docs/source/en/model_doc/hiera.md Co-authored-by: Steven Liu <[email protected]> * Update docs/source/en/model_doc/hiera.md Co-authored-by: Steven Liu <[email protected]> * Update src/transformers/models/hiera/configuration_hiera.py Co-authored-by: Steven Liu <[email protected]> * Update src/transformers/models/hiera/configuration_hiera.py Co-authored-by: Steven Liu <[email protected]> * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: Steven Liu <[email protected]> * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: Steven Liu <[email protected]> * Fixed formatting * Code quality & Import differences * quality and repo-consistency fix * fixed no torch error * Docstring fix * Docstring fix * doc string fix * fixed example usage * Resolved issues in modeling_hiera * Removed Hiera MAE * Added test and resolved bug * fixed doc string * First commit * Finished conversion script and model forward working * Resolved all issues * nits * Improving tests * Nits * More nits * Improving HieraForMaskedImageModeling * More improvements and nits * Fixed docstrings of outputs * More fixes * More imrpovments * Updated conversion script * Fixed docstrings * Improved tests * Fixed attentou outputs test * All tests green * Removed unnecessary file * contribution attribution * Resolved a few issues * Resolved Comments * Updated model repo id and fixed bugs * Removed loss print * Make tests green * Updated docstrings * Fix style * Fixed num_heads in config * Removed unnecessary video checkpoint related code in the conversion script * Fix style * Changed atol in conversion script * HieraConfig * Fix copies * Fixed typo * Resolved few issues * make * converted conv_nd -> nn.Module * Removed video complexities * Removed video complexities * fix style * Addressing comments * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: amyeroberts <[email protected]> * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: amyeroberts <[email protected]> * Update src/transformers/models/hiera/modeling_hiera.py Co-authored-by: amyeroberts <[email protected]> * Fix style * Fixed tests * Fixed typo * Fixed interpolate test * Made torch fx compatible * Made sure imageprocesor is correct * Addressed comments * Noise directly as torch * Remove unnecesary attr * Added return_dit * Update src/transformers/models/hiera/__init__.py Co-authored-by: amyeroberts <[email protected]> * Updated checkpoints * [run_slow] hiera * Fixed device mismatch * [run_slow] hiera * Fixed GPU tests * [run_slow] hiera --------- Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Steven Liu <[email protected]> Co-authored-by: Eduardo Pacheco <[email protected]> Co-authored-by: Eduardo Pacheco <[email protected]> Co-authored-by: amyeroberts <[email protected]>
What does this PR do?
Adds Hiera model from Meta as suggested in #28993
GitHub Repo: https://github.com/facebookresearch/hiera/
arXiv: https://arxiv.org/abs/2306.00989
Model License recently changed to Apache
This PR is to merge the work done by @EduardoPach and me in #29339 and #29945 respectively.
c.c. @amyeroberts