Repository navigation
tests: pin the remote GGUF compute reserve - #8660
Conversation
#8524 changed the output-buffer slot count from max(0, n_parallel - 1) to max(1, n_parallel) and gave a non-diffusion remote estimate a default micro-batch, which is right: llama-server allocates an output buffer for the one slot it runs, and the old count reserved nothing for it. Ten tests caught the change only as an unexplained 0.58 GB and were red on main until #8641. #8641 resolved that by extracting the term so those tests can hold it at zero, the way they already hold _estimate_gguf_kv_gb at zero. That is the right call for them, but it leaves the arithmetic with nothing asserting it: all fifteen references to _remote_gguf_compute_reserve_gb in the suite patch it, and a grep for the constants it is built from finds no test at all. It decides whether a load is refused, so it should not be free to drift. Two cases, shape rather than magnitude: the single-slot floor, and diffusion charging nothing. The single-slot total is spelled out because the reserve is linear in the slot count, so any two samples are one buffer apart under the old formula and the new one alike, and only an absolute anchor sees the floor. Constants come from the module, so retuning a safety factor moves the test with the code while dropping a term still fails it.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd42ee02e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cls.route = _load_inference_route() | ||
|
|
||
| def _reserve(self, **kwargs): | ||
| return self.route._remote_gguf_compute_reserve_gb(max_seq_length = 4096, **kwargs) |
There was a problem hiding this comment.
Clear llama batch overrides before asserting defaults
When the test suite runs with LLAMA_ARG_BATCH or LLAMA_ARG_UBATCH set, this helper leaves n_batch and n_ubatch unspecified, so _remote_gguf_compute_reserve_gb obtains a non-default effective micro-batch from os.environ via _extra_args_n_ubatch. The assertions nevertheless calculate their expected values from _DEFAULT_N_UBATCH, producing a false failure unrelated to the slot-count behavior under test; clear these variables or pass explicit batch and micro-batch values.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, fixed in 67971e8. _extra_args_n_ubatch reads LLAMA_ARG_BATCH and LLAMA_ARG_UBATCH off os.environ, so either one exported on the runner moves the effective micro-batch away from _DEFAULT_N_UBATCH and the assertions fail for a reason unrelated to the slot count. The helper now drops both for the duration of the call. Confirmed by running the class with LLAMA_ARG_UBATCH=1024 set: it failed before the change and passes after.
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
_remote_gguf_compute_reserve_gbdecides how much headroom a remote GGUF estimate reserves, and therefore whether a load is refused. Nothing asserts it.All fifteen references to it in
test_chat_load_during_training.pyarepatch(..., return_value = 0.0), and grepping the suite for the constants it is built from (_ASSUMED_MAX_VOCAB,out_buffer,output_slots) returns nothing.How it got that way
#8524 changed the output-buffer slot count from
max(0, n_parallel - 1)tomax(1, n_parallel)and gave a non-diffusion remote estimate a default micro-batch. That is correct: llama-server allocates an output buffer for the one slot it runs, and the old count reserved nothing for it. Ten tests caught the change only as an unexplained4.575732421875 != 4.0and were red on main until #8641.#8641 resolved that by extracting the term so those tests can hold it at zero, the way they already hold
_estimate_gguf_kv_gbat zero. That is the right call for them, and it is why this PR adds coverage rather than changing anything.Changes
Two cases in a new
TestRemoteGgufComputeReserve, pinning shape rather than magnitude:_out_slotstomax(0, n_parallel - 1), where this test fails and the difference-based version I wrote first still passed.Constants come from the module, so retuning a safety factor moves the test with the code while dropping a term still fails it.
Validation
tests/test_chat_load_during_training.py: 120 passed. Ruff clean. No production code touched.