feat(diagnostics): add Triton Anchor compile diagnostics - #53
Open
skwmw01 wants to merge 5 commits into
Open
Conversation
Implement PassDiagnostic to run TTIR and triton-linalg pipelines pass by
pass, saving before/after IR snapshots, failure diagnostics, summary.json,
and best-effort MLIR op/location.
Add triton_anchor.diagnose CLI with file input and --python
MODULE:FUNCTION runtime TTIR generation, and register triton-anchor-diagnose
console script in setup.py and pyproject.toml.
Add diagnostics unit tests, user documentation, T2.1 implementation
reports, and a retained failing inline-asm sample source.
Add python-frontend and input-parse diagnostic handling before pass
execution. Update CLI output, summaries, tests, runnable failure
samples, and diagnostics documentation. Remove the superseded T2.1
analysis document.
Add Sophgo PPLIR and external-stage diagnostic coverage, update CLI support, tests, docs, and the PPLIR failure sample. Keep generated diagnostic outputs and build artifacts untracked.
Codex AI 自动审查
审查摘要
本次变更新增了可运行的逐 pass 诊断核心、CLI、公共导出和打包入口。定向验证确认 TTIR 成功、非法 IR parse 和 Python frontend 失败均能生成预期诊断,本地确定性 CI 检查也成功完成构建、安装和既有冒烟测试。主要缺陷是贡献者声明的 Sophgo JIT 自动 hook 没有出现在实际 diff 或调用链中,导致环境变量对常规 JIT 编译无效。 贡献者目标与实现情况
需要处理的问题1. [中风险] 环境变量未接入真实 Sophgo JIT 编译链路
可点击代码定位链接固定到本次测试提交,便于提交者修复和审核者核对代码功能;已验证行号的问题链接到具体行,仅能确认文件的问题链接到文件并标注行号待核对。 验证情况
剩余风险
变更文件查看变更文件
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
当前 Triton / Sophgo 算子编译失败时,报错信息长且难以定位到具体 pass、MLIR
op 或阶段。该 PR 增加 Triton Anchor 诊断能力,用于在编译失败时快速定位问
题。
主要变更
PassDiagnostic,支持 TTIR、triton-linalg、sophgo-pplir逐pass 诊断。
triton-anchor-diagnoseCLI,并注册为console_scriptsentrypoint。
.ttir/.mlir文件诊断--python辅助模式生成 TTIR 后诊断TRITON_ANCHOR_DIAGNOSE_ON_ERROR=1 python your_kernel.py自动 hook 真实编译链路
ppl-compile/ CMake /.so/runtime launch / result mismatch 失败时自动输出诊断。
验证
python -m pytest python/triton_anchor/tests/test_diagnostics.py -q兼容性
TRITON_ANCHOR_DIAGNOSE_ON_ERROR时不影响正常编译流程。