[ Back to index ]
Since CM language uses native OS scripts with python wrappers, it is relatively straightforward to debug it using your existing tools.
When you run CM language from the command line or via Python API, the most common execution flow is:
- cm/cmr binary or cmind.access function
- "access" function in core.py from cmind package
- CM automation either from the internal CM repo or mlcommons@ck
- CM scripts
- preprocess function from customize.py from a given CM script
- native OS script
- postprocess function from customize.py from a given CM script
When running MLPerf and other benchmarks, you can often use the --debug
flag to
start a shell with all environment variables prepared to run/debug the final OS command manually.
You can also use GDB via environment variable --env.CM_RUN_PREFIX="gdb --args "
You can debug CM scripts using Visual Studio Code. See the test-debug CM script for a demo:
- Debug CM internals and customize.py using python entry point
- Debug native python code wrapped by CM scripts using CM break points: code, README