feat(xla): parameterize static context capacity#880
Merged
Conversation
Thread one validated capacity through StableHLO emission, compiled-artifact identity, IREE buffers, single-session generation, and continuous batching so modules and runtime state cannot silently disagree. Reject prompt-plus-generation overflow with a typed error before scheduler or slot mutation, guard decode positions at the Rust and C boundaries, and document the static-shape memory and compile-time tradeoffs. Refs #857
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
Parameterize the OpenXLA static context capacity across graph emission, compiled artifacts, IREE runtime buffers, single-session generation, continuous batching, and server startup.
Changes
MLXCEL_XLA_CONTEXT_CAPACITYwith a compatibility default of 256 and validate explicit capacities against the signed IREE ABI.effective_prompt_len + max_new_tokens <= context_capacitywith typed errors before scheduler mutation.Validation
cargo fmt --all -- --checkcargo clippy -p mlxcel-xla --lib --tests -- -D warningscargo check -p mlxcel-xla --libcargo check -p mlxcel --features xla-backend --libIREE_DIST=/home/inureyes/Development/mlxcel/spike/iree-ffi/iree-dist cargo check -p mlxcel --features xla-iree --libcargo test -p mlxcel-xla --lib context(9 passed, including 256/1024 graph schemas and admission boundaries)cargo test -p mlxcel-xla --lib admissioncargo test -p mlxcel-xla --lib rejected_request_does_not_mutate_queue_or_live_slotcargo test -p mlxcel-xla --lib from_json_reproduces_bundled_assets_byte_for_byteMLXCEL_XLA_CONTEXT_CAPACITY=256 IREE_DIST=/home/inureyes/Development/mlxcel/spike/iree-ffi/iree-dist cargo run --features xla-iree --example xla_oracle_check -- --model /home/inureyes/models/smollm-135m-4bit --oracle /tmp/issue857-smollm-oracle.json --device local-task(Linux aarch64 CPUlocal-task, 2-token HF fp32 oracle, TOKEN-EXACT PASS)MLXCEL_XLA_CONTEXT_CAPACITY=1024 IREE_DIST=/home/inureyes/Development/mlxcel/spike/iree-ffi/iree-dist cargo run --features xla-iree --example xla_oracle_check -- --model /home/inureyes/models/smollm-135m-4bit --oracle /tmp/issue857-smollm-oracle.json --device local-task(TOKEN-EXACT PASS; distinct-c1024-artifacts from the-c256-pair)The full crate-wide library suite and
validate_arch.shmodule-wide structural gate are deferred to the epic integration wave; the issue branch uses the focused tests above to avoid duplicating broad wave validation.Closes #857