-
Notifications
You must be signed in to change notification settings - Fork 1.6k
test: L0_orca_trtllm fixed #8191
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ MODEL_NAME="gpt2_tensorrt_llm" | |
NAME="tensorrt_llm_benchmarking_test" | ||
MODEL_REPOSITORY="$(pwd)/triton_model_repo" | ||
TENSORRTLLM_BACKEND_DIR="/workspace/tensorrtllm_backend" | ||
GPT_DIR="$TENSORRTLLM_BACKEND_DIR/tensorrt_llm/examples/gpt" | ||
GPT_DIR="$TENSORRTLLM_BACKEND_DIR/tensorrt_llm/examples/models/core/gpt" | ||
TOKENIZER_DIR="$GPT_DIR/gpt2" | ||
ENGINES_DIR="${BASE_DIR}/engines/inflight_batcher_llm/${NUM_GPUS}-gpu" | ||
TRITON_DIR=${TRITON_DIR:="/opt/tritonserver"} | ||
|
@@ -48,6 +48,13 @@ CLIENT_PY=${BASE_DIR}/orca_http_test.py | |
CLIENT_LOG="${NAME}_orca_http_test.log" | ||
source ../common/util.sh | ||
|
||
function replace_config_tags { | ||
tag_to_replace="${1}" | ||
new_value="${2}" | ||
config_file_path="${3}" | ||
sed -i "s|${tag_to_replace}|${new_value}|g" ${config_file_path} | ||
} | ||
|
||
function prepare_model_repository { | ||
rm -rf ${MODEL_REPOSITORY} && mkdir ${MODEL_REPOSITORY} | ||
cp -r ${TENSORRTLLM_BACKEND_DIR}/all_models/inflight_batcher_llm/* ${MODEL_REPOSITORY} | ||
|
@@ -138,6 +145,42 @@ function kill_server { | |
done | ||
} | ||
|
||
function clone_tensorrt_llm_backend_repo { | ||
rm -rf $TENSORRTLLM_BACKEND_DIR && mkdir $TENSORRTLLM_BACKEND_DIR | ||
apt-get update && apt-get install git-lfs -y --no-install-recommends | ||
git clone --single-branch --depth=1 -b ${TENSORRTLLM_BACKEND_REPO_TAG} ${TRITON_REPO_ORG}/tensorrtllm_backend.git $TENSORRTLLM_BACKEND_DIR | ||
cd $TENSORRTLLM_BACKEND_DIR && git lfs install && git submodule update --init --recursive | ||
} | ||
|
||
function build_gpt2_base_model { | ||
# Download weights from HuggingFace Transformers | ||
cd ${GPT_DIR} && rm -rf gpt2 && git clone https://huggingface.co/gpt2-medium gpt2 && cd gpt2 | ||
rm pytorch_model.bin model.safetensors | ||
if ! wget -q https://huggingface.co/gpt2-medium/resolve/main/pytorch_model.bin; then | ||
echo "Downloading pytorch_model.bin failed." | ||
exit 1 | ||
fi | ||
cd ${GPT_DIR} | ||
|
||
# Convert weights from HF Tranformers to FT format | ||
python3 convert_checkpoint.py --model_dir gpt2 --dtype float16 --tp_size ${NUM_GPUS} --output_dir "./c-model/gpt2/${NUM_GPUS}-gpu/" | ||
cd ${BASE_DIR} | ||
} | ||
|
||
function build_gpt2_tensorrt_engine { | ||
# Build TensorRT engines | ||
cd ${GPT_DIR} | ||
trtllm-build --checkpoint_dir "./c-model/gpt2/${NUM_GPUS}-gpu/" \ | ||
--gpt_attention_plugin float16 \ | ||
--remove_input_padding enable \ | ||
--paged_kv_cache enable \ | ||
--gemm_plugin float16 \ | ||
--workers "${NUM_GPUS}" \ | ||
--output_dir "${ENGINES_DIR}" | ||
|
||
cd ${BASE_DIR} | ||
} | ||
|
||
clone_tensorrt_llm_backend_repo | ||
build_gpt2_base_model | ||
build_gpt2_tensorrt_engine | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How did this call to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried finding an answer to this, but was unable to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Do we do a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe because there is no |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the previous PR, I suggested moving these functions to
qa/common/util.sh
but somehow they were deleted instead of moved.#8009 (comment)