[TEST] Key operator-test skipping and selection off the manifest and the run's scope - #1515
Merged
LLMZhangYC merged 3 commits intoJul 31, 2026
Conversation
Two faults in how the migrated operator tests reach CI, both from the same oversight: the routing added state the surrounding code does not know about. The loop that classifies changed files has four rules that decide on a full run, and each clears what was collected before it. Three arrays added later were not on that list, so a change to a core file alongside a migrated operator cleared the directories, kept the operator, and wrote it back after the loop. A full run then narrowed to that one directory, silently. Since git diff sorts its output, examples/ always precedes tilelang/, src/, requirements* and install_ascend.sh, so the operator was always seen first and the narrowing was not occasional. The fallback that runs those tests took every registered entry regardless of what the run was scoped to, so editing one example ran all of them. It now takes the two arguments the runner just took and means the same by them.
The runner dropped every test_*.py from what it collects. That rule arrived with the migration and is not how the operators themselves are handled: those consult the manifest. Three tests already upstream match no entry, and by name alone they stopped running here while continuing to run in the repository they came from. Nothing reported it, since a script that is never collected cannot fail. Skipping by manifest instead leaves a registered test to Pytest and hands the rest back to the runner, which is what ran them before any of this. A name that was meant to match an entry and does not now fails loudly: it is collected, produces no passing line, and is reported failed. check-orphans reported that case by refusing to run at all, which is no longer the situation it describes and was never a condition this repository could place on other people. It says what it found and lets the run proceed.
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
👋 Hi! Thank you for contributing to the TileLang project. Please remember to run We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀 |
This block was reading the whole manifest while the examples around it were narrowed to the directories passed in, so a scoped invocation produced a report covering one directory of examples and every operator. What that report measured could not be told from looking at it. It takes the two options this script already parses and hands them on unchanged, as the workflow does with the same two.
dlaerbinjwy
added a commit
to dlaerbinjwy/tilelang-ascend
that referenced
this pull request
Jul 31, 2026
dlaerbinjwy
added a commit
to dlaerbinjwy/tilelang-ascend
that referenced
this pull request
Jul 31, 2026
dlaerbinjwy
added a commit
to dlaerbinjwy/tilelang-ascend
that referenced
this pull request
Jul 31, 2026
dlaerbinjwy
added a commit
to dlaerbinjwy/tilelang-ascend
that referenced
this pull request
Jul 31, 2026
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.
背景
算子测试迁移(#1489 / #1497)落地后发现三个问题,共同点是判断依据用错了:该看登记表的地方看了文件名,该看本次运行范围的地方读了整张登记表。
三处修改互相独立,分三个 commit。
test_dirs_arrayci_cd.ymlci_cd.yml、bench_test.shfind用-not -name "test_*.py"按文件名排除所有测试check-orphans还会让别人的 PR 直接失败bench_test.sh、resolve_operator_tests.py1. 保证全量运行是全量
detect_changes的循环里,四条判定全量的规则都是"清空已收集的数组 +break"。#1489 加的routed_tests/routed_example_dirs/routed_experiment_dirs不在清理清单里,break之后仍带着值,循环外的归并把它们写回了test_dirs_array,于是test_dirs从空(= 跑全部)变成了单个目录。git diff --name-only按字典序输出,examples/永远排在tilelang/、src/、requirements*、install_ascend.sh前面,所以算子总是先被收集、再撞上全量规则——必然触发,不是偶发。改法是把这三个变量加进四处清理清单,与相邻写法一致,没有引入新机制。
test_dirs_array=() experiment_dirs_array=() pytest_files_array=() pytest_dirs_array=() +routed_tests=() +routed_example_dirs=() +routed_experiment_dirs=() break主仓原有的四条全量规则、examples 增量规则、
check_skip_pytest未做任何修改。2. 算子测试跟随运行范围
run_examples末尾补跑已迁移算子测试是必要的(它们的源文件被 runner 全局跳过),但不该无视范围。TEST_DIRS_ARG本身就是字面的--dirs a b c(全量时为空串),让list-tests认同样的参数即可原样传下去。bench_test.sh里手工跑覆盖率的那段同样处理,否则--coverage --dirs foo会产出"一个目录的 examples + 全部算子"的混口径报告。list-tests新增--dirs/--experiment-dirs:两个都不给是全量;只给一个时另一个视为空集;按根目录下第一层目录匹配(算子可能更深一层,如examples/tile_kernels/moe/…归tile_kernels)。3. 跳过依据改为登记表
find按文件名排除test_*.py是随迁移加进来的,主仓没有,而且与算子的处理方式不对称——算子查登记表,测试看名字。改成与算子一致:新增
MIGRATED_TESTS,在should_skip_python_script里查一次,然后删掉那两行按名字的排除。四个收集点原本就都经过该函数,无需另加调用。登记过的测试交给 Pytest,没登记的照旧由 runner 当脚本收集执行——这是登记表出现之前的行为。名字写错的测试也不会再无声消失:它会被当脚本执行,而 runner 要求输出中出现
KERNEL OUTPUT MATCH或TEST PASSED!,Pytest 风格的文件什么都不打印,直接判[FAILED]。check-orphans随之从报错降级为提示。它原来的理由是"未登记的测试跑不到任何地方",改完之后不再成立;而且登记表是本分支的内部约定,不应该让其他人的 PR 因此失败。测试
改动前后各跑一次
bash bench_test.sh --coverage(docs/coverage_guide.md里的原样命令),在一棵 48 条登记生效的树上:coverage.jsoncoverage.json字节级相同 —— 不带--dirs时覆盖数据无任何变化。路由决策:抽出
detect_changes原样跑 29 组改动组合。六种"核心文件 + 已迁移算子"的组合从test_dirs=[batch_gemm]恢复为[];其余 23 组决策不变(新增 example、改未登记算子、只改testing/python、只改 docs、算子与其测试同改去重成一个、跨两个根目录混合改动等)。范围过滤:
--dirs batch_gemm--dirs elementwise(无已登记算子)--dirs tile_kernels(算子在两层子目录)--dirs HISA flash_attention--experiment-dirs cumsum_kda收集与执行:
[PASSED][FAILED]--skip-pytest另:登记表 140 条的源文件在
ascendc_pto当前 HEAD 上全部存在,合并不会导致validate失败。对其他贡献者的影响
登记表 140 条中目前仅 3 条生效(测试文件已落地),其余 137 条为占位,对应算子仍走原有 runner。
tilelang/等核心文件testing/python/或文档check-orphans拦下,且会被当脚本执行需要留意:登记表中列出的算子源文件如被改名或删除,需同步修改
ci/operator_test_manifest.yaml对应条目,否则validate会在 runner 启动时报source does not exist。修改文件内容不受影响。