JuliaDiff / JuliaDiff/ReverseDiff.jl

Interference with Distributed.jl on Windows

Open
#205 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
393
Forks
60
Avg merge
18h 24m
Merged PRs (30d)
8

Description

Following some detective work with the help of @rikhuijzer and @ChrisRackauckas on https://discourse.julialang.org/t/github-action-mysteriously-starts-breaking-on-windows/86048, it seems as though ReverseDiff.jl is interfering with Distributed.jl and causing some issues.

When I import ReverseDiff.jl into SymbolicRegression.jl (either directly, or if it is imported in a dependency of a dependency) the unit tests on Windows break. These unit tests use Distributed.jl to dynamically allocate worker processes. No other operating systems are affected.

This bug can reproduced with the following code, which dynamically allocates some worker processes, activates the current environment on each, and then imports ReverseDiff.jl on each.

using Pkg
using Distributed
import ReverseDiff
procs = addprocs(4)

# Activate env on workers:
project_path = splitdir(Pkg.project().path)[1]
@everywhere procs begin
    Base.MainInclude.eval(
        quote
            using Pkg
            Pkg.activate($$project_path)
        end,
    )
end

# Import package on workers:
@everywhere procs begin
    Base.MainInclude.eval(import ReverseDiff)
end

This code will work on Ubuntu and macOS, and works for every other package I've tested it on (all the dependencies of SymbolicRegression.jl are loaded this way). It is just the combination of Windows + ReverseDiff.jl that produce an error for some weird reason. You can see the error log here: https://github.com/MilesCranmer/SymbolicRegression.jl/runs/7943853737?check_suite_focus=true#step:6:232.

I really have no idea what could be causing this. Any clue? Does ReverseDiff.jl change any core functions in any way that would impact this?

Thanks!
Miles

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied Windows reproduction using Distributed.addprocs, Pkg.activate, and @everywhere import ReverseDiff, then compare it with Ubuntu and macOS. Inspect the linked GitHub Actions error log for the first failure and determine whether importing ReverseDiff causes it; done means the worker setup and affected Windows tests pass without breaking other platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.