Skip to content

[Ascend] Extend eager runtime support for Ouro - #211

Open
KrystalRay wants to merge 13 commits into
InferMatrixLab:mainfrom
KrystalRay:feat/ascend-ouro-platform-coverage
Open

KrystalRay wants to merge 13 commits into
InferMatrixLab:mainfrom
KrystalRay:feat/ascend-ouro-platform-coverage

Conversation

@KrystalRay

@KrystalRay KrystalRay commented Nov 24, 2026 •

Copy link
Copy Markdown

Purpose

Extend the single-device Ascend eager backend introduced in #168 for Ouro-1.4B and Ouro-2.6B. Following the platform integration approach in #171, this PR uses the shared Stage/Loop scheduler and exit policies for BF16 greedy decoding with last_exited paged KV.

Ascend Prefix Cache is tracked separately under RFC #172.

Scope

  • Default to auto attention selection for NPU serving, preferring ascend_eager with a compatible Torch fallback.
  • Enable synchronous ouro and synchronous or asynchronous ouro_delayed. Prefill runs all four loops.
  • Validate incremental KV allocation independently, including initial allocation, cross-page growth, and output parity against full reservation. Qualify matched chunked prefill on a real checkpoint.
  • Enable priority preemption with resident KV or host offload and restore.
  • Enable synchronous block and token-pipeline self-speculation for fixed-depth greedy requests.
  • Enable reusable eager workspaces and optional power-of-two padding under asynchronous execution.

Test Plan

Current base 4821d47, merge head e59e3f2. The merge verification covers CPU regressions for input preparation, serving, workspace lifecycle, prefill, KV, speculation, and backend selection.

The full Ascend-marked suite ran on e1fb5b1 against base ce200f0 on 910B3 with CANN 9.0 and Torch-NPU 2.10.

  • CPU regression selection covering input preparation, request lifecycle, serving, and backend selection.
  • Full pytest --run-npu -m npu selection covering workspace event ownership, adaptive-exit parity, observed 3→4 recurrent padding, resident and offloaded preemption, packed prefill and incremental KV, and synchronous speculation.
  • Real Ouro-1.4B HTTP completions, streaming, and disconnect recovery with multi-stream async decode, adaptive exit, incremental KV, wavefront prefill, and static padding enabled. Three low-priority streams had started when a high-priority request arrived. The high-priority request completed first.

Test Result

  • Post-merge CPU regression selection: 444 passed on e59e3f2.
  • CPU regression selection: 104 passed on e1fb5b1.
  • Ascend regression: 69 passed on e1fb5b1, including all five real-checkpoint HTTP variants.
  • Both new lifecycle regressions reproduced on 32424ea. On e2fe107, a standalone workspace retires its previous NPU consumer before reuse, and seven adaptive requests complete across at least six suspensions with a pool of five gate readback slots. Restored requests preserve their exit depths.
  • An earlier Ouro-2.6B BF16 run on 32424ea used four fixed GSM8K prompts and 24 output tokens per request. Both block and pipeline self-speculation exercised actual draft rejection and matched ordinary four-loop output token for token on that cohort. On 910B3, a change in the number of BF16 Linear rows between block verification and serial decode can shift near-tied logits by one ULP and change the greedy token.

Ouro-2.6B adaptive-exit quality screen

The earlier BF16 greedy GSM8K-87 run used the same exit implementation, three demonstrations, strict answer scoring, and up to eight requests per cohort. Adaptive runs used min_loops=2 and max_loops=4.

Exit policy Threshold Correct Mean decode loops
Fixed four loops 1.0 61/87 4.00
Synchronous ouro 0.2 59/87 2.09
Asynchronous multi-stream ouro_delayed 0.2 67/87 3.10

These scores describe the fixed 87-question cohort. See the Ascend Ouro recipe for configurations and validation scope.

AI assistance was used for implementation, test automation, and drafting this description.

KrystalRay added 13 commits November 24, 2026 00:44
Signed-off-by: KrystalRay <keeleiray@gmail.com>
Signed-off-by: KrystalRay <keeleiray@gmail.com>
Signed-off-by: KrystalRay <keeleiray@gmail.com>
Prefer ascend_eager for compatible NPU attention and let the serving CLI default to auto on NPU. Keep backend capabilities and explicit choices on the shared selection path.

(cherry picked from commit 0b772e24f31d6db3fb01ff42e255af164cf18100)
Signed-off-by: KrystalRay <keeleiray@gmail.com>
Signed-off-by: KrystalRay <keeleiray@gmail.com>
Check exact packed versus per-query logits with real Ouro weights at aligned and unaligned chunk boundaries. Document why cross-chunk BF16 tests use a separate comparison.

(cherry picked from commit 0bffe84)
Signed-off-by: KrystalRay <keeleiray@gmail.com>
Signed-off-by: KrystalRay <keeleiray@gmail.com>
Signed-off-by: KrystalRay <keeleiray@gmail.com>
Reuse runner completion events for workspaces and retain pending adaptive exit scores without pinning readback slots across preemption. Cover real NPU scheduling and HTTP priority admission, and document eager workspace costs.

Signed-off-by: KrystalRay <keeleiray@gmail.com>
Signed-off-by: KrystalRay <keeleiray@gmail.com>
Signed-off-by: KrystalRay <keeleiray@gmail.com>
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.

1 participant