Coder Social home page Coder Social logo

Comments (8)

chenqy4933 avatar chenqy4933 commented on June 24, 2024

Can you show the trace result? or you can comment the thread::yield() function, and trace again

from inferllm.

xhebox avatar xhebox commented on June 24, 2024

Can you show the trace result? or you can comment the thread::yield() function, and trace again

Later. I've modified the base code a lot. It is like so:

main      | add_task                                         | add_task
thread1 | matmul_int8 
thread2 | ................. matmul_int8 ( this is problematic part, if it can start much earlier, the total time will be reduced a lot)
...
threadx | ..matmul_int8 

from inferllm.

chenqy4933 avatar chenqy4933 commented on June 24, 2024

It seems when dispatching a task, not all threads will be scheduled right now, some threads yield out. if so, comment the thread::yield and test again, it should be faster, but I test with the same result.

from inferllm.

xhebox avatar xhebox commented on June 24, 2024

It seems when dispatching a task, not all threads will be scheduled right now, some threads yield out. if so, comment the thread::yield and test again, it should be faster, but I test with the same result.

It could be an advantage of x64 processors. I mean these processors may be more responsive anyway.

And yes, removing yield works. But not always. It makes processors too busy on atomic operations sometimes. Racing will slow down the whole system. I am still experimenting on how to make the loop better.

I've got a pretty good result so far. With some other new optimizations, I got 5token/s.

from inferllm.

chenqy4933 avatar chenqy4933 commented on June 24, 2024

great !!!, Looking forward to your optimizations

from inferllm.

xhebox avatar xhebox commented on June 24, 2024

great !!!, Looking forward to your optimizations

#62

Check out this demo. Add ZoneScopedNS() in the lambda function of matmul will give you the trace result.

from inferllm.

xhebox avatar xhebox commented on June 24, 2024

@chenqy4933 Got 4.4 tokens with the master. I guess the optimization works. Though I did not get as high as 5 token/s.

from inferllm.

chenqy4933 avatar chenqy4933 commented on June 24, 2024

@chenqy4933 Got 4.4 tokens with the master. I guess the optimization works. Though I did not get as high as 5 token/s.

you can optimize it continue, I just optimized it with the CPU level yield.

from inferllm.

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.