tile-ai / tile-ai/TileFoundry

analysis: keep annotated reports aligned with authoring syntax

Open
#116 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
118
Forks
14
Avg merge
10h 53m
Merged PRs (30d)
31

Description

Problem

The annotated output emitted by tilefoundry analyze --operands is not source-aligned with the authoring model. It prints lowered/expanded IR forms for operations that the tutorial author wrote in DSL syntax, so a reader cannot reliably map the report back to the model.

Reproduction

In the tutorial source, Stage4_WeightPrepared contains:

wq_local = tf.reshard(w_q, (1, HIDDEN, HIDDEN @ cta.head), "smem")

The corresponding annotated report prints an expanded form like:

v1 = reshard(w_q, layout=ShardLayout(
        layout=Layout((1, 256, 8, 32), None),
        attrs=(S(2),),
        mesh=cta,
    ), storage=smem)

Likewise, Stage5_CachePrepared authoring uses a Python slice:

k_cache[:, base : base + BLOCK, :, :]

but the report prints a generated IR operation:

v16 = slice(k_cache, (0, v15, 0, 0), sizes=(1, 128, 2, 32), strides=(1, 1, 1, 1))

Expected behavior

Provide one of these source-aligned forms in analysis output:

  1. Preserve the original authoring expression and source location alongside each report record.
  2. Add a stable source mapping from each generated IR call/value back to the authoring expression.
  3. Clearly label the output as lowered IR and provide a source-level rendering for tutorial/agent use.

The key requirement is that reshard layouts and tensor slices must not look like syntax sugar or unrelated operations: the report should explain their relationship to the authoring model and preserve enough information for an agent to navigate back to the source.

Context

This was found while rendering docs/tutorial/authoring.ipynb into the installed tutorial Markdown. The generated report is numerically useful, but its current representation is misleading for a syntax/tutorial page.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the tilefoundry analyze --operands entry point and the rendering path used for docs/tutorial/authoring.ipynb. Reproduce the report for Stage4_WeightPrepared and Stage5_CachePrepared, then trace how generated IR records relate to the authoring expressions. Done means the analysis output preserves or clearly maps reshard layouts and tensor slices back to source-level syntax and locations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.