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+ name : Diagnose recurrent Linux abort
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ branches :
7+ - test/diagnose-linux-recurrent-abort
8+
9+ jobs :
10+ diagnose :
11+ runs-on : ubuntu-latest
12+ strategy :
13+ fail-fast : false
14+ matrix :
15+ include :
16+ - name : native-repack
17+ cmake-args : -DGGML_NATIVE=ON -DGGML_CPU_REPACK=ON
18+ - name : generic-repack
19+ cmake-args : -DGGML_NATIVE=OFF -DGGML_CPU_REPACK=ON
20+ - name : native-no-repack
21+ cmake-args : -DGGML_NATIVE=ON -DGGML_CPU_REPACK=OFF
22+ name : ${{ matrix.name }}
23+ steps :
24+ - uses : actions/checkout@v6
25+ with :
26+ submodules : recursive
27+
28+ - name : Set up Python
29+ uses : actions/setup-python@v6
30+ with :
31+ python-version : " 3.11"
32+
33+ - name : Show runner CPU
34+ run : lscpu
35+
36+ - name : Install debugger
37+ run : |
38+ sudo apt-get update
39+ sudo apt-get install --yes gdb
40+
41+ - name : Build package
42+ env :
43+ CMAKE_ARGS : ${{ matrix.cmake-args }}
44+ run : |
45+ python -m pip install --upgrade pip
46+ python -m pip install uv
47+ python -m uv pip install -e '.[all]' --verbose
48+
49+ - name : Reproduce with native diagnostics
50+ continue-on-error : true
51+ run : python tests/diagnose_recurrent_context.py
52+
53+ - name : Capture native backtrace
54+ continue-on-error : true
55+ run : |
56+ gdb --batch \
57+ -ex "set pagination off" \
58+ -ex run \
59+ -ex "thread apply all bt" \
60+ --args python tests/diagnose_recurrent_context.py
Original file line number Diff line number Diff line change 1+ import hashlib
2+ import multiprocessing
3+
4+ from huggingface_hub import hf_hub_download
5+
6+ import llama_cpp
7+
8+
9+ model_path = hf_hub_download (
10+ repo_id = "QuantFactory/mamba-130m-hf-GGUF" ,
11+ filename = "mamba-130m-hf.Q2_K.gguf" ,
12+ )
13+
14+ with open (model_path , "rb" ) as model_file :
15+ model_sha256 = hashlib .file_digest (model_file , "sha256" ).hexdigest ()
16+
17+ print (f"model_path={ model_path } " , flush = True )
18+ print (f"model_sha256={ model_sha256 } " , flush = True )
19+ print (llama_cpp .llama_print_system_info ().decode (), flush = True )
20+
21+ model = llama_cpp .Llama (
22+ model_path ,
23+ n_ctx = 32 ,
24+ n_batch = 32 ,
25+ n_ubatch = 32 ,
26+ n_threads = multiprocessing .cpu_count (),
27+ n_threads_batch = multiprocessing .cpu_count (),
28+ logits_all = False ,
29+ verbose = True ,
30+ )
31+ print ("context construction succeeded" , flush = True )
32+ model .close ()
You can’t perform that action at this time.
0 commit comments