Skip to content

Add inject-transport-session pass to emit transport session IR - #3063

Merged
mlxd merged 110 commits into
mainfrom
inject-transport-session
Jul 31, 2026
Merged

Add inject-transport-session pass to emit transport session IR#3063
mlxd merged 110 commits into
mainfrom
inject-transport-session

Conversation

@mehrdad2m

@mehrdad2m mehrdad2m commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Context:
Backline places a QNode's controller and its coprocessors on separate executors that talk over a transport. The placement is serialized onto the module as the catalyst.backline attribute (controller + coprocessors + per-node backend/peer/triple/data-path info). This pass turns that declarative attribute into the concrete transport-dialect session lifecycle, wired into the setup/teardown functions the runtime already calls around every execution.

Description of the Change:
Reading catalyst.backline, the pass injects, per session:

bring-up into @setup: transport.createconnectexchange_keysestablish_channelcommit_work_item (controller) / set_coprocessor_fn (coprocessor) → start
tear-down into @teardown: get_sessionstopdestroy

Topologies handled:

  • Controller-only: single controller session, straight-line bring-up/teardown.
  • Local coprocessors: controller + coprocessor sessions created together in the host @setup; the coprocessor's connect/exchange_keys run async so the two ends handshake concurrently.
  • Remote coprocessors: each coprocessor's ops go into a generated module_coproc tagged with its catalyst.target triple and catalyst.dispatch address; the host launches coproc_serve (nonblocking) / coproc_stop.
  • Remote controller: the controller's ops go into its role-tagged target module as setup_transport/teardown_transport and the host @setup/@teardown become the single orchestration point that launches every dispatched role in dependency order (serve → controller setup; coproc stop → controller teardown), and @setup is marked catalyst.backline_bringup so the object-shipping pass knows where to ship from.

Benefits:

Possible Drawbacks:

Related GitHub Issues:

josephleekl and others added 30 commits July 20, 2026 13:24
Assisted-by: Claude Opus 4.8
Assisted-by: Claude Opus 4.8
Co-authored-by: Mehrdad Malek <39844030+mehrdad2m@users.noreply.github.com>
Co-authored-by: Mehrdad Malek <39844030+mehrdad2m@users.noreply.github.com>
Co-authored-by: Mehrdad Malek <39844030+mehrdad2m@users.noreply.github.com>
Co-authored-by: Mehrdad Malek <39844030+mehrdad2m@users.noreply.github.com>

@rniczh rniczh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @mehrdad2m

Comment thread mlir/lib/Transport/IR/TransportDialect.cpp Outdated
Comment thread mlir/lib/Transport/Transforms/InjectTransportSession.cpp Outdated
Base automatically changed from rniczh/tranport-layer-loader to main July 30, 2026 20:41

@multiphaseCFD multiphaseCFD left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @mehrdad2m ! Nice work!

@mlxd
mlxd merged commit fae7c7f into main Jul 31, 2026
37 of 39 checks passed
@mlxd
mlxd deleted the inject-transport-session branch July 31, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants