Giter Club home page Giter Club logo

Comments (4)

MattiSG avatar MattiSG commented on May 30, 2024

Thanks @nikhilwoodruff for having taken the time to formalise this!

Since this is performance optimisation, may I suggest to first run a performance analysis? It is often hard to measure precisely the performance impact of a specific implementation and optimisations, especially in the context of vectorial computing πŸ™‚
Lacking specific rules for such cases, I would personally ask for a clear measurement of expected gains before supporting addition of such a feature in Core. You can see an example of such a demonstration in openfisca/openfisca-core#1027.

Currently, I do not know of major needs for performance optimisation internationally on the computing side β€”more on the memory side. If this need is specific to the case of the US and its 50 states (logically leading to distribute 2% of cases in the disjunction), maybe the creation of a helper wrapping systematic calls to where(), or leveraging extensions could help? I know New South Wales went for an architecture with strong splitting through extensions, this might of inspiration πŸ™‚

cc @benjello @maukoquiroga @liamdmccann

from openfisca-tools.

benjello avatar benjello commented on May 30, 2024

@nikhilwoodruff :

  • Disclaimer: I did not read your implementation in the PR
  • I don't think that casting the formula to a smaller population size will increase your speed performance
  • I recognize that there is a real memory problem. You can somehow make it less important by populating the cache_blacklist of the simulation by intermediate variables that are computed only once.
  • The real solution to this problem is IMHO (and you may already have heard that from me) to have relational / correspondence links between entities. In this case, you would have MA resident as a separate entity with its own variables (ma_tax) with a one2one relation to the larger US resident entity with US wide generic variables (wage, residence). I actually see this need as a recurrent one (linking firms to employees, employee to retirement schemes and so on).

cc @eraviart

from openfisca-tools.

nikhilwoodruff avatar nikhilwoodruff commented on May 30, 2024

Thanks both for these contributions!

@MattiSG - yes, I'll add a performance analysis. In the US case I'm guessing this roughly equates to a 50x speedup for each affected variable. As for extensions, I think they might not work for our use case, because we might want to see for example how a change to federal tax law affects total state tax liability, in which case we'd need all the individual state variables to run together.

@benjello -

I don't think that casting the formula to a smaller population size will increase your speed performance

Could you elaborate? My thinking is that since the array sizes are smaller, and NumPy does interate over them at some low level, it'll be quicker.

You can somehow make it less important by populating the cache_blacklist of the simulation by intermediate variables that are computed only once.

Nice, thanks for this tip. Will keep it in mind here.

The real solution to this problem is IMHO (and you may already have heard that from me) to have relational / correspondence links between entities.

Yes, really like this idea and this would be a great feature to add to Core, IMO.

from openfisca-tools.

benjello avatar benjello commented on May 30, 2024

@nikhilwoodruff :

I don't think that casting the formula to a smaller population size will increase your speed performance

Could you elaborate? My thinking is that since the array sizes are smaller, and NumPy does interate over them at some low level, it'll be quicker.

NumPy uses the vector capabilities of modern mathematical processors. Modulo that data can be handled by RAM the speed of the computation does not depend much on vector size.

from openfisca-tools.

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.