You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pin batch-size invariance of safety and judge generation in fp32 (batch_size 1 / 2 / 4 / 8) #922
Both gates generate the answers they score with left-padded, batched greedy decoding (forgelm/safety/_generate.py, forgelm/judge.py), but every test stubs the batched helpers, so a change that made results depend on batch_size would ship without a failing test. The PR #29 review deferred the determinism test. #677 shows bf16 output legitimately varies with batch size, so the contract to pin is fp32.
Condition or budget
None recorded (the row still names v0.6.x).
State today (re-checked 2026-10-09)
No determinism test exists; the only batch_size tests check input validation.
Related
#676 asks for a safety-side batched-versus-single test (and accepts a weaker padding-side fix for the judge); #677 documents the bf16 variance.
Acceptance criteria
A tiny-model fp32 test runs safety generation and judge generation at batch_size 1, 2, 4 and 8 and asserts identical outputs.
The row is removed from the deferral table and the CHANGELOG names its ID (the table's removal contract).
Recorded in docs/roadmap/risks-and-decisions.md (read at f94595f) and re-checked against the code on 2026-10-09. The row leaves that table only when the fix is on main, the CHANGELOG names its ID and any promised guard exists.
Construct a tiny seeded causal model and tokenizer locally in fp32/eval mode, with short prompts of differing lengths and left padding. Assert identical decoded outputs for batch sizes 1, 2, 4 and 8 through both real helpers; do not mock the generation helper or download a Hub model. Include a case sensitive to padding errors. Follow the deferral table's removal contract: reference the implementation now and remove the row only when the fix is on main; name F-PR29-A8-10 in the changelog.
Test-only task, no bf16 determinism claim or production model benchmark. Needs familiarity with a tiny local Transformers fixture; allow ~2 h, subject to maintainer review of that estimate.
If user-facing documentation changes, update the existing Turkish mirror in the same PR; keep commands, code and terminal output in English and structurally aligned. English-only contributor standards need no new mirror.
Open the PR against development with Fixes #922 once every finding is resolved or explicitly closed with a reason; use Refs #922 for partial work and list the resolved finding IDs.
Activity
cemililik commentedon Oct 11, 2026
Where to start
Thanks for taking a look. Please confirm the issue is unassigned and comment before starting so work does not overlap.
Start with these files on
development:Construct a tiny seeded causal model and tokenizer locally in fp32/eval mode, with short prompts of differing lengths and left padding. Assert identical decoded outputs for batch sizes 1, 2, 4 and 8 through both real helpers; do not mock the generation helper or download a Hub model. Include a case sensitive to padding errors. Follow the deferral table's removal contract: reference the implementation now and remove the row only when the fix is on main; name F-PR29-A8-10 in the changelog.
Test-only task, no bf16 determinism claim or production model benchmark. Needs familiarity with a tiny local Transformers fixture; allow ~2 h, subject to maintainer review of that estimate.
Run the focused tests:
Run these guards/checks as applicable to the changed files:
If user-facing documentation changes, update the existing Turkish mirror in the same PR; keep commands, code and terminal output in English and structurally aligned. English-only contributor standards need no new mirror.
Open the PR against
developmentwithFixes #922once every finding is resolved or explicitly closed with a reason; useRefs #922for partial work and list the resolved finding IDs.