Skip to content

refactor(codegen): unify review follow-ups - #167

Merged
zhen8838 merged 7 commits into
tile-ai:mainfrom
zhen8838:refactor/pr165-followups
Sep 15, 2026
Merged

zhen8838 merged 7 commits into
tile-ai:mainfrom
zhen8838:refactor/pr165-followups

Conversation

@zhen8838

@zhen8838 zhen8838 commented Sep 13, 2026 •

Copy link
Copy Markdown
Collaborator

Why

  • Close the review feedback on duplicated codegen traversal, launch derivation, inspection formatting wrappers, and ambiguous analysis work fields.
  • Keep launch ABI and analysis counting domains explicit without adding parallel abstractions.

What

  • Build one root CodegenContext, derive target-local emit contexts, and route common C++ plus CUDA-specific TIR traversal through CppEmitter and CudaEmitter visitors.
  • Resolve launch edges and callable symbols before emission; represent the one-dimensional grid_x and block_x launch convention as scalar signature parameters.
  • Replace compute-cost storage with generic Spread[V], rename analysis work service to other_ops, and render metadata directly in type-specific printer methods.
  • Remove obsolete topology helpers, per-statement emitters, intermediate inspection values, and tests for deleted objects.

Contract

  • compile() runs the default pass pipeline and then calls the lower-level build() path for pass-prepared TIR.
  • flops and other_ops expose independent logical, total, and topology-ordered per_unit values while preserving dtype or operation-kind breakdowns.
  • Target-side service throughput names remain unchanged.
  • CPU-to-device launches use concrete host-computable scalar expressions; launch geometry has no None fallback.
  • No new tests are added in this follow-up.

Risk

  • Codegen currently supports one CUDA device target per linked artifact and one-dimensional launch topology.

Comment thread docs/spec/analysis.md Outdated
Comment thread docs/tutorial/showcase.ipynb Outdated
Comment thread src/tilefoundry/codegen/cuda/tir/stmts/mesh_scope.py Outdated
Comment thread src/tilefoundry/codegen/cuda/tir/stmts/mesh_scope.py Outdated
Comment thread src/tilefoundry/codegen/cuda/tir/prim_function.py Outdated
Comment thread src/tilefoundry/codegen/cuda/tir/prim_function.py Outdated
Comment thread src/tilefoundry/codegen/topology.py Outdated
Comment thread src/tilefoundry/inspection/values.py Outdated
Comment thread src/tilefoundry/inspection/values.py Outdated
Comment thread tests/codegen/test_topology.py Outdated
@zhen8838
zhen8838 force-pushed the refactor/pr165-followups branch from abe4761 to af88450 Compare September 14, 2026 15:37
@zhen8838 zhen8838 changed the title refactor: follow up distributed feature contracts refactor(codegen): unify review follow-ups Sep 15, 2026
@zhen8838
zhen8838 force-pushed the refactor/pr165-followups branch from ca932f2 to ca65c89 Compare September 15, 2026 06:10
@zhen8838
zhen8838 merged commit e09a33e into tile-ai:main Sep 15, 2026
1 check passed
@zhen8838
zhen8838 deleted the refactor/pr165-followups branch September 15, 2026 08:23
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