Enable intfloat/e5-mistral-7b-instruct model with 32k token lens on hpu device #2715
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR belongs to one of enabling Intel's Gaudi2 GPU supported tasks for Sentence Transformer's inference/training
This PR enables intfloat/e5-mistral-7b-instruct model with 32k token lens input on hpu device and it is the revision of PR#2656.
There are two parts for updates -
Efficient new padding for bigger token lens input by using multiple of 128 instead of original power of 2 to reduce the padding overhead when the input token lens is bigger which is not efficient for power of 2.
Bring in the 7b mistral 32k token lens support with hpu device by using the specific arguments in high level encode arguments which is not hard coded as previous PR.
The usage example for 7b mistral with 32k token lens will be -
hpu_kwargs = {"attn_softmax_bf16": True, "reuse_cache": True, "use_flash_attention":True,"flash_attention_recompute": True,"flash_attention_causal_mask": True, }
emb = model.encode(sentences, batch_size=32, kwargs={"hpu_kwargs" : hpu_kwargs})
any questions please comments.
thanks.