Skip to content

Enable GPT-OSS 20B complete SSD prefix caching by default - #894

Merged
Gajesh2007 merged 6 commits into
masterfrom
feat/gpt-oss-20b-prefix-cache
Sep 11, 2026
Merged

Gajesh2007 merged 6 commits into
masterfrom
feat/gpt-oss-20b-prefix-cache

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Enable SSD prefix caching by default for the resolved gpt-oss-20b listing. Repeated prompts and changed-question branches now reuse authenticated full-attention and sliding-window checkpoints through the already merged native implementation. The previous default left this capability disabled.

Built from latest master ef7b5a9aa (v0.9.2) in a fresh worktree. Native pins and provider version stay unchanged. API aliases inherit the default of their resolved build; other provider artifact IDs remain opt-in. Explicit cache disable and contiguous fallback remain cold, and resident retention remains opt-in.

flowchart LR
  subgraph Before
    A[Resolved GPT-OSS request] --> B[PrefixCachePolicy.isEnabled: false]
    B --> C[No default SSD store]
    C --> D[Full prompt prefill on repeats]
  end
  subgraph After
    E[Resolved GPT-OSS request] --> F[PrefixCachePolicy.isEnabled: exact listing true]
    F --> G[Fresh load hash and prepareCompletePrefixCache identity gates]
    G --> H{Authenticated same-tenant paged checkpoint?}
    H -->|Hit| I[Restore full rows and sliding windows, prefill suffix]
    H -->|Disabled, unsupported or miss| J[Cold prefill]
    I --> K[Generate answer]
    J --> K
  end
Loading

Qualification report and retained evidence.

Dedicated M5 measurement Cache on median warm TTFT Matched cache-off median TTFT Median per-pair reduction
B1, 5 warm pairs 0.152 s 1.107 s 86.3%
B2, 10 warm pairs 0.215 s 1.929 s 88.8%
B4, 20 warm pairs 0.321 s 3.529 s 91.3%

The matrix uses the same pinned catalog model, prompts, paged backend and production KV grant, with MTP off and production numerical defaults. Every warm row restores 4,096 tokens with zero replay. Actual native width 2/4 is observed in every corresponding cohort, in both arms. All 84 main answers and 30 natural control answers pass; tenant isolation, cancellation/recovery and accounting pass. All 42 paired final JSON answers match. Complete token sequences match in 34/42 pairs; the other eight differ only in reasoning wording. These are bounded synthetic tasks and small timing samples, not broad quality or statistical claims.

Additional validation:

  • Optimized selected suite: 347 Swift Testing cases in 50 suites, with eight explicitly gated live skips, plus 13 XCTest cases. Both new live fixtures ran separately and passed.
  • Strict native FP32 controls: 13 cases pass with upstream MLX_ENABLE_TF32=0, unchanged assertions/tolerances. Original default-TF32 failures are retained; production model runs leave the flag unset.
  • Strict encrypted checkpoint reconstruction: 6,144/6,413 tokens restored, 308,110,124 bytes read, correct branched answer and correct tenant/changed-prefix misses. TTFT 0.229 s versus 1.697 s cold; identical answer text.
  • Mixed concurrent suffixes: 23 correct natural completions, ten authenticated 6,144-token hits, real restored B4 decoding and clean accounting. Cold short-answer control submits four requests and observes width three; the separate paired matrix proves cold and warm width four.
  • Default standalone HTTP: five completed streams, exact final-channel answers, encrypted checkpoint files, actual MTP-inactive metric and clean owned-process/scanner cleanup. Standalone still exposes raw Harmony in content and omits cached-token usage; this test records those existing transport limits and does not claim HTTP hit accounting or clean presentation. Initial cold HTTP TTFT includes model loading and fresh weight hashing.
  • Targeted Go release-default/capability/launch-helper tests and docs validation pass. The model archive's ten files (12.1 GB) are verified against the pinned aggregate hash.

The historical September 6 strict B2 token-parity failure remains unchanged. This PR adds current runtime/task and cache-state qualification; it does not claim a causal fix for that historical divergence. All failed or refused attempts are retained, including the corrected test-width assumption, parser/ownership harness fixes and thermal/host-occupancy refusals.

Test keys are isolated and ephemeral. Engine reconstruction is not production-Keychain process recovery. Coordinator routing activation and a connected live coordinator/provider run are outside this validation. No release, deployment or model-catalog mutation is included.

Final head bbb46b21fa2efc0fc3b23598bf4da5e929a285b0: Codex completed review with 👍 and no unresolved findings. Provider, coordinator, docs, lint and release-integrity CI and E2E integration CI pass; all CodeQL checks pass.

Two external workflow gates remain: Threat Model Review fails because its Anthropic credential returns HTTP 401 (API key is invalid), and E2E Benchmarks awaits the protected benchmarks environment approval. Neither check has been bypassed. The dedicated M5 qualification above is complete. This PR is ready for review; the workflow dashboard is not entirely green.

@vercel

vercel Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Ready Ready Preview Sep 11, 2026 8:16am UTC
d-inference-console-ui-dev Ready Ready Preview Sep 11, 2026 8:16am UTC
d-inference-landing Ready Ready Preview Sep 11, 2026 8:16am UTC

Request Review

@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-11T08:20:12.102814Z bbb46b2 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b0a3304ff

ℹ️ 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".

@Gajesh2007

Copy link
Copy Markdown
Member Author

Final qualification and review are complete on bbb46b21fa2efc0fc3b23598bf4da5e929a285b0.

  • Codex reviewed this head and gave 👍; the initial B2 qualification thread is addressed and resolved, with no new findings.
  • Final-head provider/coordinator/docs/lint/release-integrity CI, all CodeQL checks, and E2E integration CI pass. Integration includes the blocking paged concurrency-eight gate, default-posture smoke and both released-version compatibility checks.
  • Dedicated M5 GPT-OSS B1/B2/B4, mixed suffixes, checkpoint reconstruction and default HTTP qualification pass. Warm TTFT reductions are 86–91% in the bounded paired matrix; all 42 paired final answers match. Full token parity is diagnostic and is not claimed for every pair.
  • Report, exact source/artifact bindings and original successful/failed/refused receipts are committed: https://github.com/Layr-Labs/d-inference/blob/bbb46b21fa2efc0fc3b23598bf4da5e929a285b0/docs/reports/2026-09-11-gptoss-default-prefix-cache.md

External workflow gates still shown on GitHub: Threat Model Review fails with Anthropic HTTP 401 (API key is invalid; run 34578315996), and E2E Benchmarks awaits the protected benchmarks environment approval (run 34578316002). Those gates have not been bypassed. The PR is open and ready for review, with no merge conflict. No merge, release, deployment or catalog mutation was performed.

@Gajesh2007
Gajesh2007 merged commit 7c394fa into master Sep 11, 2026
25 of 27 checks passed
@Gajesh2007
Gajesh2007 deleted the feat/gpt-oss-20b-prefix-cache branch September 11, 2026 22:46

This branch had an error being deployed

1 failed and 3 active deployments
Preview – d-inference-console-ui-dev — bbb46b21 Deployed Sep 11, 2026 by vercel[bot]
Preview – d-inference — bbb46b21 Deployed Sep 11, 2026 by vercel[bot]
Preview – d-inference-landing — bbb46b21 Deployed Sep 11, 2026 by vercel[bot]
benchmarks — bbb46b21 Deployed Sep 11, 2026 by Gajesh2007 via E2E Benchmarks #906
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants