Skip to content

Garbage Collection Segfaults on 1.11 from Enzyme + SymbolicRegression #56735

Open
@MilesCranmer

Description

With the following environment:

using Pkg

Pkg.activate(temp=true)
Pkg.add([
    PackageSpec(name="SymbolicRegression", version=v"1.0.3"),
    PackageSpec(name="Enzyme", rev="3ad827f69299299b92a1448f52dd746a65eb5db7"),
    PackageSpec(name="MLJBase", version=v"1.7.0"),
])

The following code segfaults on 1.11.1. However, it works fine on 1.10.7.

using SymbolicRegression, Enzyme, MLJBase

X = randn(Float64, 32, 2)
y = randn(Float64, 32)

model = SRRegressor(;
    binary_operators=[+, *, /, -],
    unary_operators=[cos, exp],
    autodiff_backend=:Enzyme,
    niterations=1000, # Larger because the segfault is stochastic
);

mach = machine(model, X, y)
fit!(mach)

The error message on 1.11.1 is:

[98721] signal 11 (2): Segmentation fault: 11 in expression starting at REPL[23]
gc_mark_obj8 at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-R17H3W25T9.0/build/default-honeycrisp-R17H3W25T9-0/julialang/julia-release-1-dot-11/src/gc.c:0 [inlined]
gc_mark_outrefs at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-R17H3W25T9.0/build/default-honeycrisp-R17H3W25T9-0/julialang/julia-release-1-dot-11/src/gc.c:2888 [inlined]
gc_mark_and_steal at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-R17H3W25T9.0/build/default-honeycrisp-R17H3W25T9-0/julialang/julia-release-1-dot-11/src/gc.c:2993
gc_mark_loop_parallel at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-R17H3W25T9.0/build/default-honeycrisp-R17H3W25T9-0/julialang/julia-release-1-dot-11/src/gc.c:3141
jl_parallel_gc_threadfun at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-R17H3W25T9.0/build/default-honeycrisp-R17H3W25T9-0/julialang/julia-release-1-dot-11/src/scheduler.c:151e-01
_pthread_start at /usr/lib/system/libsystem_pthread.dylib (unknown line)
Allocations: 323517950 (Pool: 323091059; Big: 426891); GC: 411

There is no error on 1.10.7.

Let me know what other debug info I can provide on this.

cc @wsmoses @vchuravy

x-ref EnzymeAD/Enzyme.jl#2081

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    GCGarbage collectormultithreadingBase.Threads and related functionalityregression 1.11Regression in the 1.11 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions