Git Product home page Git Product logo

Comments (8)

nikomatsakis avatar nikomatsakis commented on July 16, 2024 1

@cuviper well-- consistency is a lot to ask =)

In any case, I feel all right about just requiring associativity.

from rayon.

cuviper avatar cuviper commented on July 16, 2024

I don't know if it's promised, but the current implementation should actually preserve order in the reductions, just with associative differences as you note. This is a natural implication of the way the jobs are split recursively and then joined as it returns.

from rayon.

nikomatsakis avatar nikomatsakis commented on July 16, 2024

I believe that in https://github.com/nikomatsakis/rayon/pull/120 I went ahead and promised that the order would be deterministic when doing reduce or fold.

from rayon.

cuviper avatar cuviper commented on July 16, 2024

Hmm, the new reduce says just associative, but reduce_with still says commutative too. Then sum, mul, min, and max all mention commutative operators.

from rayon.

mathstuf avatar mathstuf commented on July 16, 2024

Are there tests for just-associative reduction functions (String::push?) already?

from rayon.

cuviper avatar cuviper commented on July 16, 2024

Using collect into any of the ordered collections will exercise associative non-commutative reduce. Look at their FromParallelIterator implementations.

Any further question about this? Otherwise, I think we can close this issue.

from rayon.

mathstuf avatar mathstuf commented on July 16, 2024

Yeah, the issue can likely be closed. I was more wondering whether there were tests to this effect rather than "well, the implementation works that way".

from rayon.

cuviper avatar cuviper commented on July 16, 2024

Ok, I don't think we have any plain mathematical tests of this, but all of the collection and string stuff mandates that it works this way. Also, find_first et al. would make no sense if we didn't maintain order.

from rayon.

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.