Repository navigation
fix: honor --ctx-size and other forwarded args from unsloth studio run in Studio's context-fit logic - #5815
Conversation
…un` in Studio's context-fit logic
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
Code Review
This pull request introduces support for parsing and honoring a user-supplied context size override (-c or --ctx-size) passed via extra arguments in the llama.cpp backend. It implements a new parse_ctx_override helper function in llama_server_args.py to extract the override value, integrates this logic into the GPU selection and context fitting routines in llama_cpp.py, and adds comprehensive unit tests to validate correct parsing and behavior.
|
Thanks for the fix! Cross-checked against the denylist from #5271 — the hard-deny groups (model identity, network, auth/TLS, single-model server flags) are intact and this PR doesn't open a path around them. The One thing worth a closer look: the original issue also calls out Thanks again! |
The test helper was reimplementing the two-line 'ctx_override = parse_ctx_override(...); requested_ctx = ctx_override if ctx_override is not None else n_ctx' pattern locally, so the test asserted against its own reimplementation rather than production logic. Extract the conditional into resolve_requested_ctx and have both the production caller and the test use it.
Studio's KV cache VRAM estimate computed from the first-class cache_type_kv even when the user passed -ctk/--cache-type-k/-ctv/ --cache-type-v via extras. Those flags reached llama-server fine (last-wins on the CLI) but the pre-launch estimate kept using the default f16 bytes-per-element, so GPU placement decisions could be off when the user lowered cache precision via pass-through. Adds parse_cache_override + resolve_cache_type_kv in llama_server_args.py (mirroring parse_ctx_override / resolve_requested_ctx), wires both into load_model alongside the existing ctx resolution, and adds focused unit tests for the parser + resolver. Follow-up to @rolandtannous review on unslothai#5815.
|
Good catch. Added Let me know if you'd rather have separate k/v knobs - I kept them folded into the single |
|
LGTM ✅ Re-checked. The follow-up commit (7218efd) addresses the cache-type gap I flagged, and there's a bonus refactor (0980602). Cache-type fix — looks correct:
|
|
Thanks @rolandtannous for taking the fix that honors --ctx-size and other forwarded args. |
|
Have you tried to run something like |
|
Thanks for taking this @rolandtannous. Honoring --ctx-size and the other forwarded args is one of those fixes you only notice when it's missing. |
|
Thanks @rolandtannous for merging the --ctx-size forwarding fix, the CLI args land where users expect now. |
Summary
fix: honor --ctx-size and other forwarded args from
unsloth studio runin Studio's context-fit logicCloses #5676
AI was used for assistance.