Add TKG-optimized contribs for 4 dense Mistral models#132
Open
jimburtoft wants to merge 1 commit intoaws-neuron:mainfrom
Open
Add TKG-optimized contribs for 4 dense Mistral models#132jimburtoft wants to merge 1 commit intoaws-neuron:mainfrom
jimburtoft wants to merge 1 commit intoaws-neuron:mainfrom
Conversation
Add NKI TKG fused attention kernel optimization for the Mistral dense model family, achieving 6-29% throughput improvement over baseline: - Mistral-7B-Instruct-v0.3: 115 tok/s (+19%), multi-KV TKG kernel - Ministral-8B-Instruct-2410: 99 tok/s (+21-29%), multi-KV TKG + config fix - Ministral-3-3B-Instruct-2512-BF16: 158 tok/s (+18-27%), fastest in family - Mistral-Small-3.1-24B-Instruct-2503: 48 tok/s (+6-14%), stock TKG kernel Each model directory is self-contained with setup scripts, TKG kernel files, NKI 0.3.0 compatibility fixes, and integration tests. Models using the Llama path (3B, 24B) include text extraction from multimodal checkpoints. All models are cost-competitive with GPU at spot pricing. Tested on SDK 2.29 (DLAMI 20260410), vLLM 0.16.0, trn2.3xlarge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Models
Key Technical Details
TKG kernel: Fused attention NKI kernel derived from Leanstral (Ministral-3-14B contrib). Two variants:
Limitations:
max_num_seqs=1(BIR verification failure at BS>1 on neuronx-cc 2.24)--no-enable-prefix-cachingrequired (block KV cache corruption)Files Changed
Mistral-7B-Instruct-v0.3/(10 files)Ministral-8B-Instruct-2410/(12 files, includes patch_config.py)Ministral-3-3B-Instruct-2512-BF16/(11 files, includes extract_text_model.py)Mistral-Small-3.1-24B-Instruct-2503/(8 new files + README update, includes extract_text_model.py)