Closed Zhaoxian-Wu closed 3 weeks ago
@Zhaoxian-Wu indeed, debug mode might not be working with python. The debug mode is only used for C++ environments.
@Zhaoxian-Wu were you able to attend to @maljoras response and are you still having the problem?
@Zhaoxian-Wu indeed, debug mode might not be working with python. The debug mode is only used for C++ environments.
I see. So what is the best practice for debugging the C++ code? Actually, when I was trying to develop some code to implement some functions on the analog tile update, I found I needed to print out some of the intermediate results to ensure everything was working correctly. I use the DEBUG_OUT(...)
marco left in the C++ code to do so, which works only in the debug mode. So if I do want to debug, do you have any suggestion how I can print out some results in the C++ domain elegantly?
Thanks for your response and sorry for my late response.
Hi @Zhaoxian-Wu, I think there is an RPU_INFO macro also available, which works also in non-debug setting. Or you could define your own macro, it is anyway just a short-cut for std::out << argument << std::endl;
essentially.
I see. Thank you very much @maljoras-sony
@Zhaoxian-Wu was this issue resolved in your end. If so, can you please provide more details on how you resolved it. Also what did you use to debug the issue. Thanks!
Description
When I try to run
optimizer.step()
on TransferCompound in Debug mode, a segment fault occurs. It happens for the CUDA version.How to reproduce
I followed the following steps:
git clone https://github.com/IBM/aihwkit.git ; cd aihwkit pip install -r requirements.txt conda install mkl mkl-include -y
export CXX=/usr/bin/g++ export CC=/usr/bin/gcc export MKLROOT=$CONDA_PREFIX export CMAKE_PREFIX_PATH=$CONDA_PREFIX
export CUDA_VERSION=11.3
export CUDA_VERSION=11.1 export CUDA_HOME=/usr/local/cuda-${CUDA_VERSION} export CUDA_TOOLKIT_ROOT_DIR=${CUDA_HOME} export CUDA_LIB_PATH=${CUDA_HOME}/lib64 export CUDA_INCLUDE_DIRS=${CUDA_HOME}/include export PATH=${CUDA_HOME}/bin:${PATH} export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH make build_inplace_cuda flags="-DRPU_DEBUG=ON"
Expected behavior
The code can run without error
Other information
main.py