File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" ]))
Original file line number Diff line number Diff line change 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 :
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
You can’t perform that action at this time.
0 commit comments