Skip to content

feat(jit): enable hip kernel debug info#318

Merged
kawhil-amd merged 1 commit into
ROCm:mainfrom
kawhil-amd:enable_debuginfo
May 13, 2026
Merged

feat(jit): enable hip kernel debug info#318
kawhil-amd merged 1 commit into
ROCm:mainfrom
kawhil-amd:enable_debuginfo

Conversation

@kawhil-amd
Copy link
Copy Markdown
Contributor

@kawhil-amd kawhil-amd commented May 13, 2026

Motivation

Enable debugging of JIT-compiled kernels by adding debug symbol generation support. When troubleshooting kernel issues, developers need to inspect assembly with source-level debug info.

Technical Details

Add MORI_DEBUG_INFO environment variable to control hipcc debug flags in JIT compilation:

  • config.py: add is_debuginfo_enabled() to detect MORI_DEBUG_INFO env var
  • core.py: add _debuginfo_flags() returning ["-g", "-ggdb"] when enabled, integrate into _hipcc_genco()

When MORI_DEBUG_INFO=1, hipcc jit compiles with -g -ggdb flags alongside -O2.

Test Plan

MORI_PRECOMPILE=1 MORI_DEBUG_INFO=1 python -c "import mori"

Test Result

  • The mori jit kernel pre-compilation test has been verified.

@kawhil-amd kawhil-amd requested review from TianDi101 and jhchouuu May 13, 2026 06:20
@kawhil-amd kawhil-amd self-assigned this May 13, 2026
Copy link
Copy Markdown
Collaborator

@jhchouuu jhchouuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Can the mode switching be achieved during runtime?

@kawhil-amd
Copy link
Copy Markdown
Contributor Author

kawhil-amd commented May 13, 2026

LGTM Can the mode switching be achieved during runtime?

The mode switching function requires clearing the kernel cache first, will consider adding a kernel cache clearing feature later.

@kawhil-amd kawhil-amd merged commit e39c19f into ROCm:main May 13, 2026
25 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants