Skip to content

Commit caba147

Browse files
committed
ci: isolate AMX input layout failure and validate contiguous projection
1 parent f9b62cd commit caba147

3 files changed

Lines changed: 43 additions & 1 deletion

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/src/models/mamba-base.cpp b/src/models/mamba-base.cpp
2+
index 03ee3805b..9deff6629 100644
3+
--- a/src/models/mamba-base.cpp
4+
+++ b/src/models/mamba-base.cpp
5+
@@ -103,7 +103,7 @@ ggml_tensor * llm_build_mamba_base::build_mamba_layer(llm_graph_input_rs * inp,
6+
}
7+
8+
// {dt_rank, d_inner} @ {dt_rank, n_seq_tokens, n_seqs} => {d_inner, n_seq_tokens, n_seqs}
9+
- dt = build_lora_mm(layer.ssm_dt, dt);
10+
+ dt = build_lora_mm(layer.ssm_dt, ggml_cont(ctx0, dt));
11+
dt = ggml_add(ctx0, dt, layer.ssm_dt_b);
12+
13+
cur = x;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/ggml/src/ggml-backend.cpp b/ggml/src/ggml-backend.cpp
2+
index 6862128e6..6e130c76d 100644
3+
--- a/ggml/src/ggml-backend.cpp
4+
+++ b/ggml/src/ggml-backend.cpp
5+
@@ -1291,7 +1291,14 @@ void ggml_backend_sched_split_graph(ggml_backend_sched_t sched, struct ggml_cgra
6+
for (int b = 0; b < sched->n_backends && *cur_backend_id == -1; b++) {
7+
ggml_backend_sched_set_if_supported(sched, node, b, cur_backend_id);
8+
}
9+
- GGML_ASSERT(*cur_backend_id != -1);
10+
+ if (*cur_backend_id == -1) {
11+
+ GGML_ABORT("no backend for %s (%s); src0=%s buffer=%s; src1=%s contiguous=%d",
12+
+ node->name, ggml_op_name(node->op),
13+
+ node->src[0] ? node->src[0]->name : "none",
14+
+ node->src[0] && node->src[0]->buffer ? ggml_backend_buffer_name(node->src[0]->buffer) : "none",
15+
+ node->src[1] ? node->src[1]->name : "none",
16+
+ node->src[1] ? ggml_is_contiguous(node->src[1]) : 0);
17+
+ }
18+
}
19+
20+
// pass 5: split graph, find tensors that need to be copied

.github/workflows/debug-recurrent.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,18 @@ jobs:
2828
key: ${{ runner.os }}-model-qwen35-q8-mamba130m-q2-falconh1tiny-q2-bge-small-q4
2929
- name: CPU details
3030
run: lscpu
31+
- name: Add native diagnostics
32+
run: git -C vendor/llama.cpp apply "$GITHUB_WORKSPACE/.github/scripts/recurrent-diagnostic.patch"
3133
- name: Build
3234
run: |
3335
python -m pip install uv
34-
python -m uv pip install --system -e '.[all]' --verbose
36+
python -m uv pip install --system -e '.[all]' --verbose --config-settings=build-dir=build-diagnostic
3537
- name: Test with abort diagnostics
38+
continue-on-error: true
39+
run: python .github/scripts/diagnose-recurrent.py
40+
- name: Test contiguous projection input fix
41+
run: |
42+
git -C vendor/llama.cpp apply "$GITHUB_WORKSPACE/.github/scripts/mamba-contiguous.patch"
43+
python -m uv pip install --system --reinstall-package llama-cpp-python -e '.[all]' --verbose --config-settings=build-dir=build-diagnostic
44+
- name: Verify fixed model
3645
run: python .github/scripts/diagnose-recurrent.py

0 commit comments

Comments
 (0)