Skip to content
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

FIX: Fix corner-case issue with the important models workflow #30212

Merged
merged 19 commits into from
Apr 16, 2024

Conversation

younesbelkada
Copy link
Contributor

@younesbelkada younesbelkada commented Apr 12, 2024

As per title

Before this PR, there was a bug when `models/xxx files where modified because a check for empty arrays on the GitHub action was being bypassed leading to the action being run unexpectedly such as: https://github.com/huggingface/transformers/actions/runs/8688185234 - this PR fixes it

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@younesbelkada younesbelkada marked this pull request as ready for review April 12, 2024 17:14
@younesbelkada
Copy link
Contributor Author

Tested it and it worked on 1a26ff3 and I made sure we still have the previous behaviour 6a527d3 this is ready for review !

@younesbelkada younesbelkada requested a review from ydshieh April 12, 2024 17:14
runs-on: [single-gpu, nvidia-gpu, a10, ci]
container:
image: huggingface/transformers-all-latest-gpu
options: --gpus all --privileged --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
if: ${{ needs.get_modified_models.outputs.matrix != '[]' && needs.get_modified_models.outputs.matrix != '' }}
if: ${{ needs.get_modified_models.outputs.matrix != '[]' && needs.get_modified_models.outputs.matrix != '' && fromJson(needs.get_modified_models.outputs.matrix)[0] != null }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the most efficient condition i could use, simply converting to an array and trying to access to the first element seemed to work

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we always going to be able to safely index on 0 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes i think so , per my understanding if the array is empty fromJson(needs.get_modified_models.outputs.matrix)[0] will give null , so the check fromJson(needs.get_modified_models.outputs.matrix)[0] != null circumvents the case where the array is empty

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great - thanks for confirming!

@younesbelkada younesbelkada changed the title DEBUG: Fix corner-case issue with the important models workflow FIX: Fix corner-case issue with the important models workflow Apr 15, 2024
@amyeroberts
Copy link
Collaborator

@younesbelkada Could you include in the PR description what the corner case is? I can see this is a fix but it's not clear what 's being addressed

@younesbelkada
Copy link
Contributor Author

Thanks @amyeroberts ! Sorry, yes - I just added some description, let me know what do you think - here is also an example of that corner case: https://huggingface.slack.com/archives/C06L2SGMEEA/p1713186513863159

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the info and this fix.

LGTM - just a question on whether we need to protect the indexing at all?

runs-on: [single-gpu, nvidia-gpu, a10, ci]
container:
image: huggingface/transformers-all-latest-gpu
options: --gpus all --privileged --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
if: ${{ needs.get_modified_models.outputs.matrix != '[]' && needs.get_modified_models.outputs.matrix != '' }}
if: ${{ needs.get_modified_models.outputs.matrix != '[]' && needs.get_modified_models.outputs.matrix != '' && fromJson(needs.get_modified_models.outputs.matrix)[0] != null }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we always going to be able to safely index on 0 here?

@younesbelkada
Copy link
Contributor Author

Thanks for the review !
let me know if #30212 (comment) makes sense ! I will let you merge if you agree with the explanation ! 🙏 Thanks again !

@amyeroberts amyeroberts merged commit ddf5f25 into main Apr 16, 2024
8 checks passed
@amyeroberts amyeroberts deleted the younesbelkada-patch-1 branch April 16, 2024 10:15
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worflow is failing eversince this PR

zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request Apr 18, 2024
…gface#30212)

* Update push-important-models.yml

* dummy commit

* Update modeling_bark.py

* test

* test

* test

* another test

* another test

* test

* final test

* final test

* test

* another test

* test

* test

* another test

* test llama

* revert everything

* remove echo
ArthurZucker pushed a commit that referenced this pull request Apr 22, 2024
* Update push-important-models.yml

* dummy commit

* Update modeling_bark.py

* test

* test

* test

* another test

* another test

* test

* final test

* final test

* test

* another test

* test

* test

* another test

* test llama

* revert everything

* remove echo
itazap pushed a commit that referenced this pull request May 14, 2024
* Update push-important-models.yml

* dummy commit

* Update modeling_bark.py

* test

* test

* test

* another test

* another test

* test

* final test

* final test

* test

* another test

* test

* test

* another test

* test llama

* revert everything

* remove echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants