Skip to content

release: gen-worker 0.40.7 (gw#608 residual — process-global AOT-cache disable)#360

Merged
PaulFidika merged 2 commits into
masterfrom
release/gw608-0.40.7
Jul 21, 2026
Merged

release: gen-worker 0.40.7 (gw#608 residual — process-global AOT-cache disable)#360
PaulFidika merged 2 commits into
masterfrom
release/gw608-0.40.7

Conversation

@PaulFidika

Copy link
Copy Markdown
Contributor

The 0.40.5 live cross-host proof FAILED with the identical gw#608 signature
(cache_hits=0, cache_misses=8): the pack still contained 8 ASLR-keyed
inductor/aotautograd entries.

Root cause (found dry): torch 2.13 ConfigModule user overrides are ContextVars
(thread-local) — enable_autograd_cache=False set on the arming thread never
applied to the warmup-compile thread, and post-import TORCHINDUCTOR_AUTOGRAD_CACHE=0
is inert (env read once at torch import).

Fix (chaos dbd7d6b, cherry-picked): entrypoint sets TORCHINDUCTOR_AUTOGRAD_CACHE=0
before any torch import (binds all threads + compile-worker subprocesses);
_disable_aot_autograd_cache additionally mutates the installed config entry's
env_value_force (process-global, verified cross-thread). Revert-turns-red test
test_aot_autograd_cache_disabled_across_threads (verified: fails with the src
change reverted).

Ships as 0.40.7 from current master, which also carries PR#358's unpublished
0.40.6 bump (never tagged) and PR#359's greenfield test system.

Local (py3.12, torch 2.13, locked venv): 427 passed, 5 skipped, 1 xfailed.
Evidence: ~/cozy/samples/selfmint-proof/gw0405-run/RESULTS.md.

🤖 Generated with Claude Code

…3 config user overrides are thread-local ContextVars

Live disproof (0.40.5, B200, 2026-07-21): mint capture still packed 8
ASLR-keyed aotautograd entries and the store-served sibling still failed
(warmups=1, cache_hits=0, cache_misses=8) — the 0.40.4 disable ran on the
arming thread; the warmup compile thread saw the default True. The env var
is read once at torch import (env_name_force), so post-import it is inert.

Fix: entrypoint sets TORCHINDUCTOR_AUTOGRAD_CACHE=0 before any torch import
(binds all threads + compile-worker subprocesses); _disable_aot_autograd_cache
additionally mutates the installed config entry's env_value_force (process-
global) for already-imported-torch embedders. Cross-thread revert-turns-red
test added (fails on the 0.40.5 shape, passes with the fix).

Dry evidence: fxgraph keys 8/8 identical across ALL five banked packs
(0.40.1 x3 / 0.40.3 / 0.40.5); aotautograd level-2 keys 0/8 everywhere.
samples/selfmint-proof/gw0405-run/.
@PaulFidika
PaulFidika merged commit 101a9e8 into master Jul 21, 2026
1 check passed
@PaulFidika
PaulFidika deleted the release/gw608-0.40.7 branch July 21, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant