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

Allocations on compile are ever-increasing #319

Open
mofeing opened this issue Dec 1, 2024 · 0 comments
Open

Allocations on compile are ever-increasing #319

mofeing opened this issue Dec 1, 2024 · 0 comments

Comments

@mofeing
Copy link
Collaborator

mofeing commented Dec 1, 2024

Recently I found this strange behavior

julia> @btime Reactant.with_debug() do
           @jit Ops.abs(x)
       end
  37.419 ms (147556 allocations: 6.07 MiB)
2-element ConcreteRArray{Int64, 1}:
 1
 1

julia> @btime @jit Ops.abs(x)
  58.990 ms (297529 allocations: 12.08 MiB)
2-element ConcreteRArray{Int64, 1}:
 1
 1

julia> @btime @jit Ops.abs(x)
  74.636 ms (411819 allocations: 16.63 MiB)
2-element ConcreteRArray{Int64, 1}:
 1
 1

julia> @btime Reactant.with_debug() do
           @jit Ops.abs(x)
       end
  86.295 ms (505732 allocations: 20.37 MiB)
2-element ConcreteRArray{Int64, 1}:
 1
 1

julia> @btime Reactant.with_debug() do
           @jit Ops.abs(x)
       end
  97.753 ms (586540 allocations: 23.59 MiB)
2-element ConcreteRArray{Int64, 1}:
 1
 1

julia> @btime Reactant.with_debug() do
           @compile Ops.abs(x)
       end
  100.258 ms (652550 allocations: 26.15 MiB)

ulia> @btime @compile Ops.abs(x)
  111.832 ms (721709 allocations: 28.93 MiB)
Reactant.Compiler.Thunk{Symbol("##abs_reactant#83526")}()

Why are allocations (and time, but this looks like a consequence) ever increasing on each call to compile? For sure we are not freeing the previously compiled functions who live in the Thunks but that shouldn't affect?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant