GithubHelp home page GithubHelp logo

Comments (3)

mratsim avatar mratsim commented on May 20, 2024

Alternatively if we can replace hae steal request as pointers (#7), we could use a set instead of a bitset.

The following is probably the most efficient set datastructure found bounded sets that needs fast random picking and has been used for Montecarlo Tree Search: https://github.com/mratsim/golem-prime/blob/09a81ebf9f4c0789e830f391cdfde1e796ea0765/src/datatypes.nim#L106-L119 and https://github.com/mratsim/golem-prime/blob/09a81ebf9f4c0789e830f391cdfde1e796ea0765/src/core/c_empty_points.nim

  • An array of indices
  • An array of values
  • A length

The array of values + len can be appended to and values can be deleted in any order (we replace the deleted value with the last value to keep it constant time we don't copy everything). The array of indices will map the "real" index to the actual index in the array of values.

This trades speed of space.

Bitset of 256 victims would require 32 bytes, such an array would require at the minimum 2x uint8 + length so 513 bytes. This requires steal request as pointers as otherwise this will have a huge impact on the size of the MPSC channels, the size required would grow by 481 bytes * numWorkers * numWorkers (as each channel needs to be sized for numWorkers steal requests, and each workers has its own)

from weave.

mratsim avatar mratsim commented on May 20, 2024

3 interesting approaches for a compressed bitset random victim selection:

Uncompressing will cause stack overflow with high core counts
The bithack require quite a lot of instructions even though it benefits from instruction level parallelism.

from weave.

mratsim avatar mratsim commented on May 20, 2024

closed by #15

from weave.

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.