Giter Club home page Giter Club logo

Comments (4)

dosubot avatar dosubot commented on June 12, 2024 3

To address the issue of your model inference getting stuck, especially with longer prompts, consider implementing the following optimizations and strategies:

  1. PagedAttention: This method reduces memory waste by dividing the KV cache into blocks for efficient retrieval during attention computation. It's particularly effective in managing the large memory footprint associated with KV caches.

  2. Efficient Memory Sharing with PagedAttention: By sharing blocks among sequences through a block table, this approach can significantly reduce memory overhead, leading to improved throughput.

  3. Optimize CUDA Kernels and Implement Continuous Batching: Focus on CUDA kernel optimizations and use continuous batching to improve GPU utilization by dynamically inserting new sequences into the batch based on resource availability.

  4. FlashAttention for Attention Mechanism Optimization: FlashAttention optimizes the attention mechanism by introducing tiling and recomputation strategies, reducing the need for large intermediate attention matrices and speeding up the computation.

  5. Dynamic and Inflight Batching for Scheduling Optimization: Use dynamic batching and inflight batching to refine scheduling and improve GPU resource utilization by addressing "bubbles" during inference.

  6. Memory Management in Conversation History: Ensure the conversation history buffer does not exceed a predefined maximum token limit to prevent memory overflow issues.

  7. GPU Memory Usage Management: Manage GPU memory usage through parameters such as gpu_memory_utilization, swap_space, max_num_batched_tokens, and max_num_seqs to control memory allocation during inference.

These strategies are derived from practices in managing large model inference processes and should be adjusted based on your specific setup and requirements. If the problem persists, profiling the memory usage during inference might help identify any bottlenecks or areas of excessive memory use.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

from langchain-chatchat.

Hanscang avatar Hanscang commented on June 12, 2024 1

我在微调b6的时候也遇到了这个问题,是模型出现了复读现象,可以使用stream_chat看下是不是在正常输出。GPU占用率没有掉下去就没有卡死,只是复读造成生成的文本过长,在等待生成完成

from langchain-chatchat.

zRzRzRzRzRzRzR avatar zRzRzRzRzRzRzR commented on June 12, 2024

估计显卡没有用到,你检查显卡推理吧,另外这个模型应该有问题,不建议调这个

from langchain-chatchat.

dazzlingCn avatar dazzlingCn commented on June 12, 2024

估计显卡没有用到,你检查显卡推理吧,另外这个模型应该有问题,不建议调这个

显卡用到了,显存占用着呢,这个模型有什么问题啊,可以说说吗

from langchain-chatchat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.