Skip to content

fixed color reset on exit - #149

Merged
ggerganov merged 3 commits into
ggml-org:masterfrom
RazeLighter777:color_reset
Mar 15, 2023
Merged

ggerganov merged 3 commits into
ggml-org:masterfrom
RazeLighter777:color_reset

Conversation

@RazeLighter777

Copy link
Copy Markdown
Contributor

Fixes the color messing up the terminal when the program exits by printing an ANSI_COLOR_RESET.

Includes it in the SIGINT handler too.

Comment thread main.cpp Resolved
@ggerganov
ggerganov merged commit 16b2c61 into ggml-org:master Mar 15, 2023
blackhole89 pushed a commit that referenced this pull request Mar 15, 2023
* fixed color reset on exit

* added sigint handler for ansi_color_reset

* Update main.cpp

---------

Co-authored-by: Georgi Gerganov <[email protected]>
rooprob pushed a commit to rooprob/llama.cpp that referenced this pull request Aug 2, 2023
fix: Use correct compiler for Win64 GCC in Makefile
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* fixed color reset on exit

* added sigint handler for ansi_color_reset

* Update main.cpp

---------

Co-authored-by: Georgi Gerganov <[email protected]>
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
* iq5_k_r4: Zen4

Much slower than the others.

* iq5_k_r5: WIP

* Minor

* iq5_k_r4: fix AVX2 nrc_y = 1 case

* iq5_k_r4: better Zen4

But TG is still slower than iq5_k

* iq5_k_r4: slightly better AVX2

* iq5_k_r4: NEON

---------

Co-authored-by: Iwan Kawrakow <[email protected]>
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
* fixed color reset on exit

* added sigint handler for ansi_color_reset

* Update main.cpp

---------

Co-authored-by: Georgi Gerganov <[email protected]>
drizzt pushed a commit to drizzt/llama.cpp that referenced this pull request Jun 15, 2026
* spec: avoid all-token outputs during MTP prefill

Split MTP pre-norm hidden-state extraction from normal embedding/logit output mode so prompt batches no longer mark every token as an output row. Keep Qwen35/Qwen35MoE hidden rows available for MTP while slicing before the final output head, and skip draft pre-norm host copies during prompt sync.

* fix: guard unused MTP out_ids inputs
drizzt pushed a commit to drizzt/llama.cpp that referenced this pull request Jun 15, 2026
…eage

This fork's pre-norm MTP optimization is superseded by upstream's maintained
post-norm/nextn MTP, brought in by the commits that follow. Removing it here
so that lineage applies onto a clean base instead of colliding with it.
Soket1 pushed a commit to Soket1/llama.cpp-xdna that referenced this pull request Aug 2, 2026
…sts (ggml-org#149)

Root cause: cold first-run xclbin compilation caused either timeout
(60+2*n seconds too tight for 2-5 min compilation) or garbage output
('Successfully parsed' on first dispatch).  An unrelated observer-preset
hang was caused by XDNA_ATTN_SUPPORTS claiming attention MUL_MAT that the
GEMV dispatcher cannot handle.

Changes:
- correctness_test: increase per-run timeout floor from 60s to 120s
  (300s for warmup probes), add per-(preset,model) warmup that generates
  one token before the timed comparison so all xclbins are pre-compiled.
  Module-level _WARMED cache avoids redundant warmups across tests.
- correctness_test: remove XDNA_ATTN_SUPPORTS=1 from npu_layer_fused
  (observer preset). The flag changes cgraph segmentation by claiming
  attention MUL_MAT ops, which the regular GEMV dispatcher cannot
  dispatch — causing a hard hang. The observer stub must not alter
  which ops are claimed; only log matches.
- test_gemv: fix _verify_l1_budget default from 32KB to 64KB to match
  the AIE2p L1 size used by xdna_shape_dispatchable_gemv(). Update
  test_large_K_clamps_tile_in expectation: tile_in <= 4 (was <= 2).

Verified: paris_short, paris_short_q4_0_int4 (all 3 variants),
paris_short_q4_0_f3best_loop (both ABIs) all PASS.  test_gemv.py 26/26 PASS.

Co-Authored-By: Claude <[email protected]>
Soket1 pushed a commit to Soket1/llama.cpp-xdna that referenced this pull request Aug 2, 2026
 follow-up)

- paris_drift_64_q4_0_phase_b: lower min_prefix_match 12→3 to tolerate
  known intermittent Phase B kernel garbage bug ('The GGGGGGGG…').
  Documented as known issue to be root-caused separately.
- qwen35_ml_npu_full: remove expected_fail — since the ggml-org#148 L1 GEMV
  feasibility gate, Qwen 3.5-9B correctly delegates K=12288 FFN-down
  to CPU while dispatching all other INT4 shapes on NPU.  737+ prefix
  chars confirmed matching CPU baseline at n=200.
- qwen35_ml_npu_full: update description — was 'EXPECTED FAIL:
  head_dim=256 vs hardcoded 64', now documents ggml-org#148-based CPU fallback.

Full suite after all ggml-org#149 fixes: 30/30 passing (rms_qkv_regression
still expected_fail — correct).

Co-Authored-By: Claude <[email protected]>
hjotha pushed a commit to hjotha/beellama.cpp that referenced this pull request Sep 18, 2026
…sion

