Skip to content

[Env] Add XFT_ENGINE env variable. #231

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 6 commits into from
Feb 21, 2024

Conversation

changqi1
Copy link
Contributor

@changqi1 changqi1 commented Feb 21, 2024

There are 2 methods to assign GPU cards to map into MPI processes.

Method 1) Assign Sequentially(XFT_ENGINE=GPU), like MPI process 0 maps to GPU card 0, MPI process 1 maps to GPU card 1...

XFT_ENGINE=GPU XFT_PIPELINE_STAGE=1 OMP_NUM_THREADS=12 ENABLE_CAT_MLP=1 mpirun \
    -n 1 numactl --all -C 48-59 -m 1 ./example --model /data/qwen-1_8b-xft/ --token /data/qwen-1_8b-hf/tokenizer_config.json --dtype fp16 --loop 1 --input_len 16 --output_len 16 : \
    -n 1 numactl --all -C 60-71 -m 1 ./example --model /data/qwen-1_8b-xft/ --token /data/qwen-1_8b-hf/tokenizer_config.json --dtype fp16 --loop 1 --input_len 16 --output_len 16 : \
    -n 1 numactl --all -C 72-83 -m 1 ./example --model /data/qwen-1_8b-xft/ --token /data/qwen-1_8b-hf/tokenizer_config.json --dtype fp16 --loop 1 --input_len 16 --output_len 16 : \
    -n 1 numactl --all -C 84-95 -m 1 ./example --model /data/qwen-1_8b-xft/ --token /data/qwen-1_8b-hf/tokenizer_config.json --dtype fp16 --loop 1 --input_len 16 --output_len 16

Method 2) Assign through the user define(-env XFT_ENGINE=GPU:<N>):

XFT_PIPELINE_STAGE=1 OMP_NUM_THREADS=12 ENABLE_CAT_MLP=1 mpirun \
    -n 1 -env XFT_ENGINE=GPU:0 numactl --all -C 48-59 -m 1 ./example --model /data/qwen-1_8b-xft/ --token /data/qwen-1_8b-hf/tokenizer_config.json --dtype fp16 --loop 1 --input_len 16 --output_len 16 : \
    -n 1 -env XFT_ENGINE=GPU:1 numactl --all -C 60-71 -m 1 ./example --model /data/qwen-1_8b-xft/ --token /data/qwen-1_8b-hf/tokenizer_config.json --dtype fp16 --loop 1 --input_len 16 --output_len 16 : \
    -n 1 -env XFT_ENGINE=GPU:2 numactl --all -C 72-83 -m 1 ./example --model /data/qwen-1_8b-xft/ --token /data/qwen-1_8b-hf/tokenizer_config.json --dtype fp16 --loop 1 --input_len 16 --output_len 16 : \
    -n 1 -env XFT_ENGINE=GPU:3 numactl --all -C 84-95 -m 1 ./example --model /data/qwen-1_8b-xft/ --token /data/qwen-1_8b-hf/tokenizer_config.json --dtype fp16 --loop 1 --input_len 16 --output_len 16

@changqi1 changqi1 merged commit d676a9c into intel:main Feb 21, 2024
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