Debug
In this section, you will learn how to debug the compilation process easily as well as how to get help in case you cannot resolve your issue.
Debug Artifacts
Concrete-Numpy has an artifact system to simplify the process of debugging issues.
Automatic export.
In case of compilation failures, artifacts are exported automatically to the .artifacts
directory under the working directory. Let's intentionally create a compilation failure to show what kinds of things are exported.
This function fails to compile because Concrete-Numpy does not support floating-point outputs. When you try to compile it, an exception will be raised and the artifacts will be exported automatically. If you go the .artifacts
directory under the working directory, you'll see the following files:
environment.txt
This file contains information about your setup (i.e., your operating system and python version).
requirements.txt
This file contains information about python packages and their versions installed on your system.
function.txt
This file contains information about the function you tried to compile.
parameters.txt
This file contains information about the encryption status of the parameters of the function you tried to compile.
1.initial.graph.txt
This file contains the textual representation of the initial computation graph right after tracing.
1.initial.graph.png
This file contains the visual representation of the initial computation graph right after tracing.
2.final.graph.txt
This file contains the textual representation of the final computation graph right before MLIR conversion.
2.final.graph.png
This file contains the visual representation of the final computation graph right before MLIR conversion.
traceback.txt
This file contains information about the error you received.
Manual export.
Manual exports are mostly used for visualization. Nonetheless, they can be very useful for demonstrations. Here is how to perform one:
If you go to the /tmp/custom/export/path
directory, you'll see the following files:
1.initial.graph.txt
This file contains the textual representation of the initial computation graph right after tracing.
1.initial.graph.png
This file contains the visual representation of the initial computation graph right after tracing.
2.after-float-fuse-0.graph.txt
This file contains the textual representation of the intermediate computation graph after fusing.
2.after-fusing.graph.png
This file contains the visual representation of the intermediate computation graph after fusing.
3.final.graph.txt
This file contains the textual representation of the final computation graph right before MLIR conversion.
3.final.graph.png
This file contains the visual representation of the final computation graph right before MLIR conversion.
bounds.txt
This file contains information about the bounds of the final computation graph of the function you are compiling using the inputset you provide.
mlir.txt
This file contains information about the MLIR of the function you compiled using the inputset you provided.
Asking the community
You can seek help with your issue by asking a question directly in the community forum.
Submitting an issue
If you cannot find a solution in the community forum, or you found a bug in the library, you could create an issue in our GitHub repository.
In case of a bug:
try to minimize randomness
try to minimize your function as much as possible while keeping the bug - this will help to fix the bug faster
try to include your inputset in the issue
try to include reproduction steps in the issue
try to include debug artifacts in the issue
In case of a feature request:
try to give a minimal example of the desired behavior
try to explain your use case
Last updated