Skip to content

Add experimental support for externalizing graphs to a separate artifact - #77

Open
jakesabathia2 wants to merge 1 commit into
apple:mainfrom
jakesabathia2:dev/henry/externalize-graphs-to-artifact
Open

jakesabathia2 wants to merge 1 commit into
apple:mainfrom
jakesabathia2:dev/henry/externalize-graphs-to-artifact

Conversation

@jakesabathia2

@jakesabathia2 jakesabathia2 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor
  • Adds two experimental TorchConverter SPI hooks that act on the ops a named nn.Module class
    contributed
    , identified by nn_module_stack attribution once the graph body is built:
API Effect
_set_delegate_id(class_name, target) put all ops in the subgraph into a single coreai.isolated_group<target> graph
_set_externalize_group(class_name, namespace, *, externalize=True) moves them into their own coreai.graph (marked externalize, inside namespace) and replaces them with a coreai.invoke
_set_externalize_name_map(mapping) pins outlined graph symbols when the traced module path is not the name the artifact uses
  • Important to note that the SPIs are experimental and no guaranteed of not breaking in the future.
  • I did try to integrate the feature with the existing externalize APIs - however, the solution become super tedious and need tons of model reauthorizing at the source torch model level - hence I decided to introduce this new approach 😄 Need more discussion to put this into production.
  • Make debug info infra faster

@jakesabathia2
jakesabathia2 marked this pull request as draft September 1, 2026 23:26
@jakesabathia2
jakesabathia2 force-pushed the dev/henry/externalize-graphs-to-artifact branch 7 times, most recently from cebe348 to 9cfa1ec Compare September 7, 2026 07:12
@jakesabathia2
jakesabathia2 marked this pull request as ready for review September 7, 2026 07:12
@jakesabathia2
jakesabathia2 force-pushed the dev/henry/externalize-graphs-to-artifact branch from 9cfa1ec to 8ac4567 Compare September 7, 2026 07:36
@jakesabathia2
jakesabathia2 force-pushed the dev/henry/externalize-graphs-to-artifact branch from 2f13e02 to 80241db Compare September 9, 2026 23:09
@jakesabathia2
jakesabathia2 force-pushed the dev/henry/externalize-graphs-to-artifact branch 3 times, most recently from c178308 to 5ddbd55 Compare September 10, 2026 16:44
@jakesabathia2
jakesabathia2 force-pushed the dev/henry/externalize-graphs-to-artifact branch from 5ddbd55 to 42fbd03 Compare September 11, 2026 22:09
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.

3 participants