Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inplace message passing #78

Open
bartvanerp opened this issue Feb 28, 2023 · 1 comment
Open

Inplace message passing #78

bartvanerp opened this issue Feb 28, 2023 · 1 comment
Assignees
Labels
Performance Improve code speed

Comments

@bartvanerp
Copy link
Member

Not sure whether it should be mentioned here or in ReactiveMP.jl, but for certain applications it is highly beneficial to support inplace operations (rules, computations, basically everything). In my experiments I am running into the issue where memory consumption roughly blows up with 1GB per second, significantly slowing down the inference speed.
Especially in the rxinference() function, where the same model gets used to process a stream of data it is very important to have these inplace operations to prevent memory from leaking away and to prevent the garbage collection from slowing down the inference speed.

@bartvanerp bartvanerp added enhancement New feature or request Performance Improve code speed and removed enhancement New feature or request labels Feb 28, 2023
@bartvanerp
Copy link
Member Author

Encountered a similar issue today for a generic function and was thinking about the following to retain backwards compatibility

struct FunctionWithMemory{F <: Function, M} <: Function
    f :: F
    memory :: M
end
(f::FunctionWithMemory)(x...) = f.f(x..., f.memory)

There are probably some flaws with this approach, but might be nice as we then do not have to overhaul all rules at once.

@albertpod albertpod assigned albertpod and bartvanerp and unassigned albertpod Jan 11, 2024
@wouterwln wouterwln modified the milestone: RxInfer 3.1.0 release Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Improve code speed
Projects
Status: 🤔 Ideas
Development

No branches or pull requests

3 participants