aboutsummaryrefslogtreecommitdiff
path: root/pplx_distributed.h
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-05-30 11:33:31 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-06-14 08:27:03 +0200
commit6c60a776d5f2f2f494d20072a595fa0e10dd51d1 (patch)
treee8a837dbe247e510287a5c14070f70a816b6e4a3 /pplx_distributed.h
parentf6e959455add3260a483c89e6fb9aa214d4e6789 (diff)
downloadffwd-6c60a776d5f2f2f494d20072a595fa0e10dd51d1.tar.gz
ffwd-6c60a776d5f2f2f494d20072a595fa0e10dd51d1.zip
dist: add direct two-node fp32 inference
Diffstat (limited to 'pplx_distributed.h')
-rw-r--r--pplx_distributed.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/pplx_distributed.h b/pplx_distributed.h
new file mode 100644
index 0000000..2979ede
--- /dev/null
+++ b/pplx_distributed.h
@@ -0,0 +1,34 @@
+/*
+ * pplx_distributed.h - Stateless two-node layer-sharded inference.
+ */
+
+#ifndef PPLX_DISTRIBUTED_H
+#define PPLX_DISTRIBUTED_H
+
+#include "pplx_embed.h"
+
+typedef struct pplx_dist_client pplx_dist_client_t;
+
+/*
+ * Open a coordinator-side connection. The coordinator owns layers
+ * [0, local_layer_end); the remote worker must own [local_layer_end, N).
+ */
+pplx_dist_client_t *pplx_dist_client_open(const char *model_dir,
+ const char *host, int port,
+ int local_layer_end, int use_mlx);
+void pplx_dist_client_free(pplx_dist_client_t *client);
+
+const pplx_config_t *pplx_dist_client_config(const pplx_dist_client_t *client);
+
+int pplx_dist_client_embed_batch(pplx_dist_client_t *client,
+ const pplx_input_t *inputs, int batch,
+ float *out_embeddings);
+
+/*
+ * Run a final-stage worker until the process is terminated. The worker owns
+ * [layer_start, layer_end), and layer_end must be the model's final layer.
+ */
+int pplx_dist_run_worker(const char *model_dir, const char *host, int port,
+ int layer_start, int layer_end, int use_mlx);
+
+#endif /* PPLX_DISTRIBUTED_H */