Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
5ae18e5
Define runtime transport layer interface for backline backends
josephleekl Jul 20, 2026
5e76333
update changelog
josephleekl Jul 20, 2026
279a2b4
comments
josephleekl Jul 20, 2026
a319b39
update changelog
josephleekl Jul 20, 2026
0bb4b19
Merge branch 'main' into josephleekl/transport-layer
josephleekl Jul 20, 2026
c523f67
Transport Layer Loader is added
rniczh Jul 20, 2026
2b88bd4
Merge branch 'main' into josephleekl/transport-layer
josephleekl Jul 20, 2026
8dccc62
update interface
rniczh Jul 20, 2026
fc399e9
Merge branch 'josephleekl/transport-layer' into rniczh/tranport-layer…
rniczh Jul 20, 2026
cdee60b
coprocessor backend interface is added
rniczh Jul 20, 2026
da41e92
chagne type
rniczh Jul 20, 2026
2b6c1e9
Merge branch 'josephleekl/transport-layer' into rniczh/tranport-layer…
rniczh Jul 20, 2026
6e942a9
remove redundancy
rniczh Jul 20, 2026
4408322
add start
rniczh Jul 20, 2026
5282f5a
update comment
rniczh Jul 20, 2026
2b36a11
Merge branch 'josephleekl/transport-layer' into rniczh/tranport-layer…
rniczh Jul 20, 2026
32fc6f2
update changelog
rniczh Jul 20, 2026
2fc50c3
update
rniczh Jul 20, 2026
4d211ce
update
rniczh Jul 20, 2026
060458b
remove redundancy
rniczh Jul 20, 2026
246a4b7
number of collection is always 1
rniczh Jul 20, 2026
22cd621
update interface
rniczh Jul 20, 2026
5b57ef4
Merge branch 'josephleekl/transport-layer' into rniczh/tranport-layer…
rniczh Jul 20, 2026
18c2684
Add transport dialect
mehrdad2m Jul 21, 2026
6984afa
Add transport-to-llvm pass
mehrdad2m Jul 21, 2026
7630570
Update runtime/include/Transport.hpp
rniczh Jul 21, 2026
da12f30
Apply suggestion from @mehrdad2m
rniczh Jul 21, 2026
5490f08
Apply suggestion from @mehrdad2m
rniczh Jul 21, 2026
5d639c5
Apply suggestion from @mehrdad2m
rniczh Jul 21, 2026
30ebdf0
Merge branch 'josephleekl/transport-layer' into rniczh/tranport-layer…
rniczh Jul 21, 2026
8979bfc
Merge branch 'main' into transport-dialect
mehrdad2m Jul 21, 2026
2d8991e
Merge branch 'transport-dialect' into transport-to-llvm-pass
mehrdad2m Jul 21, 2026
e04d7b2
Merge branch 'transport-to-llvm-pass' into rniczh/tranport-layer-loader
mehrdad2m Jul 21, 2026
fd17906
update
mehrdad2m Jul 22, 2026
9cd39b5
update
mehrdad2m Jul 22, 2026
c2c1c73
Merge branch 'transport-dialect' into transport-to-llvm-pass
mehrdad2m Jul 22, 2026
7b3ff71
update
mehrdad2m Jul 22, 2026
b09fcc5
Merge branch 'transport-to-llvm-pass' into rniczh/tranport-layer-loader
mehrdad2m Jul 22, 2026
bdfab4c
format
mehrdad2m Jul 22, 2026
b911d91
Merge branch 'transport-dialect' into transport-to-llvm-pass
mehrdad2m Jul 22, 2026
a515020
format
mehrdad2m Jul 22, 2026
6b84b8c
Merge branch 'transport-to-llvm-pass' into rniczh/tranport-layer-loader
mehrdad2m Jul 22, 2026
7e86066
Merge branch 'main' into transport-dialect
mehrdad2m Jul 22, 2026
e4a779b
add include to lsp
mehrdad2m Jul 23, 2026
44e0d6a
add changelog
mehrdad2m Jul 23, 2026
e34c06a
Refine transport dialect: string data_path, get_session, typed round …
mehrdad2m Jul 24, 2026
ed2a082
add tests
mehrdad2m Jul 24, 2026
a6493b2
fix
mehrdad2m Jul 24, 2026
56259d3
Merge branch 'transport-dialect' into transport-to-llvm-pass
mehrdad2m Jul 24, 2026
1c2ea7a
update get_session
mehrdad2m Jul 24, 2026
8887466
add changelog
mehrdad2m Jul 24, 2026
f6d1426
refine the CAPI
mehrdad2m Jul 24, 2026
266d3d9
Add tests
mehrdad2m Jul 24, 2026
61d3a0b
format
mehrdad2m Jul 24, 2026
a14e1fd
add tests
mehrdad2m Jul 24, 2026
747c0ed
format
mehrdad2m Jul 24, 2026
8f801e6
Merge branch 'transport-to-llvm-pass' into rniczh/tranport-layer-loader
mehrdad2m Jul 24, 2026
bfd710f
add inject-transport-session pass
mehrdad2m Jul 24, 2026
16e9f1f
add changelog
mehrdad2m Jul 24, 2026
718eedb
Merge branch 'main' into transport-dialect
mehrdad2m Jul 25, 2026
676c117
Merge branch 'transport-dialect' into transport-to-llvm-pass
mehrdad2m Jul 25, 2026
cb83699
Merge branch 'transport-to-llvm-pass' into rniczh/tranport-layer-loader
mehrdad2m Jul 25, 2026
ff8a253
format
mehrdad2m Jul 25, 2026
844eef2
Merge branch 'transport-dialect' into transport-to-llvm-pass
mehrdad2m Jul 25, 2026
cbb2c7a
Merge branch 'transport-to-llvm-pass' into rniczh/tranport-layer-loader
mehrdad2m Jul 25, 2026
0b0d0c0
format
mehrdad2m Jul 25, 2026
05195ab
Merge branch 'transport-to-llvm-pass' into rniczh/tranport-layer-loader
mehrdad2m Jul 25, 2026
4900c41
Merge branch 'rniczh/tranport-layer-loader' into inject-transport-ses…
mehrdad2m Jul 25, 2026
dfa0311
format
mehrdad2m Jul 25, 2026
a53549c
apply ne w catalyst-dev changes
mehrdad2m Jul 25, 2026
245af10
Merge branch 'transport-to-llvm-pass' into rniczh/tranport-layer-loader
mehrdad2m Jul 25, 2026
5bf2e4b
Merge branch 'rniczh/tranport-layer-loader' into inject-transport-ses…
mehrdad2m Jul 25, 2026
b01d828
Add ENABLE_TRANSPORT
mehrdad2m Jul 27, 2026
55ec769
Key transport string globals on their contents.
mehrdad2m Jul 27, 2026
bc198e6
add linking flag
mehrdad2m Jul 28, 2026
7384af3
modify
mehrdad2m Jul 29, 2026
ca07283
format
mehrdad2m Jul 29, 2026
579f706
minor
mehrdad2m Jul 29, 2026
7fac616
Merge branch 'main' into transport-to-llvm-pass
mehrdad2m Jul 29, 2026
c323c7a
Merge branch 'transport-to-llvm-pass' into rniczh/tranport-layer-loader
mehrdad2m Jul 29, 2026
a851d7e
Merge branch 'rniczh/tranport-layer-loader' into inject-transport-ses…
mehrdad2m Jul 29, 2026
1689712
Update mlir/lib/Transport/Transforms/TransportToLLVM.cpp
mehrdad2m Jul 30, 2026
68149c3
guard last_rtt_ns
rniczh Jul 30, 2026
b5fd401
formatted
rniczh Jul 30, 2026
45ffdd8
replace with isAlnum
mehrdad2m Jul 30, 2026
bbebcd2
drain pending tokens at destory
rniczh Jul 30, 2026
43a16e9
format
mehrdad2m Jul 30, 2026
7d5c424
resolve coprocessor lib
rniczh Jul 30, 2026
793d8bf
add warning
rniczh Jul 30, 2026
f59cd15
add test for draining pending tokens
rniczh Jul 30, 2026
5063573
cerr
rniczh Jul 30, 2026
f54830a
formatted
rniczh Jul 30, 2026
ee0b3bf
Merge branch 'transport-to-llvm-pass' into rniczh/tranport-layer-loader
mehrdad2m Jul 30, 2026
693ba96
Merge branch 'rniczh/tranport-layer-loader' into inject-transport-ses…
mehrdad2m Jul 30, 2026
8b46a2e
fix makefile
mehrdad2m Jul 30, 2026
bfec65d
Merge branch 'rniczh/tranport-layer-loader' into inject-transport-ses…
mehrdad2m Jul 30, 2026
be4b871
Merge branch 'main' into rniczh/tranport-layer-loader
rniczh Jul 30, 2026
23750e3
Merge branch 'rniczh/tranport-layer-loader' into inject-transport-ses…
mehrdad2m Jul 30, 2026
392cbdd
Add todo
rniczh Jul 30, 2026
4c635d7
rename as_controller
mehrdad2m Jul 30, 2026
b0e8b22
remove constexprs
mehrdad2m Jul 30, 2026
f52777d
format
mehrdad2m Jul 30, 2026
3d7a5fc
Merge branch 'rniczh/tranport-layer-loader' into inject-transport-ses…
mehrdad2m Jul 30, 2026
809817c
add const for messageByte size
mehrdad2m Jul 30, 2026
68469ff
format
mehrdad2m Jul 30, 2026
d495ccf
add constant for cpuverbs
mehrdad2m Jul 30, 2026
019e16b
add tests
mehrdad2m Jul 30, 2026
5c4395b
refactor into indicidual methods for each combination of ctrl/coproc
mehrdad2m Jul 31, 2026
0c51be5
format
mehrdad2m Jul 31, 2026
a1ff770
Merge branch 'main' into inject-transport-session
mehrdad2m Jul 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
transport runtime CAPI.
[(#3048)](https://github.com/PennyLaneAI/catalyst/pull/3048)

* An `inject-transport-session` pass is added, which reads the `catalyst.backline` module
attribute and emits the transport session lifecycle into the host entry function.
[(#3063)](https://github.com/PennyLaneAI/catalyst/pull/3063)

* A new remote/local executor infrastructure has been added to Catalyst, enabling qnode kernels to
be dispatched to a separate executor process.

Expand Down
2 changes: 2 additions & 0 deletions mlir/include/Transport/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ add_mlir_doc(TransportOps TransportOps Transport/ -gen-op-doc)
set(LLVM_TARGET_DEFINITIONS TransportOps.td)
mlir_tablegen(TransportEnums.h.inc -gen-enum-decls)
mlir_tablegen(TransportEnums.cpp.inc -gen-enum-defs)
mlir_tablegen(TransportAttributes.h.inc -gen-attrdef-decls -attrdefs-dialect=transport)
mlir_tablegen(TransportAttributes.cpp.inc -gen-attrdef-defs -attrdefs-dialect=transport)
add_public_tablegen_target(MLIRTransportEnumsIncGen)
67 changes: 67 additions & 0 deletions mlir/include/Transport/IR/TransportDialect.td
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def Transport_Dialect : Dialect {
let name = "transport";
let cppNamespace = "::catalyst::transport";
let useDefaultTypePrinterParser = 1;
let useDefaultAttributePrinterParser = 1;
let usePropertiesForAttributes = 1;
}

Expand Down Expand Up @@ -86,6 +87,72 @@ def Transport_CoprocessorSession : Type<
"::catalyst::transport::Role::Coprocessor">,
"coprocessor transport session">;

//===----------------------------------------------------------------------===//
// Attributes.
//===----------------------------------------------------------------------===//

class Transport_Attr<string name, string attrMnemonic, list<Trait> traits = []>
: AttrDef<Transport_Dialect, name, traits> {
let mnemonic = attrMnemonic;
}

// A string field that reads as empty when omitted, so consumers need no null checks.
def Transport_StrField : DefaultValuedParameter<"mlir::StringAttr",
"mlir::StringAttr::get($_ctxt, \"\")">;

def Transport_NodeAttr : Transport_Attr<"Node", "node"> {
let summary = "A backline participant: a controller or a coprocessor.";

let parameters = (ins
Transport_StrField:$name,
Transport_StrField:$peer,
OptionalParameter<"mlir::IntegerAttr">:$oob_port,
Transport_StrField:$backend_lib,
Transport_StrField:$config,
Transport_StrField:$data_path,
Transport_StrField:$triple,
Comment thread
multiphaseCFD marked this conversation as resolved.
Transport_StrField:$address,
Transport_StrField:$symbol,
OptionalParameter<"mlir::BoolAttr">:$remote,
OptionalParameter<"mlir::IntegerAttr">:$in_bytes,
OptionalParameter<"mlir::IntegerAttr">:$out_bytes,
OptionalParameter<"mlir::IntegerAttr">:$work_item_idx
);

let assemblyFormat = "`<` struct(params) `>`";

let extraClassDeclaration = [{
/// Session registry key: `name` when set and non-empty, else `fallback`.
mlir::StringAttr keyOr(llvm::StringRef fallback) const;

/// `data_path` when set, else `dflt`.
mlir::StringAttr dataPathOr(llvm::StringRef dflt) const;

/// True only when `remote` is present and set.
bool isRemote() const;

/// Integer fields, with the defaults applied.
int64_t oobPort() const;
int64_t inBytes() const;
int64_t outBytes() const;
int64_t workItemIdx() const;
}];
}

def Transport_BacklineAttr : Transport_Attr<"Backline", "backline"> {
let summary = "A backline placement: one controller and the coprocessors it drives.";

let parameters = (ins
"mlir::StringAttr":$transport,
"::catalyst::transport::NodeAttr":$controller,
OptionalArrayRefParameter<"::catalyst::transport::NodeAttr">:$coprocessors
);

let assemblyFormat = [{ `<` `transport` `=` $transport `,` `controller` `=` $controller
(`,` `coprocessors` `=` `[` $coprocessors^ `]`)? `>` }];
let genVerifyDecl = 1;
}

//===----------------------------------------------------------------------===//
// Operation base.
//===----------------------------------------------------------------------===//
Expand Down
3 changes: 3 additions & 0 deletions mlir/include/Transport/IR/TransportOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@

#include "Transport/IR/TransportDialect.h"

#define GET_ATTRDEF_CLASSES
#include "Transport/IR/TransportAttributes.h.inc"

#define GET_OP_CLASSES
#include "Transport/IR/TransportOps.h.inc"
13 changes: 13 additions & 0 deletions mlir/include/Transport/Transforms/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,17 @@ def ConvertTransportToLLVMPass : Pass<"convert-transport-to-llvm", "mlir::Module
];
}

def InjectTransportSessionPass : Pass<"inject-transport-session", "mlir::ModuleOp"> {
let summary = "Emit transport session bring-up/teardown from a catalyst.backline attribute.";
let description = [{
Reads the `catalyst.backline` module attribute and injects the session
lifecycle into the host entry function.
}];

let dependentDialects = [
"::catalyst::transport::TransportDialect",
"mlir::func::FuncDialect"
];
}

#endif // TRANSPORT_PASSES
65 changes: 65 additions & 0 deletions mlir/lib/Transport/IR/TransportDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,78 @@ using namespace catalyst::transport;
#define GET_TYPEDEF_CLASSES
#include "Transport/IR/TransportOpsTypes.cpp.inc"

//===----------------------------------------------------------------------===//
// Transport attribute definitions.
//===----------------------------------------------------------------------===//

#define GET_ATTRDEF_CLASSES
#include "Transport/IR/TransportAttributes.cpp.inc"

StringAttr NodeAttr::keyOr(llvm::StringRef fallback) const
{
if (StringAttr n = getName(); n && !n.getValue().empty()) {
return n;
}
return StringAttr::get(getContext(), fallback);
}

StringAttr NodeAttr::dataPathOr(llvm::StringRef dflt) const
{
if (StringAttr p = getDataPath(); p && !p.getValue().empty()) {
return p;
}
return StringAttr::get(getContext(), dflt);
}

bool NodeAttr::isRemote() const
{
BoolAttr r = getRemote();
return r && r.getValue();
}

static int64_t intOr(IntegerAttr field, int64_t dflt) { return field ? field.getInt() : dflt; }

// Default per-message payload width, matching the current backend's defaults.
constexpr int64_t kDefaultMessageBytes = 8;

int64_t NodeAttr::oobPort() const { return intOr(getOobPort(), 0); }
int64_t NodeAttr::inBytes() const { return intOr(getInBytes(), kDefaultMessageBytes); }
int64_t NodeAttr::outBytes() const { return intOr(getOutBytes(), kDefaultMessageBytes); }
int64_t NodeAttr::workItemIdx() const { return intOr(getWorkItemIdx(), 0); }

LogicalResult BacklineAttr::verify(function_ref<InFlightDiagnostic()> emitError,
StringAttr transport, NodeAttr controller,
llvm::ArrayRef<NodeAttr> coprocessors)
{
if (!controller) {
return emitError() << "backline requires a controller";
}
for (NodeAttr c : coprocessors) {
Comment thread
multiphaseCFD marked this conversation as resolved.
if (!c) {
return emitError() << "null coprocessor";
}
if (!c.getPeer() || c.getPeer().getValue().empty()) {
return emitError() << "coprocessor requires a 'peer'";
}
if (!c.getSymbol() || c.getSymbol().getValue().empty()) {
return emitError() << "coprocessor requires a 'symbol'";
}
}
return success();
}

void TransportDialect::initialize()
{
addTypes<
#define GET_TYPEDEF_LIST
#include "Transport/IR/TransportOpsTypes.cpp.inc"
>();

addAttributes<
#define GET_ATTRDEF_LIST
#include "Transport/IR/TransportAttributes.cpp.inc"
>();

addOperations<
#define GET_OP_LIST
#include "Transport/IR/TransportOps.cpp.inc"
Expand Down
1 change: 1 addition & 0 deletions mlir/lib/Transport/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ set(LIBRARY_NAME transport-transforms)

file(GLOB SRC
TransportToLLVM.cpp
InjectTransportSession.cpp
)

get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
Expand Down
Loading
Loading