From 44a235498ab54ffac97b7a0be659f6da83062d3f Mon Sep 17 00:00:00 2001 From: Onur Gündüz Date: Sat, 30 May 2026 11:11:42 +0200 Subject: dist: add distributed layer-slice foundation --- pplx_embed_mlx.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pplx_embed_mlx.h') diff --git a/pplx_embed_mlx.h b/pplx_embed_mlx.h index 9c0af9d..1ec6fab 100644 --- a/pplx_embed_mlx.h +++ b/pplx_embed_mlx.h @@ -45,6 +45,19 @@ int pplx_mlx_embed_into(pplx_mlx_ctx_t *ctx, const int *token_ids, int pplx_mlx_embed_batch(pplx_mlx_ctx_t *ctx, const pplx_input_t *inputs, int batch, float *out_embeddings); +/* + * MLX equivalent of pplx_model_forward_slice_batch(). + * + * Hidden states cross the API boundary as packed float32 rows even though MLX + * executes a padded dense batch internally. + */ +int pplx_mlx_forward_slice_batch(pplx_mlx_ctx_t *ctx, + const pplx_input_t *inputs, int batch, + const float *input_states, + int layer_start, int layer_end, + int apply_final_norm, + float *out_states); + /* * Run one contextual sequence and pool selected token spans. * Returns 0 on success, -1 on error. -- cgit v1.3.1