Optimizing LLM Latency
hamel.dev
hamel.dev
Thus if there is a delay, you still get the stream of text coming at a steady rate, but you may have to backtrack and correct for mispredictions.
Also noticed that mlc+Vulkan has near zero CPU use while Llama+opencl on gpu still end up with a fair bit of cpu use. So seems to be taking a fundamentally different route
This was on a rock chip 3588 so not exactly conventional AI hardware
They both need to fix their batch inference and it'll be more competitive. They are though.
Using --tensor-parallel-size 2 since I have 2 GPUs on my machine.
Running my llama2 13b finetune for summarization and knowledge graph tasks: https://huggingface.co/Tostino/Inkbot-13B-8k-0.2
Edit: I suppose I actually haven't documented my prompt template usage with the OpenAI API endpoint...
There are some special roles that will enable some extra features with this model. Using Langchain (but works with OpenAI API directly):
ChatMessagePromptTemplate.from_template(role='meta-task_name', template='summary')
ChatMessagePromptTemplate.from_template(role='meta-current_date', template=datetime.now().strftime('%Y-%m-%d'))
ChatMessagePromptTemplate.from_template(role='system', template='You are a helpful assistant...')
ChatMessagePromptTemplate.from_template(role="user_context", template="Some long document that you want summarized...")
ChatMessagePromptTemplate.from_template(role="human", template="Please create a summary of the document")
ChatMessagePromptTemplate.from_template(role="ai", template="Okay, first let's gather some key information about the document:")
The last "ai" message is optional. The endpoint will complete this message if you include it. You could just not include this and the model will start the response however it wants.