Skip to content

Commit f9b62cd

Browse files
committed
ci: capture native abort messages across Linux runners
1 parent 70b1b8f commit f9b62cd

2 files changed

Lines changed: 32 additions & 4 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import ctypes
2+
import os
3+
import subprocess
4+
import sys
5+
6+
if len(sys.argv) == 1:
7+
for iteration in range(5):
8+
print(f"Captured test iteration {iteration + 1}", flush=True)
9+
result = subprocess.run([sys.executable, __file__, "once"])
10+
if result.returncode:
11+
raise SystemExit(result.returncode)
12+
raise SystemExit(0)
13+
14+
import llama_cpp.llama_cpp as lc
15+
import pytest
16+
17+
stderr = os.dup(2)
18+
19+
20+
@ctypes.CFUNCTYPE(None, ctypes.c_char_p)
21+
def report_abort(message):
22+
os.write(stderr, b"NATIVE ABORT: " + message + b"\n")
23+
24+
25+
lc._lib.ggml_set_abort_callback.argtypes = [type(report_abort)]
26+
lc._lib.ggml_set_abort_callback.restype = ctypes.c_void_p
27+
lc._lib.ggml_set_abort_callback(report_abort)
28+
raise SystemExit(pytest.main(["-q", "-x"]))

‎.github/workflows/debug-recurrent.yaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
native: ["ON", "OFF"]
15+
trial: [1, 2, 3, 4]
1616
env:
17-
CMAKE_ARGS: -DGGML_NATIVE=${{ matrix.native }}
17+
CMAKE_ARGS: -DGGML_NATIVE=ON
1818
steps:
1919
- uses: actions/checkout@v6
2020
with:
@@ -32,5 +32,5 @@ jobs:
3232
run: |
3333
python -m pip install uv
3434
python -m uv pip install --system -e '.[all]' --verbose
35-
- name: Test without native stderr capture
36-
run: python -m pytest -s -v -x
35+
- name: Test with abort diagnostics
36+
run: python .github/scripts/diagnose-recurrent.py

0 commit comments

Comments
 (0)