Consolidate text_generation examples into a single flag-driven basic_inference.py - #1256
Draft
quic-rishinr wants to merge 2 commits into
Draft
Consolidate text_generation examples into a single flag-driven basic_inference.py#1256quic-rishinr wants to merge 2 commits into
quic-rishinr wants to merge 2 commits into
Conversation
quic-rishinr
marked this pull request as draft
August 10, 2026 06:55
quic-rishinr
force-pushed
the
consolidate-text-generation-examples
branch
from
August 10, 2026 08:12
ef48883 to
cef2211
Compare
…inference.py Replace the per-feature example scripts (gguf_models, moe_inference, continuous_batching, blocked_attention_inference, batch_blocking_example, gpt_oss_blocked_example, cli_examples) with one canonical entry point, examples/text_generation/basic_inference.py, where every recipe is a flag over a real QEFFAutoModelForCausalLM.from_pretrained / .compile / .generate kwarg. Shared argument parsing lives in examples/_common/args.py. Move the two bespoke recipes (GLM4 KV-head surgery, Kimi-K2 MLA absorption) under examples/text_generation/advanced/ with a README describing their scratchpad nature. Fix parser/wiring defects found in review: - emit num_kv_heads_repeat at the top level of build_qaic_config so it is not silently dropped without --enable-blocking - reject --num-devices/--device-group mismatch and empty --device-group at the CLI instead of failing deep in the runtime - surface --include-sampler in basic --help - wire --max-seq-len-cached, --layerwise, and --layerwise-window-size, forwarding --layerwise to from_pretrained for the meta-device load path - evaluate advanced-help visibility lazily at parser-build time Repoint examples/README.md and the docs pages that linked to the deleted scripts at basic_inference.py. Signed-off-by: Rishin Raj <rishinr@qti.qualcomm.com>
Signed-off-by: Rishin Raj <rishinr@qti.qualcomm.com>
quic-rishinr
force-pushed
the
consolidate-text-generation-examples
branch
from
August 10, 2026 09:57
5329780 to
34e6794
Compare
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.
Replace the per-feature example scripts (gguf_models, moe_inference, continuous_batching, blocked_attention_inference, batch_blocking_example, gpt_oss_blocked_example, cli_examples) with one canonical entry point, examples/text_generation/basic_inference.py, where every recipe is a flag over a real QEFFAutoModelForCausalLM.from_pretrained / .compile / .generate kwarg. Shared argument parsing lives in examples/_common/args.py.
Move the two bespoke recipes (GLM4 KV-head surgery, Kimi-K2 MLA absorption) under examples/text_generation/advanced/ with a README describing their scratchpad nature.
Fix parser/wiring defects found in review:
Repoint examples/README.md and the docs pages that linked to the deleted scripts at basic_inference.py.