Skip to content

Remove TilelangDSL - #996

Open
alanwangtianqiwork wants to merge 4 commits into
hw-native-sys:mainfrom
afshinarefi:remove-tilelang
Open

Remove TilelangDSL #996
alanwangtianqiwork wants to merge 4 commits into
hw-native-sys:mainfrom
afshinarefi:remove-tilelang

Conversation

@alanwangtianqiwork

Copy link
Copy Markdown
Contributor

No description provided.

@Zhendong404 Zhendong404 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Currently a lot of release/package/ci scripts are still assuming tilelang-dsl exists. Should modify those scripts too.

@Zhendong404 Zhendong404 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some of the new tileop templates are added in the main branch, like pto.tci、pto.tconcat、pto.tdequant.... Should rebase the main branch and migrate those templates too.

@Zhendong404 Zhendong404 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shoud test whether the release wheel works before merging.

@alanwangtianqiwork
alanwangtianqiwork force-pushed the remove-tilelang branch 2 times, most recently from fccf756 to 3f613c2 Compare July 28, 2026 13:49
@alanwangtianqiwork

Copy link
Copy Markdown
Contributor Author

Some of the new tileop templates are added in the main branch, like pto.tci、pto.tconcat、pto.tdequant.... Should rebase the main branch and migrate those templates too.

@Zhendong404

Zhendong404 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Review: defects and risks

First, an important correction to the premise: this PR does not actually delete tilelang-dsl/. The diff contains zero changes under tilelang-dsl/ — the full directory (including the complete Python package tilelang-dsl/python/tilelang_dsl/, the daemon, tests, and examples, 64 files) still exists unchanged at the PR head. What the PR actually does:

  • Deletes the 105 legacy TileLang template files (lib/TileOps/*_template.py, etc.);
  • Moves the PTODSL templates from ptodsl/ptodsl/tilelib/templates/a5/ to lib/TileOps/a5/, and rewrites lib/TileOps/__init__.py as a lazy loader (all 113 module references cross-checked — none missing);
  • Unwires tilelang-dsl from CMake / wheel assembly / dist-collection scripts / CI;
  • Reduces the ptoas --tile-lib-backend enum to only ptodsl.

The rewiring itself is high quality: CMake, wheel assembly, dist collection, ptoas_env.sh, CI workflows, and the ptodsl tilelib import redirection are all consistently updated. I found no configure/build/package-time blockers, and the edited tests pass conceptually. However, there are the following defects and risks:

Major issues

  1. Legacy backend left half-removed (risk)lib/PTO/Transforms/ExpandTileOp.cpp:1185 still shells out to python -m tilelang_dsl.expand_helper when tile-lib-backend=tilelang, and include/PTO/Transforms/Passes.td:566-580 still defines the tilelang-path/tilelang-pkg-path options. But tools/ptoas/ptoas.cpp no longer exposes those CLI flags, and :497-498 unconditionally clears both paths. Net effect: this path is only reachable via pass-pipeline options through pto-test-opt, and it fails at runtime — unless the orphaned tilelang-dsl/python happens to be on PYTHONPATH (it only works today because that directory was not deleted). Either finish the removal in ExpandTileOp/Passes.td, or explicitly document that the legacy path is intentionally kept; the current title oversells the change.

  2. tilelang-dsl/ becomes live code with no CI coverage (risk).github/workflows/ci_sim.yml:61 dropped tilelang-dsl/** from the path filter, yet the directory is still shell-invoked by the legacy ExpandTileOp path. Any future edit to it will trigger no CI — a silent-regression zone.

  3. Stale docs now give commands that error out (minor)ptodsl/docs/developer_guide/tilelib-debugging-playbook.md:137 still tells users to run ptoas --tile-lib-backend=tilelang, which now fails at option-parse time. Similarly, .claude/skill/pto_debug_skill.md (lines 55/590/664) and 3 skills under .codex/skills/ still teach TileLangDSL template and parity workflows, pointing at the deleted *_template.py files.

Minor issues

  • Lost CI artifacts — the TileLib ST log-upload step in ci_sim.yml dropped the ${TILELIB_ST_WORKSPACE}/tilelib-st-a5/** artifact directory, yet the step still sets TILELIB_ST_OUTPUT_ROOT to write into it; per-case outputs will no longer be available when a sim fails.
  • Dangling testtest/python/test_docker_runtime_packaging.py:16,38-39 still reads docker/copy_ptoas_deps.sh, which this PR deletes; running it raises FileNotFoundError. No workflow executes it today, but it should be updated/deleted in this PR.
  • Stale comments — ~26 lit tests test/lit/vpto/expand_tile_op_*tilelang*.pto still comment that they expand "via the default TileLang Python DSL template lib/TileOps/tadd_template.py", a file that no longer exists.
  • Dead variable PTOAS_TILEOPS_DIR — only set in ptodsl/ptoas/_runtime_entry.py:117 and asserted in its test; nothing consumes it.
  • Top-level lib/ on PYTHONPATH (low risk)_ptoas_build_backend.py:308 and scripts/ptoas_env.sh:123 add the repo's lib/ to sys.path; today only TileOps has an __init__.py, but any future lib/<dir>/__init__.py would silently become an importable top-level package.
  • Naming debt (acceptable): the test/tilelang_st directory name, PTO_TILELANG_ST_* CMake variables, and the pto.tilelang.instance attribute name remain — the latter is a contract name shared by multiple C++/Python sites, so keeping it is reasonable.

Suggestions

Before merging, at minimum: delete tilelang-dsl/ and clean up the tilelang branch in ExpandTileOp/Passes.td accordingly (or retitle the PR, e.g. "Switch TileLib backend to PTODSL / unwire TilelangDSL"), fix the debugging-playbook doc, restore the tilelib-st artifact upload, and handle test_docker_runtime_packaging.py. Skills and lit comments can be follow-up cleanup.

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