Open gkronber opened 3 weeks ago
What branch are you on? Are you on latest MT ale/3.0
? We stopped using global buffers. The thing is, if you saturate a different e-graph object per-thread, this shouldn't happen and it's indeed a bug.
If you instead are trying to call saturate!
on the same e-graph but from different threads, there's no mechanism for parallel saturation, and it's a hard task. Searching is fine, but applying matches must happen sequentially and after you union e-classes, ids are going to change, so if you change the ordering you also change the behavior.
I pulled the latest changes from ale/3.0
but the problem persists. Am I missing something?
(@v1.10) pkg> status Metatheory
Status `~/.julia/environments/v1.10/Project.toml`
[e9d8d322] Metatheory v3.0.0 `~/.julia/dev/Metatheory`
shell> cd ~/.julia/dev/Metatheory/
/home/gkronber/.julia/dev/Metatheory
shell> git status
On branch ale/3.0
Your branch is up to date with 'origin/ale/3.0'.
nothing to commit, working tree clean
shell> git log
commit 7709c902afbfd880405ec0c0916eee95c2e6d662 (HEAD -> ale/3.0, origin/ale/3.0)
Author: Alessandro Cheli <a@a.a>
Date: Fri Jun 28 12:14:14 2024 +0200
remove merges buffer
Yes, I only need the first case: saturate independent egraph objects on parallel threads.
I pulled the latest changes from
ale/3.0
but the problem persists. Am I missing something?(@v1.10) pkg> status Metatheory Status `~/.julia/environments/v1.10/Project.toml` [e9d8d322] Metatheory v3.0.0 `~/.julia/dev/Metatheory` shell> cd ~/.julia/dev/Metatheory/ /home/gkronber/.julia/dev/Metatheory shell> git status On branch ale/3.0 Your branch is up to date with 'origin/ale/3.0'. nothing to commit, working tree clean shell> git log commit 7709c902afbfd880405ec0c0916eee95c2e6d662 (HEAD -> ale/3.0, origin/ale/3.0) Author: Alessandro Cheli <a@a.a> Date: Fri Jun 28 12:14:14 2024 +0200 remove merges buffer
Yes, I only need the first case: saturate independent egraph objects on parallel threads.
I will investigate further. I think it's because each rule has its own custom callstack
I'm getting errors when calling saturate for an egraph from multiple threads. I'm careful not to use any shared variables. The race condition seems to occur inside Metatheory (ale/3.0 branch).
Here is the test script
Calling this from a julia instance with 12 threads
julia -t 12
: leads to the following output (example)With a single thread there is no error.