Repository navigation
[Frontend] Drop unused TOG host-cflags/ldflags config (issue #239) - #247
Merged
Merged
Conversation
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>
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.
Summary
Removes
CONFIG_TORCHSIM_TOG_HOST_{CC,CFLAGS,LDFLAGS}and the two_default_tog_host_{cflags,ldflags}()helpers fromPyTorchSimFrontend/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 anif 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.grepacross.py/.cc/.cpp/.h*shows the threeCONFIG_TORCHSIM_TOG_HOST_*names are referenced only at the definition site.MLIRCodeCache._load_library(the natural caller) is still apassstub. So no*_tog.sois actually being compiled with-Og; the perf cost the issue describes never materialised.Tracing
git log -S "if True: #int(os.environ": introduced in54ccd4c("[Frontend] Put TorchInductor cache under TORCHSIM_DUMP_PATH", 2026-04-07), where the helpers were added as a side change alongside the mainTORCHINDUCTOR_CACHE_DIRrewrite and never wired up.Future-proofing
If the host-side TOG
.socompile 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.claude/, untracked)🤖 Generated with Claude Code