Repository navigation
TACK_LOG_COMPILES: a line per new variant, naming what made it new (#325) - #516
Open
berkgeveci wants to merge 1 commit into
Open
berkgeveci wants to merge 1 commit into
berkgeveci wants to merge 1 commit into
Conversation
…itware#325) variant_key_parts, beside kernel_variant_key, names each position of the real key (parameters' types and kinds, vector widths, each template's class, constants, arrays, runtime scalars, function attributes and nested classes, baked dimensions, the disjoint flag). With TACK_LOG_COMPILES=1 the slow path writes one stderr line per variant it builds or loads: the parts changed since the kernel's last logged variant on the device, the outcome, the variant count and the host time of the frontend, passes, backend and disk stages; a failed build logs its stage and keeps its error. Calls that find their variant log nothing; _fast_resolve is unchanged. Class tokens carry a name and a serial so a class defined afresh under the same name is told apart.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #325 (v1: the named key parts and the compile log; see below for what is left out).
With
TACK_LOG_COMPILES=1, every call that makes a new kernel variant writes one line to stderr:What
variant_key_parts, besidekernel_variant_key, names each position of the real key. It covers the parameters' types and kinds, the vector widths, and each template's class, class constants, arrays (type and rank), runtime scalars, function attributes and nested classes. It also covers the baked dimensions (fromir_shape_deps) and the disjoint flag. It reads the key; it never walks the arguments again, so it cannot drift. A key part it does not know is shown by its position.runtime/compile_log.py: the line compares the new variant with the last one logged for the kernel on the device. That baseline is not the last call, since calls that find their variant log nothing.built;loadedfrom the disk cache (no passes, though Metal and CUDA may still compile what was stored); orfailed-in-passes/failed-in-backend, with the original error kept.Model#1 -> Model#2tells a class defined afresh from one of the same name. Key equality stays identity._fast_resolve) is unchanged. The slow path takes timestamps only while the log is on, and the passes and build moved into_built_variantunchanged.Not in this PR
tack.cache.captureandtack.cache.variants(), the issue's third item. The proposal's review (vault, 2026-10-31) deferred them until the log proves insufficient.Tests
test_compile_log.py(quick):loaded.Results (CPU, M1 Max):
mkdocs build --strictare clean.Docs
TACK_LOG_COMPILESrow in the runtime contract's environment table;It already found one baked size: flying edges'
_points, fixed for 0.8 in #515.This will be merged after the 0.8 release.
🤖 Generated with Claude Code