Skip to content
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

How to debug tpu-mlir? #24

Closed
ColdCodeCool opened this issue Sep 28, 2022 · 4 comments
Closed

How to debug tpu-mlir? #24

ColdCodeCool opened this issue Sep 28, 2022 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested

Comments

@ColdCodeCool
Copy link

No description provided.

@HarmonyHu
Copy link
Collaborator

Hi 调试方法有这么几种:
1 网络调试,在regression目录添加模型的配置,参考现有网络,然后./run_model.sh xxx执行它
2 算子调试,在test_onnx.py文件里面添加某个算子的测试用例,然后执行test_onnx.py xxxx执行它
3 model_runner调试,使用gdb --args python /workspace/tpu-mlir/python/tools/model_runner.py --input resnet18_in_f32.npz --model resnet18_opt.mlir --output resnet18_out.npz
4 其他代码单步跟踪调试,python使用pdb.set_trace(),c++用gdb --args

@HarmonyHu HarmonyHu added help wanted Extra attention is needed question Further information is requested good first issue Good for newcomers labels Oct 8, 2022
@ColdCodeCool
Copy link
Author

Hi 调试方法有这么几种: 1 网络调试,在regression目录添加模型的配置,参考现有网络,然后./run_model.sh xxx执行它 2 算子调试,在test_onnx.py文件里面添加某个算子的测试用例,然后执行test_onnx.py xxxx执行它 3 model_runner调试,使用gdb --args python /workspace/tpu-mlir/python/tools/model_runner.py --input resnet18_in_f32.npz --model resnet18_opt.mlir --output resnet18_out.npz 4 其他代码单步跟踪调试,python使用pdb.set_trace(),c++用gdb --args

多谢,请问调试python和c++混合程序,想看到c++的调用如何进行呢

@HarmonyHu
Copy link
Collaborator

gdb --args python /workspace/tpu-mlir/python/tools/model_runner.py --input resnet18_in_f32.npz --model resnet18_opt.mlir --output resnet18_out.npz
这个就是的,可以参考这个样gdb

@HarmonyHu
Copy link
Collaborator

HarmonyHu commented Oct 10, 2022

image

我们有个微信群,可以群里一起学习交流

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants