Giter Site home page Giter Site logo

Comments (3)

mhonert avatar mhonert commented on May 25, 2024

Hi, thanks for the hint!

In the build pipeline I still use Rust 1.58.1, because newer versions are affected by some performance regressions.
I did not yet have the time for further investigations, but perhaps the increased stack usage is also caused by some code optimization regression. In 1.58.1 the superfluous stack allocation gets optimized away and the allocation is done directly on the heap.

If you would like to compile the engine locally, I would recommend to use Rust 1.58.1 for now.
Using the Rust toolchain installer (rustup), you could run rustup override set 1.58.1 from inside the source folder. That way the old version is only used for that source folder.

from velvet-chess.

mhonert avatar mhonert commented on May 25, 2024

Today I investigated the issue a bit more. Starting with Rust 1.59.0, the unnecessary stack allocation does not get optimized away anymore. As a workaround I boxed each individual field of the NeuralNetParams struct, instead of the whole struct. This seemed to help the compiler/optimizer and now the struct instance is created directly on the heap again and the stack does not overflow anymore.

I could also mitigate some of the performance regressions by explicitly marking certain functions to be always inlined, but unfortunately binaries compiled with 1.63.0 are still around 8% slower than the ones produced by 1.58.1.

from velvet-chess.

AndyGrant avatar AndyGrant commented on May 25, 2024

Thanks. I will set Velvet to use 1.58.1 for the time being, and I'll check newer versions every so often for CCC. Can always reach out to me via email ([email protected]), or on Discord.

from velvet-chess.

Related Issues (5)

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.