-
Notifications
You must be signed in to change notification settings - Fork 82
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
alpha-CROWN in multiprocessing #58
Comments
Using |
Hi @cherrywoods , I debugged a little and found it crashed when |
Hi, thanks for looking into this! I also investigated whether the issue is with import multiprocessing as mp
import torch
from torch import nn
def worker(network, x):
x.requires_grad = True
print("Start")
output = network(x)
output.backward()
print("Finished")
print(x.grad)
if __name__ == "__main__":
network = nn.Sequential(nn.Linear(10, 10), nn.ReLU(), nn.Linear(10, 1))
x = torch.zeros(1, 10)
worker = mp.Process(
target=worker,
kwargs={"network": network, "x": x},
)
worker.start()
worker.join() |
In the crash stack trace in the issue description that I didn't manage to reproduce yet, it confirms that the crash is during |
It looks like the default start method for multiprocessing is |
As said in pytorch's documentation, the start method has to be |
I am trying to compute bounds on multiple models in parallel using the
multiprocessing
library. This works fine when using IBP or CROWN, but when usingalpha-CROWN
, I get very nondescript (fatal) errors.Reproduce
The following python script runs through, but does not print the bounds, indicating that the subprocess computing the bounds crashed silently. When I replace
"alpha-CROWN"
with"IBP"
or"CROWN"
in line 17, the code runs fine printing bounds on the console.Output:
Output with IBP:
System configuration:
conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.6 -c pytorch -c conda-forge
Additional Context
In my actual project, I get an error message on the console (included below). I could not reproduce this exact error message, but I suspect the underlying issue is the same. The error might appear in my actual project because there, pytest invokes the code, because the main process and the subprocesses communicate via an
mp.SimpleQueue
, or because the subprocess obtains the bounds from a generator.The text was updated successfully, but these errors were encountered: