feat(sdk): add ignore_eos to force full-length decode in geniex-bench#1162
Draft
RemiliaForever (RemiliaForever) wants to merge 1 commit into
Draft
feat(sdk): add ignore_eos to force full-length decode in geniex-bench#1162RemiliaForever (RemiliaForever) wants to merge 1 commit into
RemiliaForever (RemiliaForever) wants to merge 1 commit into
Conversation
geniex-bench --ignore-eos keeps generation running past EOS/EOG so decode always produces --n-gen tokens, making decode-speed numbers comparable across models. Adds a bool ignore_eos to geniex_GenerationConfig (guarded in the llama_cpp llm/vlm decode loops) and updates the Python, Go, and Android FFI surfaces. qairt drives EOS inside the third-party genie engine and cannot honor it, so the flag is a documented no-op there. Signed-off-by: RemiliaForever <remilia@koumakan.cc>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
--ignore-eosoption togeniex-benchthat keeps generation runningpast EOS/EOG so decode always produces the full
--n-gentokens. This makesdecode-speed numbers comparable across models that would otherwise stop early,
mirroring
llama-bench --ignore-eos.The whole behavioral change is one guard in the llama_cpp decode loop; the rest
is plumbing a single
boolthrough the one public conduit that reaches it.Changes
sdk/include/geniex.h— appendbool ignore_eostogeniex_GenerationConfig(field appended at the end, so existing offsets are unchanged).sdk/plugins/llama_cpp/src/{llm,vlm}.cpp— guard thellama_vocab_is_eogbreak with!cfg.ignore_eos. When set, the EOG token falls through, the loop runs tomax_tokens, andstop_reasonbecomes"length"via the existing post-loop path. Both the text-LLM and VLM decode loops are covered.sdk/benchmark/benchmark.c—--ignore-eosflag →options_t→fill_gen_config, plus help text._types.py— append('ignore_eos', c_bool)(correctness-critical: the SDK copies*configby value, so a shorter Structure would read past the allocation).common.go—IgnoreEos bool+ wire intotoCPtr().jniutils.cpp+ KotlinGenerationConfig.kt— readignoreEos.qairt
qairt drives EOS inside the third-party genie engine
(
third-party/geniex-qairt/.../llm_model.cpp), which has no ignore-eos seam andmust not be modified. The flag is therefore a documented no-op on qairt — the
plugin simply ignores the new field, consistent with how it already ignores
--ngl/--n-ctx/--stop.Test plan
geniex.hfield compiles; a C consumer can setg.ignore_eos = true.benchmark.cpassesgcc -fsyntax-only._types.pyloads;geniex_GenerationConfig._fields_ends withignore_eosand set/get round-trips.bindings/go/common.goisgofmt-clean.clang-format,ruff check,ruff format --checkclean on touched files (pre-existing unrelated format drift inllm.cppleft untouched).--ignore-eosyieldsgen == n_genandstop_reason == "length") — pending, needs the toolchain container / device.