Comments (3)
Thank you for reaching out about using Neuron for LLaVa.
We recommend that you enable this model using neuronx-distributed (NxD). NxD is PyTorch based library intended to provide developers with the ability to enable model parallelism/sharding techniques themselves. In order to apply tensor parallelism to a model, the weights and compute must be split across NeuronCores. Intermediary calculations are synchronized across NeuronCores using collective operations. Typically this is done by applying different parallel layers to each portion of the network in the form of RowParallelLinear, ColumnParallelLinear and other layers (See: Parallel Layers Documentation):
Please check the Llama example inference model for a reference on applying tensor parallelism to a model using NxD. You are welcome to submit a PR with your contribution when you implement the model.
from transformers-neuronx.
Hi @hannanjgaws
Thanks for the response 👍 just a few comments:
Seems that the llava model is a combination of a LLMmodel + visual model + intermediate module (like any of these models).
In the case of llava-1.6-mistral-* as it name says, it uses mistral model, and seeing the implementation and the config, it also uses "clip_model" for the vision encoder part.
So a pair of questions:
-
The approach to compile it, for Inf2 instances, should be to replace the inner layers with the corresponding parrallel layers before doing a trace with a sample input, is'nt it?
-
After it compiled, when loading the .pt file, should I use
model.load_state_dict(hf_model_state_dict)
to load the weights isn't it?
Another interesting approach could be to have the "clip_model" model in transformers-neuronx and to load it in conjuntion of https://github.com/aws-neuron/transformers-neuronx/tree/main/src/transformers_neuronx/mistral + the intermediate module
from transformers-neuronx.
Hi, I would like to follow-up on this, do we have any pointers on how to compile and inference multi-modal like this on Inf2?
from transformers-neuronx.
Related Issues (20)
- How to use generate() with inputs_embeds HOT 2
- Mixtral config issue -- not handling null well HOT 8
- Generate Llama 2 from Embeddings HOT 5
- Infering logits from `model.forward` for the entire batch instead of the last forward's output. HOT 6
- Support for MPT model HOT 1
- `stopping_criteria_list(input_ids, probs)` does not check for the correct sequence. HOT 4
- User feedback when compiling and reloading a large model HOT 1
- Issue while compiling Mistral 7B 0.2 Instruct HOT 5
- Backward compatibility with saved llama 2 compiled artifacts HOT 1
- NaN outputs when masking llama model inputs HOT 8
- Improve Neuron model loading time HOT 4
- Add support for `gemma` models HOT 1
- Add support for Baichuan-13B model
- Latest changes introduced for continuous batching break Mixtral model HOT 5
- Any plan to support Qwen-2 Model
- Neuron model NEFFs are dependent on the python path HOT 2
- Not able to load llama 3 70b on inf2.24xlarge instance HOT 6
- Gibberish output for princeton-nlp/Sheared-LLaMA-1.3B with continuous batching HOT 2
- [Question] BasicTransformerBlock
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transformers-neuronx.