aboutsummaryrefslogtreecommitdiff
path: root/embed.c
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-06-11 15:34:50 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-06-14 08:27:03 +0200
commit6b3c4bb1482917e4fb24480a1d082da5f191467b (patch)
tree6a29d58959d1c5d3a0febcc9cb06005ac5a009ed /embed.c
parent54e6e6bbef396eb1d38c09517d8157301fb8f151 (diff)
downloadffwd-6b3c4bb1482917e4fb24480a1d082da5f191467b.tar.gz
ffwd-6b3c4bb1482917e4fb24480a1d082da5f191467b.zip
dist: remove distributed layer-sharding (protocol, CLI flags, slice APIs)
Diffstat (limited to 'embed.c')
-rw-r--r--embed.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/embed.c b/embed.c
index f2b3724..76ca4e2 100644
--- a/embed.c
+++ b/embed.c
@@ -717,12 +717,6 @@ pplx_model_t *pplx_model_load(const char *model_dir)
return model_load_range_ex(model_dir, 0, -1, 0);
}
-pplx_model_t *pplx_model_load_slice(const char *model_dir,
- int layer_start, int layer_end)
-{
- return model_load_range_ex(model_dir, layer_start, layer_end, 0);
-}
-
void pplx_model_free(pplx_model_t *model)
{
if (!model) return;
@@ -1442,42 +1436,6 @@ int pplx_model_embed_batch(const pplx_model_t *model, pplx_workspace_t *ws,
return rc;
}
-int pplx_model_forward_slice_batch(const pplx_model_t *model,
- pplx_workspace_t *ws,
- const pplx_input_t *inputs, int batch,
- const float *input_states,
- int layer_start, int layer_end,
- int apply_final_norm,
- float *out_states)
-{
- if (!model || !ws || !inputs || batch <= 0 || !out_states ||
- layer_start < 0 || layer_start > layer_end ||
- layer_end > model->config.n_layers)
- return -1;
-
- if (ensure_offsets(ws, batch) != 0) return -1;
- int *offsets = ws->offsets;
-
- int total_seq = 0;
- int max_seq = 0;
- if (build_offsets(inputs, batch, layer_start == 0, offsets,
- &total_seq, &max_seq) != 0)
- return -1;
-
- int rc = forward_packed_slice_inplace(model, ws, inputs, batch, offsets,
- total_seq, max_seq, input_states,
- layer_start, layer_end,
- apply_final_norm);
- if (rc == 0) {
- size_t count;
- if (mul_size((size_t)total_seq,
- (size_t)model->config.hidden_size, &count) != 0)
- return -1;
- memcpy(out_states, ws->x, count * sizeof(float));
- }
- return rc;
-}
-
int pplx_pool_batch(const pplx_config_t *cfg, const float *states,
const int *seq_lengths, int batch,
float *out_embeddings)