Skip to content

fix(serve): ALiBi slope doc says 2^(-8(h+1)/n); delete the dark layers/a_li_bi.rs (#4700) - #5168

Queued
noahgift wants to merge 1 commit into
mainfrom
la-72/4700-alibi-dark
Queued

noahgift wants to merge 1 commit into
mainfrom
la-72/4700-alibi-dark

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

crates/aprender-serve/src/layers/a_li_bi.rs is not compiled. No mod, include! or #[path] names it. Its 354 lines are an older copy of the ScaledRoPE methods plus the ALiBi doc block, and every fn in it has a compiled twin in scaled_rope.rs. Readers who land on it read code that never runs.

Row Change
1 Delete the uncompiled layers/a_li_bi.rs
2 Correct the ALiBi slope doc in the compiled scaled_rope.rs: for n heads (a power of 2), head h gets 2^(-8(h+1)/n), so head 0 carries 2^(-8/n), never 1.0. That is what ALiBi::compute_slopes computes

Measured on main 812dbe3 plus this diff: cargo fmt --check exits 0, cargo check -p aprender-serve exits 0, cargo test -p aprender-serve --lib alibi passes 38 of 38, and check_src_test_files_wired.sh exits 0.

crates/aprender-serve/.pmat-baseline.json still lists the deleted path as a data row. No build or gate reads that row as a source file, so it is left alone here.

Refs #4700
keep-open: #4700 tracks every dark source file in the tree, and this PR removes one of them.

🤖 Generated with Claude Code

…s/a_li_bi.rs (#4700)

The ALiBi doc in layers/scaled_rope.rs gave the slope as 2^(-8h/n), which puts
slope 1.0 on head 0. The compiled layers/alibi.rs computes 2^(-8(h+1)/n), as Press
et al. and llama.cpp do, and its own doc says the +1 is load-bearing (ce39f30).
The doc now matches the code.

layers/a_li_bi.rs is a dark file: no mod, include! or #[path] reaches it, and every
fn it defines exists in the compiled alibi.rs, position_alibi_get.rs or
scaled_rope.rs. #4700 asks for the doc fix to land in the commit that deletes it.

Refs #4700

Agent: la-0.72b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

§13.11 rung 1 — quorum shadow verdict

S13-SHADOW pr=5168 head=46fa943b389a0d8f3039259b8f58d9e18d5f62ed verdict=REFUSE class=Q1 arm_rc=1

Shadow mode: this records a verdict and merges nothing. A refusal
to arm is not a block (§13 adds zero rows to §7) — the pull request is
exactly as green as it was.

@noahgift noahgift left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seat 1, la-0.72 APPROVE @ 46fa943

The scaled_rope doc now gives 2^(-8(h+1)/n), which matches compute_slopes in alibi.rs (unchanged). layers/a_li_bi.rs has no mod, include! or path reference and only duplicates an impl fragment, so deleting it is safe. CI green.

Receipt: review-la-0.72-5168-46fa943b38.md

@noahgift noahgift left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seat 2, aprender-78 APPROVE @ 46fa943

  • The deleted layers/a_li_bi.rs is dark at this head. No include!/include_str!, #[path] or parent-module mod resolves to its exact path (checked by path resolution, not a suffix grep), and no non-Rust file names it.
  • The new scaled_rope.rs doc line, slope 2^(-8(h+1)/n), matches the compiled code in layers/alibi.rs (exponent = -((i + 1) as f32) * ratio), so head 0 gets 2^(-8/n).
  • CI on this head: 10 success, 2 skipped.

@noahgift
noahgift added this pull request to the merge queue Oct 12, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 12, 2026
@noahgift
noahgift added this pull request to the merge queue Oct 12, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
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.

1 participant