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:
- Preserve the original authoring expression and source location alongside each report record.
- Add a stable source mapping from each generated IR call/value back to the authoring expression.
- 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.
Problem
The annotated output emitted by
tilefoundry analyze --operandsis 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_WeightPreparedcontains:The corresponding annotated report prints an expanded form like:
Likewise,
Stage5_CachePreparedauthoring uses a Python slice:but the report prints a generated IR operation:
Expected behavior
Provide one of these source-aligned forms in analysis output:
The key requirement is that
reshardlayouts 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.ipynbinto the installed tutorial Markdown. The generated report is numerically useful, but its current representation is misleading for a syntax/tutorial page.