Make KVarN usable on ROCm RDNA3 (toward ggml-org#122: D256 race, portable prefill, f32 WMMA prototype)
pwilkin pushed a commit to pwilkin/llama.cpp that referenced this pull request Oct 8, 2026
…t-cache"

This reverts commit 0f36c46, reversing
changes made to 307c50d.

--cache-dir drives runaway disk writes on ROCm: the slot state is copied
straight between the GPU and a MAP_SHARED file, the runtime pins the
mapped pages, and writeback keeps rewriting the file until the server
exits. Users reported ~1.6 TB written to NVMe in an hour, and decode
stalling under 5+ GB/s of continuous writes with a 75k-token context.
Reproduced on gfx1151: one 503 MiB entry became 5.7 GB of writes within
60 s of idle. Even with that fixed (ggml-org#149), an agent-style workload
rewrites the whole state on every turn. Remove the feature until it
can come back with bounded writes; --cache-ram is unaffected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01G5NBdiBqRmGomhSRXBoucx
woct0rdho pushed a commit to woct0rdho/llama.cpp that referenced this pull request Oct 17, 2026
…t-cache"

This reverts commit 0f36c46, reversing
changes made to 307c50d.

--cache-dir drives runaway disk writes on ROCm: the slot state is copied
straight between the GPU and a MAP_SHARED file, the runtime pins the
mapped pages, and writeback keeps rewriting the file until the server
exits. Users reported ~1.6 TB written to NVMe in an hour, and decode
stalling under 5+ GB/s of continuous writes with a 75k-token context.
Reproduced on gfx1151: one 503 MiB entry became 5.7 GB of writes within
60 s of idle. Even with that fixed (ggml-org#149), an agent-style workload
rewrites the whole state on every turn. Remove the feature until it
can come back with bounded writes; --cache-ram is unaffected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01G5NBdiBqRmGomhSRXBoucx

[rebase: applied as the revert of the rebased commits 73e0238 and 3f91881, the linear-history form of PR ggml-org#81]
(cherry picked from commit a3a9bb3)
jammm pushed a commit to jammm/llama.cpp that referenced this pull request Nov 19, 2026
## Problem

The Llama 3.1 8B Instruct Q2_K GGUF loads on HRX and fails at its first embedding gather. This checkpoint also uses Q2_K for query, key, gate, and up projections in all 32 layers. [Tracking issue ggml-org#175](ROCm/ggml-staging-automation#175) · [Quantization sweep ggml-org#149](ROCm/ggml-staging-automation#149)

## Implementation

Register Q2_K as HRX kernel format 12 and use its native 84-byte stride for each block of 256 weights. The shared decoder extracts unsigned two-bit codes and the scale and minimum for each group of 16 weights. Gather loads the packet it needs. Tiled and vector matmul reuse block metadata and packed code words across groups. The FP16 and FP32 paths share the reconstruction arithmetic.

After rebasing, use typed Loom splats and flatten format dispatch in the tiled, paired tiled, and paired vector kernels with `scf.switch`. The paired tiled kernel selects the gate and up formats independently for mixed-format weights. The paired vector kernel loads Q1_0 metadata inside its case and guards partial input groups.

## Validation

**Current head `d959bb2ab`.** All 232 selected dense-matmul and paired-vector GPU operator tests passed on gfx1151. The preceding tiled and paired-tiled cleanups passed their focused runs of 42 and 46 tests respectively. These suites overlap.

**Real model on rebased source `5a225f032`, before the switch cleanups.** The SHA-256 of the [pinned Q2_K GGUF](https://huggingface.co/bartowski/Meta-Llama-3.1-8B-Instruct-GGUF/blob/bf5b95e96dac0462e2a09145ec66cae9a3f12067/Meta-Llama-3.1-8B-Instruct-Q2_K.gguf) was `3f7f9265554ac91f1fb31c1b63b9cada4362533dfaa3f6e8dfc33c48d36909ce`. Deterministic HRX generation answered “Paris.” on the capital-of-France prompt. Matched WikiText perplexity used context and batch size 512, 16 threads, and the same model and executable on CPU and HRX. A second HRX run reproduced both results to four decimal places.

| Regime | Microbatch | Chunks | CPU PPL | HRX PPL |
|---|---:|---:|---:|---:|
| Prefill-like | 512 | 32 | 9.5086 | 9.5154 |
| Decode-like | 1 | 2 | 6.9246 | 6.9089 |

On gfx1151, three repetitions of `llama-bench` measured 713.6 tokens/s for prefill (512 tokens), 50.45 tokens/s for decode (64 tokens), and 3,620.4 MiB peak process RSS.

**Earlier validation on the original branch (`972fd1c83`).** On a Radeon 8060S with HRX `82214dfb` and TheRock run `34419394260`, all 33 focused operator cases passed, including crafted codes and scale/minimum values, mixed-format gate/up, tails, and repeated imported weights. Placement logs showed 33/33 layers offloaded. Q2_K and the Q8_0, Q4_K_M, Q6_K, and Q5_K_M controls passed generation and matched HRX/Vulkan/CPU perplexity. For Q2_K, HRX/Vulkan/CPU perplexity was 9.5198/9.5097/9.5086 for prefill-like evaluation and 6.9089/6.9142/6.9141 for decode-like evaluation.

On that branch, reusing decode state raised prefill from 509.3 to 765.8 tokens/s. A seven-repetition check measured 467.6 to 711.6 tokens/s for prefill and 52.08 to 52.30 tokens/s for decode. Peak process RSS was 3,819.1 MiB and live HRX weight allocation was 3,024.4 MiB. The broader Q2_K backend suite passed 52/63 cases. The remaining eleven were unsupported batched shapes outside this checkpoint's graph and also failed with the Q3_K control.

## Requirements

- Reviewed the contributing guidance and fork instructions.
- AI usage disclosure — **Yes**. Codex implemented the decoder and tests, ran validation, and prepared the draft at the contributor's request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants