aboutsummaryrefslogtreecommitdiff
path: root/tests/test_safetensors.c
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-06-10 15:31:32 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-06-14 08:27:03 +0200
commit5f73e5dc901f47cda6b2a26eea31cf9fc6178bc7 (patch)
tree42538d32a09d9bdc560c0ff4f5a7d74fa140ca7a /tests/test_safetensors.c
parentb1742da3868a3594b4e78be64e1412356d95dbd7 (diff)
downloadffwd-5f73e5dc901f47cda6b2a26eea31cf9fc6178bc7.tar.gz
ffwd-5f73e5dc901f47cda6b2a26eea31cf9fc6178bc7.zip
tests: threaded kernel paths, bf16 widen, shard payload accounting
Diffstat (limited to 'tests/test_safetensors.c')
-rw-r--r--tests/test_safetensors.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_safetensors.c b/tests/test_safetensors.c
index 401aab3..fea570b 100644
--- a/tests/test_safetensors.c
+++ b/tests/test_safetensors.c
@@ -109,6 +109,18 @@ int main(void)
ONE_TENSOR_B, zeros, 4);
check("multi", path_in("valid_multi"), 1);
+ /* Payload accounting across shards: two 4-byte F32 tensors. */
+ {
+ multi_safetensors_t *ms = multi_safetensors_open(path_in("valid_multi"));
+ size_t nbytes = 0;
+ if (!ms || multi_safetensors_data_nbytes(ms, &nbytes) != 0 ||
+ nbytes != 8) {
+ fprintf(stderr, "multi data_nbytes: got %zu want 8\n", nbytes);
+ failures++;
+ }
+ multi_safetensors_close(ms);
+ }
+
mkdir(path_in("missing"), 0755);
write_st(path_in("missing/model-00001-of-00002.safetensors"),
ONE_TENSOR_X, zeros, 4);