Skip to content

Commit 3d79cf4

Browse files
committed
ci: isolate recurrent verbosity abort
1 parent e1b56c4 commit 3d79cf4

3 files changed

Lines changed: 19 additions & 39 deletions

File tree

‎.github/workflows/diagnose-recurrent-linux.yaml‎

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -42,55 +42,31 @@ jobs:
4242
python -m pip install uv
4343
python -m uv pip install -e '.[all]' --verbose
4444
45-
- name: Recurrent test alone
45+
- name: Construct recurrent context with verbose disabled
4646
continue-on-error: true
47-
run: |
48-
python -m pytest -vv -s \
49-
tests/test_llama.py::test_recurrent_model_prompt_cache_reset
50-
51-
- name: Recurrent test after low-level model
52-
continue-on-error: true
53-
run: |
54-
python -m pytest -vv -s \
55-
tests/test_llama.py::test_real_model \
56-
tests/test_llama.py::test_recurrent_model_prompt_cache_reset
47+
env:
48+
VERBOSE: "0"
49+
run: python tests/diagnose_recurrent_context.py
5750

58-
- name: Recurrent test after high-level model
51+
- name: Construct recurrent context with verbose enabled
5952
continue-on-error: true
60-
run: |
61-
python -m pytest -vv -s \
62-
tests/test_llama.py::test_real_llama \
63-
tests/test_llama.py::test_recurrent_model_prompt_cache_reset
64-
65-
- name: Recurrent test after repeated-prompt model
66-
continue-on-error: true
67-
run: |
68-
python -m pytest -vv -s \
69-
tests/test_llama.py::test_real_llama_repeated_prompt_cache \
70-
tests/test_llama.py::test_recurrent_model_prompt_cache_reset
53+
env:
54+
VERBOSE: "1"
55+
run: python tests/diagnose_recurrent_context.py
7156

72-
- name: Reproduce original test sequence
57+
- name: Run original recurrent test
7358
continue-on-error: true
7459
run: |
7560
python -m pytest -vv -s \
76-
tests/test_llama.py::test_llama_cpp_version \
77-
tests/test_llama.py::test_llama_cpp_tokenization \
78-
tests/test_llama.py::test_real_model \
79-
tests/test_llama.py::test_real_llama \
80-
tests/test_llama.py::test_real_llama_repeated_prompt_cache \
8161
tests/test_llama.py::test_recurrent_model_prompt_cache_reset
8262
83-
- name: Capture original-sequence backtrace
63+
- name: Capture verbose-disabled backtrace
8464
continue-on-error: true
65+
env:
66+
VERBOSE: "0"
8567
run: |
8668
gdb --batch \
8769
-ex "set pagination off" \
8870
-ex run \
8971
-ex "thread apply all bt" \
90-
--args python -m pytest -vv -s \
91-
tests/test_llama.py::test_llama_cpp_version \
92-
tests/test_llama.py::test_llama_cpp_tokenization \
93-
tests/test_llama.py::test_real_model \
94-
tests/test_llama.py::test_real_llama \
95-
tests/test_llama.py::test_real_llama_repeated_prompt_cache \
96-
tests/test_llama.py::test_recurrent_model_prompt_cache_reset
72+
--args python tests/diagnose_recurrent_context.py

‎tests/diagnose_recurrent_context.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import hashlib
22
import multiprocessing
3+
import os
34

45
from huggingface_hub import hf_hub_download
56

@@ -18,6 +19,9 @@
1819
print(f"model_sha256={model_sha256}", flush=True)
1920
print(llama_cpp.llama_print_system_info().decode(), flush=True)
2021

22+
verbose = os.environ.get("VERBOSE") == "1"
23+
print(f"verbose={verbose}", flush=True)
24+
2125
model = llama_cpp.Llama(
2226
model_path,
2327
n_ctx=32,
@@ -26,7 +30,7 @@
2630
n_threads=multiprocessing.cpu_count(),
2731
n_threads_batch=multiprocessing.cpu_count(),
2832
logits_all=False,
29-
verbose=True,
33+
verbose=verbose,
3034
)
3135
print("context construction succeeded", flush=True)
3236
model.close()

‎tests/test_llama.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def _assert_prompt_cache_reset_handles_history_edit(
309309
n_threads=multiprocessing.cpu_count(),
310310
n_threads_batch=multiprocessing.cpu_count(),
311311
logits_all=False,
312-
verbose=True,
312+
verbose=False,
313313
)
314314

315315
assert model._is_recurrent is is_recurrent

0 commit comments

Comments
 (0)