Skip to content

fix(compile): assert mode names a cache dir no bake wrote instead of the first file it misses - #117

Merged
jiahy0825 merged 1 commit into
mainfrom
fix/assert-cache-hit-names-missing-dir
Nov 26, 2026
Merged

jiahy0825 merged 1 commit into
mainfrom
fix/assert-cache-hit-names-missing-dir

Conversation

@cennn

@cennn cennn commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

🗂️ PR Category

  • ✨ New Feature
  • 🚀 Optimization (performance, memory, etc.)
  • 💥 Breaking Change
  • 🐛 Bug Fix
  • 🛠️ Development / Refactoring
  • 📚 Documentation
  • 🧹 Chore (Dependencies, CI/CD, Configuration, etc.)
  • 🧪 Testing

📝 Description

With MAGI_COMPILE_ASSERT_CACHE_HIT=1, a verify whose compile hash differs from the bake's opens a cache directory that no bake ever wrote. Every lookup there misses, and the error used to name whichever file was read first: offload host_slots sidecar missing when graph weight offload is on, or cache miss for runtime_shape=... graph_index=... otherwise. Both point at one broken file or subgraph, while the real cause is that the hash itself changed, e.g. a GPU that reports a different device name than the bake machine (the device name is part of Inductor's system key).

When subgraph_indices.py is absent from the cache directory, both assert paths now raise:

MAGI_COMPILE_ASSERT_CACHE_HIT: no compile cache under <cache_dir>: nothing was baked under this hash, which covers the compile and Inductor configs, the device name, the torch build, the traced code, and the graph and its inputs. Re-bake the compile cache.

Only the message changes; hit, miss and recompile behavior is untouched. A directory that was baked but lacks the sidecar, or a sidecar miss on another rank, still reports the original reason. test_bind_miss_raises_when_assert_cache_hit now covers both the unbaked directory and the baked-index-without-sidecar case.

@cennn cennn added the ci:run Trigger CI integration tests label Nov 26, 2026
@github-actions github-actions Bot removed the ci:run Trigger CI integration tests label Nov 26, 2026

@jiahy0825 jiahy0825 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jiahy0825
jiahy0825 merged commit ba21ef9 into main Nov 26, 2026
39 of 41 checks passed
@jiahy0825
jiahy0825 deleted the fix/assert-cache-hit-names-missing-dir branch November 26, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants