TECHNOLOGY

ZenML cache dependencies: a changed prompt file needs an explicit invalidation boundary

In this article
THE QUICK TAKE

A step body is not its whole dependency graph; declare additional file or source dependencies when they change the intended result.

The template changes outside the step body

A label-generation step reads a prompt template from the project and calls a helper that constructs its request. The step function remains unchanged while an editor revises the template. A reused output can then represent the earlier prompt even though the current project directory shows the new wording.

Identify the exact dependency responsible for the semantic change. Template text, helper implementation and external model response are different inputs to the explanation. A cache policy should express the dependencies it can track rather than treating every unchanged function body as unchanged behavior.

Declare the relevant file content

The ZenML caching guide documents file_dependencies and explains their source-root-relative paths. Their file contents participate in the cache identity. This provides a specific mechanism for a project asset that affects the step’s intended output.

Check the path relative to the configured source root, not merely relative to the shell directory used during development. A dependency that points at the wrong file can create misleading confidence while the real template continues to change outside the declared boundary.

Include helper source deliberately

The same guide describes source_dependencies for additional Python objects. The source reference guide explains how source paths identify code. Use importable, intentional references rather than assuming every transitively called helper is automatically part of the desired cache contract.

For an evaluation helper, preserve the versioned semantic role alongside its code identity. Label taxonomy mapping illustrates why a renamed category and a changed target meaning should not be treated as interchangeable edits.

External behavior needs another boundary

The execution guide describes step execution and materialized outputs. Declaring a local template does not snapshot a changing external model endpoint or database. The caching documentation separately warns that filesystem and external API changes are not discovered automatically in general.

Choose explicit external revisions or an appropriate fresh-execution policy when necessary. A local dependency hash is useful evidence about the template, not a guarantee that every request to a remote system would produce the same response.

Test the intended invalidation

Change a recognizable part of the declared template and verify that the step no longer reuses the earlier output under the intended policy. Then inspect which prompt identity is attached to the generated labels.

Use dataset evidence documentation to describe those labels’ origin. Correct invalidation establishes that the intended procedure ran; it does not establish that automatically generated labels are correct for the target task.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles