Skip to content

Best Practice in development

huiyan2021 edited this page May 20, 2025 · 2 revisions

Git Practice

  • When you develop on a branch, use rebase instead of merge because merge may flood the actual new commits on main branch.

Debug Practice

Debug from python script into c++ code in vs code (remote ssh)

Steps

  1. Pick PR: https://github.com/intel/torch-xpu-ops/pull/1671 at the time being.
  2. Build debug version of pytorch:
  3. Mixed Language Debugging (Python and C++) or Python C++ Debugger, both work.
  4. Fix gdb attach permission issue: Superuser access is required to attach to a process. Attaching as superuser can potentially harm your computer. Do you want to continue? [y/N]
    echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

Example Snapshots

  • launch.json image

  • break point in python script image

  • break point in c++ code image

Clone this wiki locally