Repository navigation
Add pinned Clef-flash and Clef text reference worker - #165
Conversation
Add a Python reference worker for Cloudflare Clef-flash and Clef on /v1/systemone. It hashes the public joint-schema loader, refuses over-long text instead of slicing it, and leaves image, video and native CUDA unsupported. Public231 concurrency-1 timing on L20X is an operator checklist; no latency was measured. Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
|
For the next operator handoff at head The concrete missing evidence is the first real checkpoint load/warmup and HTTP inference, followed by reference parity and the documented Public231 C1 campaign. Please run The 26 CPU tests and matching Clef 27B should remain explicitly unverified until its own weights/configuration have loaded and executed successfully. Sharing the loader and tokenizer with flash is not a numerical qualification of the larger checkpoint. This is an operator-readiness follow-up; no GPU run or approval is claimed here. Agent-assisted readiness follow-up using the repository review skill pinned at trusted main |
Stock Public231 sends a thinking object. HEAD 9030065 returned HTTP 422 for that field, so the measured campaign used a stripped manifest. enabled false is now removed before encoding; enabled true stays rejected. The operator-reported flash Public231 C1 primary is run1 p50 247.518 ms and p95 413.025 ms. No unmeasured serve-path change is included. Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Transformers 5.10.2 keeps the PyTorch gated-delta fallback unless flash-linear-attention and causal-conv1d import first. The recipe now installs those builds, and /health reports which binding loaded. The Public231 C1 primary is unchanged at run1 p50 247.518 ms and p95 413.025 ms. No new latency or answer-parity delta was measured. Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Ready now requires flashinfer-python 0.6.16.post3, flash-linear-attention 0.5.2, and causal-conv1d >= 1.5, with the chunk global replaced before Qwen3.5 layers copy it. Startup fails closed on torch_chunk, F.conv1d, an FLA-only chunk, and any CUDA device that is not compute capability 9.0. The recorded L20X Public231 rounds stay labeled L20X. No H200 C1 is claimed. Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Ready no longer depends on compute capability 9.0 or on the name H200. FlashInfer GDN prefill is used when the reported major is 9, 10, or 12 and the pinned package loads. A device that reports 8.9, including nvidia-smi name NVIDIA L20X, stays on the FLA chunk plus causal_conv1d. /health reports the bind that actually started. torch_chunk and F.conv1d still refuse ready. No new C1 number is claimed. Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
The L20X-labeled lab Public231 C1 of that tip is 231/231, p50 164.969 ms, p95 216.755 ms, with /health linear_attention fla+causal_conv1d. Against 9030065 run1 that is Δp50 −33.35% (−82.5 ms) and Δp95 −47.52% (−196.3 ms). The serve path is unchanged. A later code tip needs its own paste. Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
The requirements comment still said this tip had no Public231 C1. Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
The L20X-labeled paste is warmup 5, concurrency 1, stock Public231 with thinking.enabled false, and metric successful_latency. Tip p50 164.969 ms and p95 216.755 ms, 231/231, health fla+causal_conv1d, versus 9030065 run1: Δp50 −82.549 ms (−33.35%), Δp95 −196.270 ms (−47.52%). The serve path is unchanged. Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
|
Thanks for the careful work on this. Some review findings: P1 — no warmup forward before P1 — FlashInfer GDN prefill path has never been executed ( P2 — P2 — one test depends on the packages being absent ( P3 — inference lock acquired before the body is read ( P3 — self-review counts Provenance: reviewed with |
…-worker-62ca Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
One text forward runs before the port binds, so CUDA init fails at startup. FlashInfer GDN prefill stays behind --gdn-prefill flashinfer until a forward and answer parity against the FLA path exist. Clef pytest runs in CI, the pin test ignores installed packages, and the inference lock is taken only after the body is read. Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
…-worker-62ca # Conflicts: # README.md # docs/supported-models.md # mkdocs.yml Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Required human contributor answers
What outcome are you trying to achieve?
Answer: A first self-hosted integration of Cloudflare Clef / Clef-flash behind
/v1/systemoneforchoice,noulandscore, with the serve path measurable as Public231 concurrency 1 on the lab hostnvidia-sminamesNVIDIA L20X. Source: owner request on 2026-10-24 for issue [New Model]: Support Cloudflare Clef / Clef-flash — community help wanted #162, plus the 2026-10-25 standing that this named host is the measurement machine even when it reports capability 8.9.What is the highest-leverage variable for that outcome?
Answer: Pinning the public Clef-flash snapshot and the linear-attention bind that the host can run, then recording Public231 C1. The remeasure of tip
594528a9is the primary: p50 164.969 ms, p95 216.755 ms. Source: the owner remeasure on 2026-10-25. On that paste,/healthwasfla+causal_conv1d.How will this work move that variable rather than create busywork?
Answer: The worker loads the hashed upstream joint-schema loader, refuses over-long state, and admits
thinking.enabled: false. Startup requirescausal-conv1d>=1.5andflash-linear-attention==0.5.2. The default prefill is that FLA chunk on every reported capability, including majors 9, 10, and 12.--gdn-prefill flashinferis opt-in and refuses startup whenflashinfer-python==0.6.16.post3does not import or the reported major is not 9, 10, or 12. That path has no measured forward and no answer parity againstfla+causal_conv1d; the parity run is the named follow-up blocker. One text forward runs before the port binds, so CUDA init fails at startup. The verified tip stays. A later code change is a new tip and needs its own C1 paste against p50 164.969 ms and p95 216.755 ms. Source: owner messages through 2026-10-25, including the remeasure and the review request to warm up before/healthand to keep FlashInfer opt-in.Who is the customer or user, and what do they actually need?
Answer: System1-Omni operators serving open decision models, and the owner reviewing [New Model]: Support Cloudflare Clef / Clef-flash — community help wanted #162. They need the self-hosted text path and the recorded p50/p95 on the L20X-labeled host. Source: issue [New Model]: Support Cloudflare Clef / Clef-flash — community help wanted #162 and the owner requests.
After answering the four questions: is a PR needed at all to achieve this outcome?
Human decision and rationale (or explicit source reference): Yes. The owner asked to open the pull request and not to merge. This update stays a draft. No merge without a separate yes.
For a bug fix: link actual observed failure evidence.
Evidence: The integration itself is the #162 new-model request. On HEAD
9030065, stock Public231 with athinkingfield failed warmup (HTTP 422), so that baseline used the stripped manifest. Tip4e430e18then refused ready on the lab GPUs that report capability 8.9. Tip594528a9started and was remeasured. Source: owner reports on 2026-10-25.Purpose
Tracks #162. Draft. Do not merge.
Python reference worker for Clef-flash (9B) and Clef (27B). Text
choice,noul, andscoreonPOST /v1/systemone. Image, video, native CUDA, and Workers AI are out of scope.thinking.enabled: falseis admitted and omitted from the prompt. Over-long state is refused.The measured serve path is tip
594528a9f9c1ca38ce0dbb58a549191dfbde5bf3. On the L20X-labeled host it boundfla+causal_conv1d. That FLA chunk is the default on every reported capability.--gdn-prefill flashinferis opt-in.torch_chunk_gated_delta_ruleandF.conv1dare not served. Commit980b4c148eff7b497be424a907767d0316636820adds the startup forward, the opt-in flag, CI, the hermetic pin test, and the lock-after-read change. It does not change the measured kernel and has no new C1.origin/mainis51f80ad681c8f7b1be9b22b5e700bef34e33534c. Merge504b272c46dc1963f981c6bed9ef0c7ebdd40c69brings that main in. README,docs/supported-models.md, andmkdocs.ymlconflicted; both the Clef rows and the incoming pplx-decider and StartLux rows are kept. The Clef sources match980b4c1.Review follow-up, unchanged by the merge:
listenbefore the socket binds.GET /healthis not served until that forward returns. A CUDA failure exits before the port opens.--gdn-prefill flashinfer, a successful import offlashinfer-python==0.6.16.post3, and reported major 9, 10, or 12. Reported 8.9 stays on FLA. The parity run againstfla+causal_conv1dis the named blocker before that flag can become the default.tests/clefruns under pytest in the benchmarks CI job. The tests are weight-free.test_linear_attention_pins_and_startup_fail_closedmocksimportlib.metadata.versionso installed pins still fail closed.Room-facing metrics
The baseline rounds that were fully specified earlier, metric
successful_latency, clockpost_to_body_json_and_schema_validation, warmup 5, manifestpublic231-no-thinking.jsonl:The tip comparison uses run1. Percentiles are not averaged. This tip pair is the primary. The startup forward in
980b4c1is separate from client warmup 5 and is not a latency sample.Test Plan
PYTHONPATH=src python3 -m pytest tests/clef -qpython3 -m compileall -q src/models/clef src/frontend/clef.py tests/clefpython3 -m mkdocs build --strictPYTHONPATH=src python -m pytest tests/clef -q.Test Result
System1-Omni Version / Commit: branch tip
504b272c46dc1963f981c6bed9ef0c7ebdd40c69. Review-fix behavior980b4c148eff7b497be424a907767d0316636820. Measured serve path594528a9f9c1ca38ce0dbb58a549191dfbde5bf3. Baseline903006530fb7772bb668bbf192ee4278e273e583./healthfla+causal_conv1d. Versus baseline run1: Δp50 −82.549 ms (−33.35%), Δp95 −196.270 ms (−47.52%). Warmup 5, concurrency 1, stock Public231 withthinking.enabledfalse, metricsuccessful_latency.51f80admerge:PYTHONPATH=src python3 -m pytest tests/clef -q— 32 passed in 3.31s.python3 -m compileall -q src/models/clef src/frontend/clef.py tests/clef— passed.python3 -m mkdocs build --strict— passed. The Material for MkDocs 2.0 warning is pre-existing.Still open from the readiness note, and unchanged by this merge: Clef 27B timing, answer parity, joint-head execution (these CPU tests do not run the head), Rust frontend forwarding versus this Python worker, and the tip paste's clock name, manifest SHA, driver, and CUDA version. Over-length refusal remains covered by the weight-free tests.
Demo / evidence
N/A for a visual demo. The latency figures are the operator paste. This environment did not run the campaign.
9030065run1, p50 247.518 ms, p95 413.025 ms, 231/231594528a9, p50 164.969 ms, p95 216.755 ms, 231/231,/healthfla+causal_conv1dthinking.enabledfalse, metricsuccessful_latencySelf-review
Self-review size at
504b272c46dc1963f981c6bed9ef0c7ebdd40c69versusorigin/main51f80ad681c8f7b1be9b22b5e700bef34e33534c(git diff --numstat origin/main...HEAD): total 25 files, 3517 changed lines (3516 insertions, 1 deletion). Authored code is 2328 lines (src/,tests/excepttests/clef/fixtures/text_contract.json,.github/workflows/ci.yml, andrecipe/clef/export_prompt_fixture.py). The token fixture is 760 lines. Docs and other Markdown are the remaining 429 lines. Authored code is under 3,000.The PR stays in draft. The recorded win is the operator remeasure for
594528a9.980b4c1changes startup and the default bind selection.504b272only merges main. Neither changes the measured FLA kernel on reported 8.9, and neither has a new latency claim. A later tip has to beat p50 164.969 ms and p95 216.755 ms on its own paste.Docs/record head:
504b272(merge oforigin/main51f80adonto the980b4c1review fixes; measured serve path unchanged).Optimization closeout (2026-10-25)
Status: ready for owner review — no merge
Close at best-so-far primary:
594528a9Protocol: Public231 C1, warmup 5, concurrency 1,
thinking.enabled=false, metricsuccessful_latencyGain chart: shared in system1 room
Goal
Self-hosted Clef-flash (9B) / Clef text path on
/v1/systemone, measurable as Public231 C1, with a dual p50+p95 gate for any later tip.Current primary (best so far)
594528a9f9c1ca38ce0dbb58a549191dfbde5bf38d585240(remeasure record; does not change serve path)/healthlinear_attention=fla+causal_conv1d收益 (gains) vs campaign start
Campaign start = baseline worker
9030065run1.9030065594528a9Baseline repeats (for context; gate used run1): run2 247.404/426.231; run3 242.421/410.369.
搜索过程 (search process)
90300654e430e18594528a9fla+causal_conv1d(capability-aware FI held off)This campaign did little further tip search after the KEEP; primary holds.
What worked vs rejected (lessons)
fla+causal_conv1d) and recording a clean Public231 C1 — large p50 and p95 wins vs stock baseline.4e430e18sm_90-only gate (would not become ready here).Closeout
Draft for owner review. Do not merge without a separate yes.