-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
idefics2 enable_input_require_grads not aligned with disable_input_re… #33194
idefics2 enable_input_require_grads not aligned with disable_input_re… #33194
Conversation
4db5300
to
e6b853f
Compare
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.
Thanks for opening this PR and fixing!
For my own understanding of the changes - it seems there's two changes happening here: one which ensures proper disabling of hooks, the other which adds peft-related logic to the tests. Is the latter necessary to catch the former?
…quire_grads make peft+idefics2 checkpoints disable fail Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
yes, the latter is used to catch the former. |
@sywangyi Could you explain a bit why? In the case of the test, In particular, I think that we probably want a peft-specific test to be separated out of the current test to make sure what's being tested and why is clear |
see logic in https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L2380 and https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L2429 this path (_hf_peft_config_loaded=True) is not tested. so I set _hf_peft_config_loaded to False and True to test both path. |
@sywangyi OK, I see. Hmmm -- we shouldn't really need to know about PEFT + trainer within the modeling utils but alas it's there. Could you split up the tests so that we have a separate one for the PEFT condition and resolve the failing tests? After than I think the PR will be good to go |
Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
I check the failure case this case has nothing to do with the PR |
Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
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.
Thanks for fixing and iterating on this!
Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
huggingface#33194) * idefics2 enable_input_require_grads not aligned with disable_input_require_grads make peft+idefics2 checkpoints disable fail Signed-off-by: Wang, Yi <yi.a.wang@intel.com> * split test case Signed-off-by: Wang, Yi <yi.a.wang@intel.com> * fix ci failure Signed-off-by: Wang, Yi <yi.a.wang@intel.com> * refine test Signed-off-by: Wang, Yi <yi.a.wang@intel.com> --------- Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
huggingface#33194) * idefics2 enable_input_require_grads not aligned with disable_input_require_grads make peft+idefics2 checkpoints disable fail Signed-off-by: Wang, Yi <yi.a.wang@intel.com> * split test case Signed-off-by: Wang, Yi <yi.a.wang@intel.com> * fix ci failure Signed-off-by: Wang, Yi <yi.a.wang@intel.com> * refine test Signed-off-by: Wang, Yi <yi.a.wang@intel.com> --------- Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
huggingface#33194) * idefics2 enable_input_require_grads not aligned with disable_input_require_grads make peft+idefics2 checkpoints disable fail Signed-off-by: Wang, Yi <yi.a.wang@intel.com> * split test case Signed-off-by: Wang, Yi <yi.a.wang@intel.com> * fix ci failure Signed-off-by: Wang, Yi <yi.a.wang@intel.com> * refine test Signed-off-by: Wang, Yi <yi.a.wang@intel.com> --------- Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
huggingface#33194) * idefics2 enable_input_require_grads not aligned with disable_input_require_grads make peft+idefics2 checkpoints disable fail Signed-off-by: Wang, Yi <yi.a.wang@intel.com> * split test case Signed-off-by: Wang, Yi <yi.a.wang@intel.com> * fix ci failure Signed-off-by: Wang, Yi <yi.a.wang@intel.com> * refine test Signed-off-by: Wang, Yi <yi.a.wang@intel.com> --------- Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
…quire_grads
make peft+idefics2 checkpoints disable fail
error like
AttributeError: 'GaudiIdefics2ForConditionalGeneration' object has no attribute '_require_grads_hook'