Skip to content

Allocations and time on compile are ever-increasing #319

@mofeing

Description

@mofeing

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions