Repository navigation
Closed
Description
System Info
x86
8x h100 80g
v0.8.0
Who can help?
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
python convert_checkpoint.py --model_dir /mnt/nfsfast/codellama-70b\
--output_dir /mnt/nfsfast/models-0.8.0/codellama-70b-base \
--dtype bfloat16 \
--rotary_base 1000000 \
--vocab_size 32016 \
--tp_size 8 \
--use_parallel_embedding
trtllm-build --checkpoint_dir /mnt/nfsfast/models-0.8.0/codellama-70b
--output_dir /mnt/nfsfast/models-0.8.0/trt_engines/codellama-70b/8-gpu/
--gemm_plugin bfloat16
--max_input_len 13848
--max_output_len 2536
--max_batch_size 32
--workers 8
--remove_input_padding enable
--gpt_attention_plugin bfloat16
--context_fmha enable
--paged_kv_cache enable
--multi_block_mode enable
--use_custom_all_reduce enable
--bert_attention_plugin disable
--enable_xqa enable
I then use triton to serve the model and send a few inferences
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 mpirun -n 8 --allow-run-as-root /opt/tritonserver/bin/tritonserver --model-repository=...
it seems to work for a few inferences, especially when there's only 1-2 at a time. But after a few inferences, or if we send 4 at a time, it doesn't work.
Expected behavior
it runs successfully and does not crash for batch sizes up to 32!
actual behavior
It crashes with an XQA error after a few inferences
additional notes
.
Activity
phind-justin commentedon Mar 8, 2024
I was looking into the XQA prepare and dispatch functions here https://github.com/NVIDIA/TensorRT-LLM/blob/main/cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQARunner.h#L185
it seems like the
mPrepareCalledcould be subject to a race condition, however I'm sure you have more context on the synchonization conditions than me. I can't tell what other mechanisms are in place to make mPrepareCalled thread-safemichaelroyzen commentedon Mar 11, 2024
@jdemouth-nvidia @byshiue @ncomly-nvidia @nekorobov This is a major issue impeding out ability to make progress on serving our models more efficiently. Do you have any updates on when XQA will actually be working? Thanks!
ming-wei commentedon Mar 12, 2024
DecoderXQRRunner::prepare()is effectively a no-op, becauseDecoderXQARunner::prepareForRun()calls intoDecoderXQAImplPrecompiled::prepare(), which has an empty function body.I will create a MR to remove the mPreparedCalled check for now.
juney-nvidia commentedon Mar 12, 2024
Thanks @ming-wei.
To clarify, the fix from Ming is being reviewed in our internal repo, and hopefully it will be part of the next Tuesday's github main branch update.
June
phind-justin commentedon Mar 12, 2024
Thanks @ming-wei and @juney-nvidia
Since it is a no-op, I tried uncommenting the lines below and rebuilt 0.8.0 from source
in
tensorrt_llm/cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQARunner.hThe model (codellama70b xqa as compiled above ^) seems to run and serve requests! However now there are repeats in the output.
Here are samples of outputs given
phind-justin commentedon Mar 12, 2024
To clarify I used the instructions here: https://github.com/triton-inference-server/tensorrtllm_backend
Even with only 4 concurrent requests and
repetition_penalty=1.1here are the outputs.phind-justin commentedon Mar 19, 2024
This is resolved - it looks like adding strongly typed and removing multiblock mode worked.