|
56 | 56 | uname -a |
57 | 57 | lscpu |
58 | 58 | python -c "import platform; print(platform.machine(), platform.architecture())" |
| 59 | + - name: Instrument Linux get_rows_f32 assertion |
| 60 | + run: | |
| 61 | + python - <<'PY' |
| 62 | + from pathlib import Path |
| 63 | +
|
| 64 | + path = Path("vendor/llama.cpp/ggml/src/ggml-cpu/ops.cpp") |
| 65 | + text = path.read_text() |
| 66 | + old = """ GGML_ASSERT(i01 >= 0 && i01 < ne01); |
| 67 | +
|
| 68 | + ggml_vec_cpy_f32(nc,""" |
| 69 | + new = """ if (!(i01 >= 0 && i01 < ne01)) { |
| 70 | + fprintf(stderr, |
| 71 | + "%s: invalid row index in get_rows_f32: dst=%s src0=%s src1=%s i=%lld i10=%lld i11=%lld i12=%lld i01=%lld ne01=%lld src1_ne=[%lld,%lld,%lld,%lld]\\n", |
| 72 | + __func__, dst->name, src0->name, src1->name, |
| 73 | + (long long) i, (long long) i10, (long long) i11, (long long) i12, |
| 74 | + (long long) i01, (long long) ne01, |
| 75 | + (long long) ne10, (long long) ne11, (long long) ne12, (long long) ne13); |
| 76 | + } |
| 77 | + GGML_ASSERT(i01 >= 0 && i01 < ne01); |
| 78 | + |
| 79 | + ggml_vec_cpy_f32(nc,""" |
| 80 | + if old not in text: |
| 81 | + raise SystemExit("get_rows_f32 assertion pattern not found") |
| 82 | + path.write_text(text.replace(old, new, 1)) |
| 83 | + PY |
59 | 84 | - name: Install dependencies (Linux/MacOS) |
60 | 85 | run: | |
61 | 86 | python -m pip install --upgrade pip |
|
0 commit comments