Skip to content

[Frontend] Drop unused TOG host-cflags/ldflags config (issue #239) - #247

Merged
YWHyuk merged 1 commit into
developfrom
bugfix/issue-239-drop-dead-tog-host-config
May 26, 2026
Merged

YWHyuk merged 1 commit into
developfrom
bugfix/issue-239-drop-dead-tog-host-config

Conversation

@YWHyuk

@YWHyuk YWHyuk commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Removes CONFIG_TORCHSIM_TOG_HOST_{CC,CFLAGS,LDFLAGS} and the two _default_tog_host_{cflags,ldflags}() helpers from PyTorchSimFrontend/extension_config.py. Net diff: 1 file changed, 31 deletions(-).

Closes #239.

Why drop instead of restoring the env-var gate

Issue #239 reports that _default_tog_host_cflags() carries an if True: #int(os.environ.get("TORCHSIM_TOG_SO_DEBUG", "0")): shortcut and proposes restoring the original env-var gate. That fix would be correct if the constant were consumed — but it isn't.

grep across .py/.cc/.cpp/.h* shows the three CONFIG_TORCHSIM_TOG_HOST_* names are referenced only at the definition site. MLIRCodeCache._load_library (the natural caller) is still a pass stub. So no *_tog.so is actually being compiled with -Og; the perf cost the issue describes never materialised.

Tracing git log -S "if True: #int(os.environ": introduced in 54ccd4c ("[Frontend] Put TorchInductor cache under TORCHSIM_DUMP_PATH", 2026-04-07), where the helpers were added as a side change alongside the main TORCHINDUCTOR_CACHE_DIR rewrite and never wired up.

Future-proofing

If the host-side TOG .so compile path is wired up later, the env-var gate should be reintroduced at the actual call site (or near it), not as orphan module-level constants.

Test plan

  • python3 -m py_compile PyTorchSimFrontend/extension_config.py
  • Grep for residual references across the repo — clean (only a stale memory note in .claude/, untracked)

🤖 Generated with Claude Code

CONFIG_TORCHSIM_TOG_HOST_{CC,CFLAGS,LDFLAGS} were added in 54ccd4c but
no caller ever consumed them; MLIRCodeCache._load_library is still
`pass`. Issue #239 flagged the `if True:` shortcut in
_default_tog_host_cflags, but the helper's return value is never read,
so no .so is actually compiled with `-Og` as the issue assumed —
removing the whole block is the honest fix instead of restoring the
env-var gate around code nothing calls. If a host-side TOG .so compile
path lands later, the gate can be reintroduced at the real call site.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@YWHyuk
YWHyuk merged commit 8764b3c into develop May 26, 2026
@YWHyuk
YWHyuk deleted the bugfix/issue-239-drop-dead-tog-host-config branch May 26, 2026 14:45
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