Skip to content

refactor(schedule): delete the schedule layer and analysis/poly - #136

Merged
zhen8838 merged 4 commits into
tile-ai:mainfrom
zhen8838:refactor/schedule-teardown
Aug 29, 2026
Merged

refactor(schedule): delete the schedule layer and analysis/poly#136
zhen8838 merged 4 commits into
tile-ai:mainfrom
zhen8838:refactor/schedule-teardown

Conversation

@zhen8838

Copy link
Copy Markdown
Collaborator

Why

  • src/tilefoundry/schedule/ (5278 lines) had no calling path: compile.py, cli/, and
    passes/ never reached it, and it exported no symbol from the public __all__. Only the
    target layer's facts and scheduler services held it up.
  • Its atom contract also contradicts the design it is being rebuilt against
    (AtomFact is flat MNK plus byte counts, and operands carrying a layout are excluded
    outright). The rebuild happens outside this repo, so the old layer is removed rather than
    adapted — the replacement lands on empty ground instead of fighting a stale namespace.
  • analysis/poly/ existed only to feed it: extract() had one caller, and TileGraph /
    TileUnit had no reader outside that caller. With the consumer gone the subpackage is
    orphaned except for affine.py, which the live analyze path uses.

What

  • Deletes the schedule package, target/{cuda,amx}/{schedule,atoms}.py, the pipeline and
    partition Facts projections, and Scheduler / ScheduleCallable / Target.get_scheduler.
    Target keeps the five projections analysis actually reads: MemoryHierarchyFacts,
    ThroughputFacts, ParallelCapacityFacts, PerformanceServiceFacts, TopologyLimitFacts.
  • Deletes analysis/poly/ and moves poly/affine.py to analysis/affine.py unchanged
    (a 100% rename); analysis/scope.py and analysis/footprint.py follow the new path.
    Ten poly symbols leave analysis.__all__.
  • Tests follow: tests/schedule/, the five test_poly_* files, the model corpus's
    schedule capability and every schedule= declaration, the vendor NPU provider's
    scheduler, and the scheduler cases in the target and analysis suites.
  • Specs and tutorials follow: docs/spec/schedule.md is deleted, and architecture,
    code-organization, target, analysis, core-ir, cli, types,
    semantic-analysis, visitor-registry plus both tutorial pages no longer describe the
    layer. The tutorial stops promising a tilefoundry schedule command that does not exist.
  • No test is added. This is a deletion, and a new test would only certify a shape that is
    being removed. Regression rests on the existing suite and the three spec lints.

Contract

  • Removed public API: tilefoundry.schedule in full, Scheduler, ScheduleCallable,
    Target.get_scheduler, candidate_atoms, and the ten poly re-exports from
    tilefoundry.analysis. No compatibility shim and no deprecation period — nothing in the
    repository called any of it.
  • analysis.affine replaces analysis.poly.affine as the import path for
    loop_affine_term / LoopAffineTerm. The module's contents are byte-identical.
  • analyze() and every analysis family behave exactly as before; they only ever used
    affine.
  • docs/spec/analysis.md loses its Polyhedral model section, so its metrics and composed
    operation become §1 and §2. tilefoundry spec analysis addresses move with them
    (2.2.1 is now 1.2.1); analyze --help and the five specs linking into the old
    numbering were updated.
  • ir/constraints/ and passes/transforms/bufferize.py's BufferScheduler are untouched.
    The latter is an unrelated buffer-placement hook that only shares the word.

Risk

  • The rebuilt scheduling layer will re-enter the repository from
    docs/plans/atom-schedule-search/STANDALONE.md, and will re-take the candidate_atoms
    entry point on the target side. Nothing is reserved for it here: the spec is written
    fresh when its actual shape is known, rather than left as a placeholder that ages.
  • emit_scaffold and build_schedule_tree are removed with the layer. They had no caller
    outside it; the capability is rebuilt out of tree.

The `tilefoundry.schedule` package had no calling path: neither compile,
cli, nor passes reached it, and its public `__all__` exported nothing. Its
atom contract also contradicts the design it is being rebuilt against, so
it is deleted outright rather than kept as a compatibility shell.

Removes the package, `target/{cuda,amx}/{schedule,atoms}.py`, the pipeline
and partition Facts projections, and the `Scheduler` / `ScheduleCallable` /
`Target.get_scheduler` public contracts. Target keeps only the five
projections analysis actually reads. `ir/constraints/` and the unrelated
`BufferScheduler` are untouched.

Tests and specs follow: `tests/schedule/`, the five `test_poly_*` files
that lose their subject with render/kernel_schedule, the model corpus's
`schedule` capability, and `docs/spec/schedule.md` are deleted; the
remaining specs and tutorials no longer describe or promise the layer.
…eardown

kimi_linear_48b_a3b still described how Schedule selected functions, a
contract this branch removed. minicpm3_4b claimed its case is not in
`registry.CORPUS`, which is false: `registry.MODELS` names the package and
`_cases` puts the case in `CORPUS`. Both now state what is measured today.
…nd core-ir

`check_program` is now the gate for analysis alone. Its module docstring,
the `performance` checker's note, and the two symbolic-dimension errors a
user reads still named scheduling as a second caller. The core-ir clause
requiring a published root to declare its target named the deleted public
Schedule operation alongside Analyze.

No behavior change: only the two error strings are user-visible, and
nothing asserts their text.
`extract` had one caller, the schedule pipeline's program view, and
`TileGraph` / `TileUnit` had no reader outside it. With that layer gone the
subpackage has no consumer, so all of `model`, `extract`, `access`, and
`errors` are deleted along with the public surface re-exporting them.

`affine.py` is the exception: `analysis/scope.py` and `analysis/footprint.py`
are on the real analyze path and read it. It moves to `analysis/affine.py`
unchanged, and its two importers follow. Ten symbols leave
`analysis.__all__`; `analyze()` is otherwise untouched.

The analysis spec loses § Polyhedral model, which leaves the metrics and the
composed operation as §1 and §2. That renumber changes the addresses
`tilefoundry spec analysis` resolves, so the `analyze --help` pointers and the
five specs that linked into the old numbering move with it.
@zhen8838
zhen8838 merged commit 2306bf0 into tile-ai:main Aug 29, 2026
1 check passed
@zhen8838
zhen8838 deleted the refactor/schedule-teardown branch August 29, 2026 09:53
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.

1 participant