Debug

SOL provides a series of debug and visualization features.

Code Debugging

SOL’s generated code can be debugged by setting:

sol.config["jit::debug"] = True		# compiles with debug symbols
sol.config["compiler::debug"] = True	# adds assertions into the code (requires jit::debug)

Python based frameworks

For Python based frameworks you can then execute the following series of commands:

gdb python3
run myscript.py

or run interactively

gdb python3
run
# starting from here the Python console will be active.
# use CTRL+C to switch back to GDB
import framework
import sol
model = init_model()
sol_model = sol.optimize(...)

Computation Graph

Setting the config value sol.config["compiler::debug_graph"]=True or the env var SOL_DEBUG=GRAPH plots the computation graph for all devices and execution passes in $CWD/.sol/debug/*.svg.

Debug CG

Setting the config value sol.config["compiler::debug_text"]=True or the env var SOL_DEBUG=TEXT plots the computation graph for all devices and execution passes in $CWD/.sol/debug/*.txt.

I2_Output[F32][NO3: 1, NO2: 3, NO1: 224, NO0: 224] = Input<>()
P2_Output[F32][NO3: 64, NO2: 3, NO1: 11, NO0: 11] = Param<>()
P4_Output[F32][NO0: 64] = Param<>()
P6_Output[F32][NO3: 192, NO2: 64, NO1: 5, NO0: 5] = Param<>()
P8_Output[F32][NO0: 192] = Param<>()
P10_Output[F32][NO3: 384, NO2: 192, NO1: 3, NO0: 3] = Param<>()
P12_Output[F32][NO0: 384] = Param<>()
P14_Output[F32][NO3: 256, NO2: 384, NO1: 3, NO0: 3] = Param<>()
P16_Output[F32][NO0: 256] = Param<>()
P18_Output[F32][NO3: 256, NO2: 256, NO1: 3, NO0: 3] = Param<>()
P20_Output[F32][NO0: 256] = Param<>()
P22_Output[F32][NO1: 4096, NO0: 9216] = Param<>()
P24_Output[F32][NO0: 4096] = Param<>()
P26_Output[F32][NO1: 4096, NO0: 4096] = Param<>()
P28_Output[F32][NO0: 4096] = Param<>()
P30_Output[F32][NO1: 1000, NO0: 4096] = Param<>()
P32_Output[F32][NO0: 1000] = Param<>()
T53_Output = sol_x86_36C4873F_159AE6E4_inf_dnn_dnnl_149(I2_Output) {
	T53_Output[F32][NO0: 1, PI1: 224, PI0: 224, CI0: 3] = Reorder<>(Input: I2_Output[F32][NO0: 1, CI0: 3, PI1: 224, PI0: 224])
}
T54_Output = sol_x86_36C4873F_159AE6E4_inf_dnn_dnnl_14A(P2_Output) {
	T54_Output[F32][CO0.0: 1, PK1: 11, PK0: 11, CI0: 3, CO0.1: 64] = Reorder<>(Input: P2_Output[F32][CO0: 64, CI0: 3, PK1: 11, PK0: 11])
}
T1_Output = sol_x86_36C4873F_159AE6E4_inf_dnn_dnnl_148(P4_Output, T53_Output, T54_Output) {
	T1_Output[F32][NO0: 1, PO1: 55, PO0: 55, CO0: 64] = Conv<>(Input: T53_Output[F32][NO0: 1, PI1: 224, PI0: 224, CI0: 3], Weight: T54_Output[F32][CO0.0: 1, PK1: 11, PK0: 11, CI0: 3, CO0.1: 64], Bias: P4_Output[F32][CO0: 64])
}
T55_Output = sol_x86_36C4873F_159AE6E4_inf_dnn_dnnl_147(T1_Output) {
	T55_Output[F32][NO0: 1, CO0: 64, PO1: 55, PO0: 55] = Reorder<>(Input: T1_Output[F32][NO0: 1, PO1: 55, PO0: 55, CO0: 64])
}
T3_Output = sol_x86_36C4873F_159AE6E4_inf_dfp_ispc_146(T55_Output) {
	T3_Output[F32][NO0: 1, CO0: 64, PO1: 27, PO0: 27] = MaxPooling<>(Input: T55_Output[F32][NO0: 1, CO0: 64, PI1: 55, PI0: 55])
}
T56_Output = sol_x86_36C4873F_159AE6E4_inf_dnn_dnnl_145(T3_Output) {
	T56_Output[F32][NO0: 1, PI1: 27, PI0: 27, CI0: 64] = Reorder<>(Input: T3_Output[F32][NO0: 1, CI0: 64, PI1: 27, PI0: 27])
}
...

Memory Consumption

Setting the config value sol.config["compiler::debug_memory_consumption"]=True or the env var SOL_DEBUG=MEMORY plots the memory consumption for all devices and execution passes in $CWD/.sol/debug/*_memory.json.

You can open this trace with ui.perfetto.dev via the “Open Trace File” menu.

Debug Memory Debug Memory2