-
Notifications
You must be signed in to change notification settings - Fork 130
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
Compilation failing with "RuntimeError: Cannot open compilation feedback" #741
Comments
Do you have a minimal test to reproduce from what I tested I never had this error and pError are well formatted with dot. |
I have found a minimal repro, but it requires some complex interactions to trigger the bug. I can work around it so it's not urgent to fix (and it seems quite obscure), I'll just share what I've learned for your information because it's interesting :-) Summary: If your system defaults to a So, the error only occurs when I use Here's a minimal file which reproduces the error on my machine. from matplotlib import pyplot as plt
from concrete.ml.torch.compile import compile_torch_model
import locale
import torch
class NN(torch.nn.Module):
def __call__(self, x):
return x+1
print(locale.getlocale(locale.LC_NUMERIC)) # (None, None)
input_set = torch.ones(1, 1)
_ = compile_torch_model(NN(), input_set) # succeeds
print(locale.getlocale(locale.LC_NUMERIC)) # (None, None)
plt.figure()
print(locale.getlocale(locale.LC_NUMERIC)) # ('es_ES', 'UTF-8')
_ = compile_torch_model(NN(), input_set) # fails I don't know if this is worth fixing, but I guess the compilation feedback could be made agnostic to the system's |
Awesome investigation, thanks @LenaMartens . As well you are totally right json serialization should be agnostics to the systems's locale, we use llvm::json library for this CompilationFeedback object serialization so I guess the bug is in this library. |
Summary
See the attached stack-trace below: compilation fails at the point of collecting compilation feedback with a message of
[6:21, byte=99]: Expected object key
, and dumps the compilation-feedback (which looks like json).I looked up the error message in LLVM, and it's a json format error. If I take the json produced by the error message and run it through a json validation tool it gives me an error at the same line and byte.
Specifically, these two lines are problematic:
The numbers contain a comma. If I replace the comma with a dot, it parses correctly.
I'm using
compile_brevitas_qat_model
fromconcrete-ml
to compile a quantized Brevitas model to trigger this. I think the bug is in theconcrete
compiler, but please tell me if you'd rather I open this bug inconcrete-ml
instead. I haven't been able to create a minimal reproducer but was hoping this is enough information to fix the issue.Let me know if I should provide a minimal repro or more info!
Description
pError
, and it introducing commas in the compilation feedback json outputFull stack-trace
The text was updated successfully, but these errors were encountered: