Skip to content

add_mistral_support#196

Merged
Ssukriti merged 7 commits into
mainfrom
add_mistral_support
Apr 29, 2026
Merged

add_mistral_support#196
Ssukriti merged 7 commits into
mainfrom
add_mistral_support

Conversation

@Ssukriti
Copy link
Copy Markdown
Contributor

@Ssukriti Ssukriti commented Apr 28, 2026

This PR adds support for Mistral 3 (TEXT ONLY) to DPP:

Additions in PR:

  1. Since mistral has a different token id, uses mistral tokenizer's pad id. Dependent on FMS PR: 🐛 Fix pad token id resolution in padding function foundation-model-stack#512
  2. Adds tokenizer as an optional argument as we may need to pass Mistral 3.1 tokenizer with 3.2 (due to differences in HF wrapping of 3.2 tokenizer)
  3. Adds a new config for Mistral 3 with default values that match sendnn-inference repo - https://github.com/torch-spyre/sendnn-inference/blob/5ede22854839df4c47ef61df8a092feb55a78010/sendnn_inference/config/model_configs.yaml#L73

How to test:

export VLLM_DT_CHUNK_LEN=1024
export VLLM_DT_MAX_BATCH_SIZE=32
export VLLM_DT_MAX_BATCH_TKV_LIMIT=131072
export VLLM_DT_MAX_CONTEXT_LEN=32768
export DEM_COMPILE_VERSION=1
export DTLOG_LEVEL=error
export DT_DEEPRT_VERBOSE=-1
export DT_OPT=
export ENABLE_FLEX_TIMING=
export EN_PREFILL_OPT=
export FLEX_HDMA_P2PSIZE=268435456
export FLEX_PRINT_END_TO_END_BREAKDOWN=
export FLEX_SCHEDULER_PRINT_RAW_TIMESTAMPS=
export FLEX_SKIP_TIMESTAMP_CALIBRATION=
export HF_HUB_CACHE=/models/huggingface_cache/hub
export HF_HUB_OFFLINE=
export TORCH_SENDNN_CACHE_DIR=/models/pre_compiled
export TORCH_SENDNN_CACHE_ENABLE=1
export AFTU_PAGED_KVCACHE_NUM_BLOCKS_HINT=8192
export PYTHONPATH=/home/senuser/aiu-fms-testing-utils/:$PYTHONPATH
export PYTHONPATH=/home/senuser/foundation-model-stack/:$PYTHONPATH

export MODEL_NAME=/models/mistralai/Mistral-Small-3.2-24B-Instruct-2506/
torchrun --nproc-per-node=4 /home/senuser/aiu-fms-testing-utils/scripts/drive_paged_programs.py \
--tokenizer=mistralai/Mistral-Small-3.1-24B-Instruct-2503 \
--programs=\*:0\,\>=8192 \
--max_new_tokens=32 \
--prefill_chunk_size=1024 \
--model_variant=$MODEL_NAME \
--program_criteria_json_path=/home/senuser/aiu-tests/scripts/program_criteria_new.json \
--dataset_path=/models/long_context_factoid_post_process.jsonl \
--dataset_type=rag_factoid \
--test_type=tokens \
--attention_type=paged \
--distributed \
--prioritize_large_batch_sizes \
--enforce_homogeneous_prompt_programs \
 > mistral_3.2_tokens_updated_PR.txt 2>&1 &

output:

[ 0/ 4]: CPU tokens:
[6833, 10592, 1710, 16106, 1402, 2434, 1294, 11482, 1046, 1656, 1278, 5315, 1307, 30983, 4666, 1044, 1261, 6833, 5211, 2481, 1402, 6493, 1435, 4433, 1455, 1486, 6254, 5250, 3184, 1278, 2142, 4279]
[ 0/ 4]: AIU tokens:
[32475, 10592, 1710, 16106, 1402, 2434, 1294, 11482, 1046, 1656, 30983, 4666, 1044, 6833, 10592, 4626, 4618, 25483, 2516, 1435, 47395, 1044, 11733, 1044, 48640, 1044, 1321, 61579, 8360, 1536, 1278, 11314]
[ 0/ 4]: CPU output:
 primary sources can indeed be used in literature. In the context of literary studies, a primary source could be defined as something that was created either during the time period
[ 0/ 4]: AIU output:
Primary sources can indeed be used in literature. In literary studies, primary sources include original texts such as novels, plays, poems, and essays written by the authors

Output matched CPU for few programs tested

Side Note:
Granite3-8b behavior is retained and tested with a simple tokens test

Signed-off-by: Sukriti-Sharma4 <sukriti.sharma4@ibm.com>
@Ssukriti Ssukriti changed the title add_pad_ids add_mistral_support Apr 28, 2026
Signed-off-by: Sukriti-Sharma4 <sukriti.sharma4@ibm.com>
Signed-off-by: Sukriti-Sharma4 <sukriti.sharma4@ibm.com>
Signed-off-by: Sukriti-Sharma4 <sukriti.sharma4@ibm.com>
Signed-off-by: Sukriti-Sharma4 <sukriti.sharma4@ibm.com>
@Ssukriti Ssukriti marked this pull request as ready for review April 29, 2026 14:15
@Ssukriti Ssukriti requested review from gkumbhat April 29, 2026 14:15
Signed-off-by: Sukriti-Sharma4 <sukriti.sharma4@ibm.com>
Comment thread aiu_fms_testing_utils/utils/__init__.py
Comment thread aiu_fms_testing_utils/utils/dpp_config.py Outdated
Signed-off-by: Sukriti-Sharma4 <sukriti.sharma4@ibm.com>
Copy link
Copy Markdown
Collaborator

@gkumbhat gkumbhat left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks so much for adding Ministral support

@Ssukriti Ssukriti merged commit 3e748c5 into main Apr 29, 2026
3 checks passed
@Ssukriti Ssukriti deleted the add_mistral_support branch April 29, 2026 17:22
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.

2 participants