[Fix][CI] Isolate dynamo state in torch.compile tests (#1743)
Closes #1741
Summary
- Add a shared
isolated_dynamofixture intests/conftest.pythat runstorch._dynamo.reset()before and after everytorch.compiletest.- Request the fixture from all compile tests (
test_compile.py,test_elementwise_compile.py,test_norm_ops.py,test_pool.py), replacing the module-local reset fixture intest_elementwise_compile.py.- Fixes
FailOnRecompileLimitHiton all threetest_mha_kernel_compilecases in the push-tier gpu-smoke run (cross-test dynamo cache pollution, not intrinsic guard churn).Test plan
- Modified files pass unit tests (297/297 nodes across the 4 touched test files at 8de7df1e; pre-commit green)
- All three
test_mha_kernel_compileparametrizations pass under the push-tier selection-m "smoke or full" -k compilewith push-tier ordering on H200 (11/11; 3 failed pre-fix). CI push-tier confirmation lands on the post-merge run — PR-event gpu-smoke runs-m smokeonly.- This PR documents the flip commit/mechanism and the layer choice (see Regression)
- Subsequent push-to-main GPU Smoke run is green (verifiable only after merge)
Regression
- Flip commit: c9229cab (#1731) added
test_max_pool1d/3d_compile_fullgraph(2 params each, smoke tier), raising pre-MHA push-tier compiles from 4 (norm 2 + pool2d 2) to exactly8.
- Mechanism: dynamo’s recompile cache is keyed per code object.
torch.compileof any plain callable (every TileOpsOpinstance viaOp.__call__) shares torch’s single wrapper frameinner(torch/_dynamo/external_utils.py:66), so each compiled op instance in one pytest process consumes one of the 8cache_size_limitslots of that shared frame. The firsttest_mha_kernel_compilecase was the 9th entry →FailOnRecompileLimitHitunderfullgraph=True; all three MHA parametrizations failed.- Reproduction:
pytest tests/ops/test_norm_ops.py tests/ops/test_pool.py tests/test_compile.py -m "smoke or full" -k compile— 3 failed pre-fix, 11 passed post-fix on H200.tests/test_compile.pyalone passed pre-fix, confirming cross-test cache pollution rather than intrinsic guard churn.- Why test-isolation layer (not op wrapper, not a limit raise): the exhausted code object is torch-owned and shared across ALL compiled plain callables, so no
tileops/ops/wrapper change can prevent distinct op instances consuming per-code-object cache slots; each individual compile is legitimate (one entry per instance, no intra-test recompilation). Fix: sharedisolated_dynamofixture intests/conftest.py(torch._dynamo.reset()before/after) requested by everytorch.compiletest. Raisingcache_size_limitwas rejected — it would mask the next capacity flip instead of removing cross-test coupling.Test node delta
File Base HEAD Delta -------------------------------------------------------------- tests/conftest.py 0 0 0 tests/ops/test_elementwise_compile.py 0 84 +84 tests/ops/test_norm_ops.py 5 5 0 tests/ops/test_pool.py 205 205 0 tests/test_compile.py 3 3 0 -------------------------------------------------------------- TOTAL 213 297 +84Justification: no real growth. The +84 on
tests/ops/test_elementwise_compile.pyis a base-side pytest collection failure in the delta tool (warning emitted); the file has the same 84 nodes at base and HEAD — the diff only rewires an autouse fixture (2 insertions, 5 deletions, no test functions added).
Co-authored-by: Ibuki 🍃 — a wind born from GPTs Ibuki-wind@users.noreply.github.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
TileOPs
Spec-driven GPU operator library for LLMs — designed for AI agents to build, evaluate, and optimize
Built on TileLang
Installation | Quick Start | Docs
Overview
TileOPs is a GPU operator library for LLM training and inference, built on TileLang. Beyond providing a growing collection of production-quality operators, TileOPs explores a spec-driven development model where AI agents can read declarative operator specifications, generate kernel implementations, and evaluate them against hardware-theoretical performance bounds — with minimal human scaffolding.
Architecture
Every operator is split into two layers with a strict boundary:
torch.compile.This separation keeps user-facing behavior independent of GPU strategy, allowing agents and developers to modify either layer without side effects on the other.
Key Properties
tileops/manifest/) that specifies signatures, workloads, and roofline formulas, serving as the entry point for both agent code generation and automated validationInstallation
TileOPs can be installed from PyPI or built from source. A CUDA-capable GPU is required.
Prerequisites
From PyPI
From source
Verify:
Quick Start
Documentation
Design docs and development guides are in
docs/. The full API reference and performance tables are published at TileOPs.github.io.Contributing
See docs/ for design docs. Branch and commit conventions are in
.claude/conventions/types.sh.License
TileOPs is released under the MIT License.