Skip to content

[llava] Use huggingface LLaVA instead of depending on third-party/LLaVa #4687

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

Merged
merged 12 commits into from
Aug 14, 2024

Conversation

larryliu0820
Copy link
Contributor

@larryliu0820 larryliu0820 commented Aug 13, 2024

Stack from ghstack (oldest at bottom):

Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes third-party/LLaVA, in favor of huggingface llava model
definition.

Differential Revision: D61200610

Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Aug 13, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/4687

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit e6d1553 with merge base 2117c1a (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

larryliu0820 added a commit that referenced this pull request Aug 13, 2024
Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

ghstack-source-id: 08a04f7
Pull Request resolved: #4687
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 13, 2024
…d-party/LLaVa"

Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Aug 13, 2024
Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

ghstack-source-id: fafdedd
Pull Request resolved: #4687
…d-party/LLaVa"

Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Aug 13, 2024
Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

ghstack-source-id: 5fa9c37
Pull Request resolved: #4687
…d-party/LLaVa"

Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Aug 13, 2024
Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

ghstack-source-id: 3c11fa5
Pull Request resolved: #4687
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

…d-party/LLaVa"

Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

Differential Revision: [D61200610](https://our.internmc.facebook.com/intern/diff/D61200610)

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Aug 13, 2024
Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

ghstack-source-id: 93b881f
Pull Request resolved: #4687
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

…d-party/LLaVa"

Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

Differential Revision: [D61200610](https://our.internmc.facebook.com/intern/diff/D61200610)

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Aug 13, 2024
Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

ghstack-source-id: 4714a93
Pull Request resolved: #4687
# Newer transformer (4.38) will give TypeError: LlavaLlamaForCausalLM.forward() got an unexpected keyword argument 'cache_position'
pip install timm==0.6.13
pip install transformers==4.37.2
pip install transformers
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also run
bash ./install_requirements and
bash examples/models/llama2/install_requirements.sh as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think user should call it outside

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, the ./install_requirements makes sense, but at least for the llama2, I don't think its immediately obvious that you have to install the requirements for llama2 in order for llava to work.

Copy link
Contributor

Choose a reason for hiding this comment

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

@larryliu0820 great to me we are moving to the HF model. I think we should have no blocker to clean up all the ad-hoc setup requirements #4320?

@@ -204,28 +204,14 @@ jobs:
conda activate "${CONDA_ENV}"

PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh "cmake"

# install pybind
bash install_requirements.sh --pybind xnnpack

# install Llava requirements
bash examples/models/llama2/install_requirements.sh
bash examples/models/llava/install_requirements.sh

Copy link
Contributor

Choose a reason for hiding this comment

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

why don't we run export_llava.py anymore? looks like test_llava still requires the model to have already been exported?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The last test in test_llava.py exports and tests llava

…d-party/LLaVa"

Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

Differential Revision: [D61200610](https://our.internmc.facebook.com/intern/diff/D61200610)

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Aug 13, 2024
Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

ghstack-source-id: a3e4c25
Pull Request resolved: #4687
…d-party/LLaVa"

Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

Differential Revision: [D61200610](https://our.internmc.facebook.com/intern/diff/D61200610)

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Aug 14, 2024
Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

ghstack-source-id: 432b90e
Pull Request resolved: #4687
…d-party/LLaVa"

Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

Differential Revision: [D61200610](https://our.internmc.facebook.com/intern/diff/D61200610)

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Aug 14, 2024
Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

ghstack-source-id: 61ec08e
Pull Request resolved: #4687
…d-party/LLaVa"

Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

Differential Revision: [D61200610](https://our.internmc.facebook.com/intern/diff/D61200610)

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Aug 14, 2024
Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

ghstack-source-id: 02cc0b1
Pull Request resolved: #4687
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

…d-party/LLaVa"

Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

Differential Revision: [D61200610](https://our.internmc.facebook.com/intern/diff/D61200610)

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Aug 14, 2024
Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

ghstack-source-id: 9fb3fff
Pull Request resolved: #4687
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@larryliu0820 larryliu0820 changed the base branch from gh/larryliu0820/51/base to main August 14, 2024 07:30
…d-party/LLaVa"

Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

Differential Revision: [D61200610](https://our.internmc.facebook.com/intern/diff/D61200610)

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Aug 14, 2024
Currently we depend on third-party/LLaVA for llava model definition.
This is hard to use because we have to pull LLaVA in as a git submodule
and install from there. It also breaks a lot of dependency assumptions.

This PR removes `third-party/LLaVA`, in favor of huggingface llava model
definition.

ghstack-source-id: 0f3f7a1
Pull Request resolved: #4687
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot merged commit 5d151d0 into main Aug 14, 2024
35 of 36 checks passed
kirklandsign pushed a commit to kirklandsign/executorch that referenced this pull request Aug 15, 2024
Differential Revision: D61200610

Pull Request resolved: pytorch#4687
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants