Giter Site home page Giter Site logo

Comments (3)

paulstey avatar paulstey commented on September 28, 2024 1

Thanks so much for your help, @Andlon!

Your intuition is correct, this seems to be a stack overflow. The output below is what I get with RUST_BACKTRACE=1. And yes, you're also correct that I get the same result when using repeat() rather than new_random().

I will use DMatrix as you suggest. Thanks again for your help, @Andlon! And thanks also for this phenomenal crate!!


thread 'main' has overflowed its stack
fatal runtime error: stack overflow
Aborted

from nalgebra.

paulstey avatar paulstey commented on September 28, 2024

Oh, and here is my Cargo.toml file.

[package]
name = "nalgebra_mat_mul"
version = "0.1.0"
edition = "2021"

[dependencies]
nalgebra = { version = "0.32.2", features = ["rand"] }

from nalgebra.

Andlon avatar Andlon commented on September 28, 2024

Judging from your example, this is probably a stack overflow. Can you give the output with debug symbols turned on? It would be great to confirm. If that's the case, you'd probably get the same problem if you don't use get_random but instead just Matrix::repeat(2.0) (avoiding 0.0 since compilers/allocators etc. sometimes go alternate routes for zeroed memory).

A 512x512 f64 matrix requires 16 MB stack space, which is likely larger than the stack size your OS uses by default.

For such large matrices, there are usually no benefits to storing them on the stack. I'd recommend to use DMatrix instead, if you can.

from nalgebra.

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.