Skip to content

Add native Qwen3 14B A8W8 serving path - #48

Open
vegetabledoww wants to merge 7 commits into
hw-native-sys:mainfrom
vegetabledoww:qwen3-a8w8-stage5-serving-slim
Open

Add native Qwen3 14B A8W8 serving path#48
vegetabledoww wants to merge 7 commits into
hw-native-sys:mainfrom
vegetabledoww:qwen3-a8w8-stage5-serving-slim

Conversation

@vegetabledoww

@vegetabledoww vegetabledoww commented Jun 29, 2026

Copy link
Copy Markdown

Summary

Add a native Qwen3-14B A8W8 serving path that runs compressed W8A8 checkpoints through both the standard LLMEngine workflow and the OpenAI-compatible HTTP service.

The implementation covers the complete serving pipeline—from checkpoint loading and kernel compilation to L3 execution, paged KV-cache management, offline generation, and online completion/chat requests—while keeping the existing BF16 Qwen3 path isolated and unchanged.

Related to #52.

Uses the Qwen3 A8W8 kernel ABI landed by the merged pypto-lib PR #810.

What changed

Model format and checkpoint loading

  • Register qwen3-a8w8 as a serving model format.
  • Load compressed-tensors W8A8 checkpoints directly from local safetensors shards.
  • Convert checkpoint tensors into the layouts expected by the Qwen3 A8W8 kernels.
  • Preserve INT8 projection weights and their per-output-channel scales where supported.
  • Keep model configuration and tokenizer integration within the normal serving model-loading flow.

A8W8 executor and kernel compilation

  • Add a dedicated Qwen314BA8W8PyptoExecutor.
  • Compile the Qwen3-14B A8W8 prefill and fused decode kernels from the pinned pypto-lib source.
  • Build kernel placeholder tensors using the model/runtime configuration.
  • Stack layer weights into shared tensors and release per-layer sources after packing.
  • Keep A8W8 compilation state separate from the existing BF16 executor.

L3 model runner and dispatch

  • Add an A8W8 model runner using L3 DistributedProgram HOST wrappers.
  • Reuse the existing Qwen L3 dispatch module through format-local wrapper factories, avoiding changes to BF16 dispatch globals.
  • Preallocate and reuse shared buffers for hidden states, logits, sequence metadata, block tables, and slot mappings.
  • Construct paged prefill/decode inputs and dispatch the fused kernels through the shared distributed worker.
  • Use BF16 K/V cache pages and pass native INT8 Gate/Up weights with their scales.
  • Remove the earlier L2 fallback from the active path; A8W8 serving is intentionally L3-only.

Offline generation integration

  • Expose --model-format qwen3-a8w8 in examples/model/qwen3_14b/npu_generate.py.
  • Select the A8W8 loader, executor, runtime dtypes, and decode backend without affecting BF16 defaults.
  • Support the existing profiling and throughput reporting flow.
  • Preserve current prefix-cache configuration and automatic KV-page sizing from the main serving path.

Online OpenAI-compatible serving

  • Expose --model-format auto|qwen3-14b|qwen3-a8w8 in the main serving CLI.
  • Add --tokenizer so an A8W8 checkpoint can use a separate compatible Qwen3 tokenizer and official chat template.
  • Propagate model format and tokenizer settings through EngineConfig into worker processes.
  • Select the compressed-tensors A8W8 loader and executor in the serving worker.
  • Preserve the physical A8W8 runtime batch size of 16 while configuring online request concurrency independently through --max-num-seqs.
  • Validate the single-device topology, page size, runtime/KV dtypes, sequence limits, and checkpoint quantization method during startup so incompatible configurations fail before execution.
  • Support /health, /v1/models, /v1/completions, and /v1/chat/completions.

Commit breakdown

The PR remains intentionally split into seven reviewable commits:

  1. feat(qwen3-a8w8): add loader and L2 runtime support

    • Introduces the A8W8 checkpoint loader, model-format registration, and common runtime plumbing.
    • Establishes the initial tensor-layout conversion and model-loading foundation.
  2. feat(qwen3-a8w8): add A8W8 L2 model runner

    • Adds the A8W8 runner, paged KV-cache input construction, and model-specific execution state.
    • Provides the first complete runner path on top of the loader foundation.
  3. feat(qwen3-a8w8): compile kernels and wire generation CLI

    • Adds the dedicated A8W8 executor and kernel compilation/placeholder setup.
    • Connects qwen3-a8w8 to npu_generate.py and adds regression coverage.
  4. Use L3 dispatch for Qwen3 A8W8

    • Moves the active A8W8 path from the original L2 design to L3 DistributedProgram dispatch.
    • Reuses shared IO buffers and isolates A8W8 wrappers from the BF16 dispatch globals.
  5. feat(qwen3-a8w8): align serving with optimized kernels

    • Aligns the serving ABI with pypto-lib PR #810: BF16 KV cache and native INT8 Gate/Up inputs with scales.
    • Updates the pypto-lib pin and associated runner, placeholder, dispatch, and test contracts.
  6. fix(qwen3): adapt serving to latest PyPTO runtime

    • Adapts executor plumbing after PyPTO switched to runtime-managed PTO-ISA pinning.
  7. feat(qwen3): support A8W8 online serving

    • Connects A8W8 model-format and tokenizer configuration to the OpenAI-compatible server and worker process.
    • Adds explicit runtime validation and separates fixed physical batch size from online request concurrency.

Compatibility and boundaries

  • The existing BF16 Qwen3 loader, executor, runner, and HOST wrappers remain unchanged.
  • A8W8 currently supports a single device with DP=1, TP=1, and EP=1.
  • The online path requires block/page size 128, BF16 runtime and KV tensors, and a compressed-tensors checkpoint.
  • The matching kernel ABI was merged in pypto-lib PR #810.
  • The pypto-lib submodule is pinned to 7a63278, which provides BF16 KV-cache interfaces, native INT8 Gate/Up inputs and scales, and explicit RNE narrowing.
  • The A8W8 checkpoint does not contain a chat template; chat serving uses a separate compatible tokenizer, for example --tokenizer /data/models/Qwen3-14B.

Performance

Offline decode

Recent deterministic single-device A2/A3 runs measured approximately 38.8–39.6 ms/token:

  • 48-token generation: 39.6 ms/token over 47 decode steps.
  • 512-token generation: 38.8 ms/token over 511 decode steps.

Online decode

A single-device client-observed streaming test used one warm-up followed by five serial 48-token requests:

  • Successful requests: 5/5.
  • Average TPOT: 52.2 ms/token.
  • TPOT p50: 51.9 ms/token.
  • TPOT p99: 54.3 ms/token.
  • Average TTFT: 1617.1 ms.
  • Denominator: 47 decode steps per request, 235 decode steps total.

The online TPOT is measured from first-token arrival to last-token arrival. It includes per-step scheduler, worker IPC, HTTP/SSE, and local client overhead, so it is not directly equivalent to pure kernel or offline TPOT.

Validation

Static and unit checks

  • Ruff: passed.
  • Header and English-only checks: passed.
  • git diff --check: passed.
  • Qwen3 CLI/HTTP tests: 18 passed.
  • Focused A8W8 worker and batching tests: 11 passed.
  • Package, BF16, and DeepSeek regressions: 35 passed.
  • Total relevant unit tests: 64 passed.
  • A8W8 one-layer kernel compilation: passed.

Device validation

  • 2-token completion smoke test: passed.
  • 48-token deterministic A2/A3 generation: exact golden-token match with coherent output.
  • 512-token deterministic A2/A3 generation: coherent output with no NaN/Inf or abnormal repetition.
  • 1024-token chat-template generation: complete response and EOS after 910 generated tokens.
  • Online /health and /v1/models: passed.
  • Online 48-token completion: exact offline golden-text match.
  • Two concurrent online requests: both returned HTTP 200 and correct output.
  • Online chat completion with the official Qwen3 chat template: coherent response and natural EOS.

Performance test settings:

  • prompt: 介绍一下北京故宫
  • temperature=0
  • top_p=1
  • 48-token run: max_new_tokens=48, max_seq_len=256
  • 512-token run: max_new_tokens=512, max_seq_len=1024

Related work

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds an A8W8/BF16 checkpoint loader and decode-backend CLI options for Qwen3-14B, introduces L3-mode and A8W8-decode-loop execution paths with quantization-aware compilation and weight handling in the NPU executor, threads a pto_isa_commit parameter through the core executor, adds ContinuousTensor support to the worker, and adds a dependency-free Qwen byte-level BPE tokenizer fallback.

Changes

A8W8/L3 Decode Feature

Layer / File(s) Summary
A8W8 directory checkpoint loader
examples/model/qwen3_14b/runner/a8w8_loader.py
New _SafeTensorIndex shard reader, layout conversion helpers, and Qwen3A8W8DirectoryLoader that builds tokenizer/config/per-layer quantized and bf16 weights into a LoadedModel.
CLI options, model-loader wiring, and L2 profiling
examples/model/qwen3_14b/npu_generate.py
New --model-format, --decode-backend, --max-batch-size, --pto-isa-commit, --l3-mode, --a8w8-decode-loop flags; conditional Qwen3A8W8DirectoryLoader registration; QWEN_A8W8_BF16_KV env var; timed_run_l2 replaces prior L2 timing wrapper; RuntimeConfig dtype/batch updates.
Executor initialization and runtime patches
examples/model/qwen3_14b/runner/npu_executor.py
New imports/constants, TASK_ID fallback, _patch_orch_make_tensor_arg and _StackedLayerView, and extended __init__ with pto_isa_commit, l3_mode, a8w8_decode_loop.
Generation control flow for A8W8 loop and L3
examples/model/qwen3_14b/runner/npu_executor.py
New validate_generate_batch, prompt_allocation_length, try_generate_batch, run_generate_a8w8_decode_loop, run_generate_l3 selecting between decode-loop and L3 generation paths.
Quantization-aware L2/L3 compilation pipeline
examples/model/qwen3_14b/runner/npu_executor.py
_compile_model branches by quantization mode; A8W8-specific L2 callables; L3 artifact compilation/extraction with host orchestration patching; KV cache dtype override.
Mixed-precision weight stacking and release
examples/model/qwen3_14b/runner/npu_executor.py, tests/test_batching.py
Merged BF16/A8W8 decode weight stacking, per-projection scale tensor handling, weight-release cleanup, _model_quantization helper, and test update for decode_loop=None.
Core executor and worker support
python/core/pypto_executor.py, python/runtime/worker.py
pto_isa_commit threaded into RunConfig; WorkerTensor.to_continuous_tensor() added with ContinuousTensor compatibility import.

Dependency-free Qwen Tokenizer Fallback

Layer / File(s) Summary
Qwen byte-level BPE fallback tokenizer
python/core/tokenizer.py
Local vocab/merges detection in from_pretrained, byte/unicode and text-splitting helpers, and _QwenByteBpeTokenizer with encode/decode.

Sequence Diagram(s)

sequenceDiagram
  participant Engine
  participant Executor as Qwen314BPyptoExecutor
  participant A8W8Loop as run_generate_a8w8_decode_loop
  participant L3 as run_generate_l3

  Engine->>Executor: try_generate_batch(record, requests, prefill_batch, config)
  Executor->>Executor: validate_generate_batch / prompt_allocation_length
  alt a8w8_decode_loop enabled
    Executor->>A8W8Loop: run_generate_a8w8_decode_loop(...)
  else l3_mode enabled
    Executor->>L3: run_generate_l3(...)
  end
  Executor-->>Engine: GenerateResult(finish_reason)
Loading
sequenceDiagram
  participant main as npu_generate.main
  participant Loader as Qwen3A8W8DirectoryLoader
  participant Index as _SafeTensorIndex
  participant Runtime as RuntimeModel

  main->>Loader: load(request)
  Loader->>Loader: read config.json, build tokenizer
  Loader->>Index: scan model-*.safetensors shards
  Index-->>Loader: tensor offsets/dtype/shape
  Loader->>Index: load(key) per tensor
  Loader->>Loader: convert layouts (int8 kernel, bf16 dequant)
  Loader->>Runtime: populate embeddings/norm/head/layers
  Loader-->>main: LoadedModel
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • hw-native-sys/pypto-serving#14: Prior changes to the same npu_generate.py profiling/timed L2 wrapper and callable naming that this PR further modifies.
  • hw-native-sys/pypto-serving#17: Earlier kernel timing/profiling instrumentation in the same executor path that the new timed_run_l2 wrapper builds upon.
  • hw-native-sys/pypto-serving#29: Earlier L2-to-L3 dispatch switch in the same npu_executor.py that this PR extends with l3_mode, a8w8_decode_loop, and quantization-aware compilation.

Poem

A rabbit hopped through bytes and scale,
Found A8W8 weights without fail,
BPE tokens split so neat,
L3 orchestration, quite a feat,
Thump-thump — the decode loop runs fast,
New tensors continuous at last! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.77% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main change: adding a native Qwen3 14B A8W8 serving path.
Description check ✅ Passed The description is clearly aligned with the implemented Qwen3 A8W8 serving, loading, executor, and serving-path changes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces support for qwen3-a8w8 model quantization, including a new loader for compressed-tensors checkpoints and updated NPU execution and runner logic to handle A8W8 kernels and KV cache scaling. It also adds a dependency-free byte-level BPE tokenizer fallback. The review highlights significant code duplication in the NPU executor and runner logic, suggesting refactoring to improve maintainability. Additionally, it recommends performance optimizations for file I/O and tokenization, replacing SimpleNamespace with dataclass for better type safety, and avoiding bare except blocks.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread examples/model/qwen3_14b/runner/npu_executor.py Outdated
Comment thread examples/model/qwen3_14b/runner/npu_runner.py Outdated
Comment thread examples/model/qwen3_14b/runner/npu_runner.py Outdated
Comment thread pypto_serving/model/qwen/a8w8_loader.py
Comment thread examples/model/qwen3_14b/runner/a8w8_loader.py Outdated
Comment thread examples/model/qwen3_14b/runner/npu_executor.py Outdated
Comment thread examples/model/qwen3_14b/runner/npu_executor.py Outdated
Comment thread examples/model/qwen3_14b/runner/npu_runner.py Outdated
Comment thread python/core/tokenizer.py Outdated
@vegetabledoww
vegetabledoww force-pushed the qwen3-a8w8-stage5-serving-slim branch 3 times, most recently from b09f2cf to 2343c8e Compare July 1, 2026 02:12

@coderabbitai coderabbitai 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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/model/qwen3_14b/npu_generate.py`:
- Around line 421-422: The QWEN_A8W8_BF16_KV environment flag is only ever set
and never cleared in main(), so a previous bf16-kv run can leak into later A8W8
runs in the same process. Update the argument-handling path around
args.model_format and args.decode_backend to deterministically reset
QWEN_A8W8_BF16_KV for every invocation, explicitly setting it to "1" only for
qwen3-a8w8 with bf16-kv and removing or clearing it otherwise.

In `@examples/model/qwen3_14b/runner/a8w8_loader.py`:
- Around line 86-89: Reshape the linear scale tensor in _hf_linear_to_bf16
before multiplying so it broadcasts over output channels correctly instead of
the last axis. Update the _hf_linear_to_bf16 flow to explicitly reshape or
unsqueeze the loaded scale from index.load(scale_key) before the weight * scale
operation, then keep the transpose/contiguous BF16 conversion as-is.

In `@python/core/tokenizer.py`:
- Around line 248-250: The byte-level tokenizer input is being altered in
Tokenizer.encode by NFC normalization, which breaks round-tripping for
decomposed Unicode text. Remove the unicodedata.normalize("NFC", text) step from
encode and preserve the original input bytes before byte-level BPE processing;
keep the rest of Tokenizer.encode and decode behavior unchanged.
- Around line 135-181: Add parity tests for the Qwen fallback tokenizer behavior
in _split_qwen_text, focusing on edge cases where the current split logic can
diverge from Hugging Face: repeated spaces, newline handling, and
punctuation/space boundaries. Create coverage that compares the fallback output
against the expected Qwen regex-based tokenization behavior for representative
inputs, so regressions are caught before relying on this path in serving.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5243ea88-e297-4ca7-9abc-c6e9f3bcda03

📥 Commits

Reviewing files that changed from the base of the PR and between d37496a and 2343c8e.

📒 Files selected for processing (8)
  • examples/model/qwen3_14b/npu_generate.py
  • examples/model/qwen3_14b/runner/a8w8_loader.py
  • examples/model/qwen3_14b/runner/npu_executor.py
  • examples/model/qwen3_14b/runner/npu_runner.py
  • python/core/pypto_executor.py
  • python/core/tokenizer.py
  • python/runtime/worker.py
  • tests/test_batching.py

Comment thread examples/model/qwen3_14b/npu_generate.py Outdated
Comment thread pypto_serving/model/qwen/a8w8_loader.py
Comment thread python/core/tokenizer.py Outdated
Comment thread python/core/tokenizer.py Outdated
@vegetabledoww

Copy link
Copy Markdown
Author

Follow-up on the two addressed serving review comments:

  1. A8W8 loader scale broadcast fixed in dd81f52: _hf_linear_to_bf16 now reshapes the per-output-channel scale to [-1, 1] before multiplying HF [out, in] weights.
    Inline reply: Add native Qwen3 14B A8W8 serving path #48 (comment)

  2. Byte-level tokenizer input preservation fixed in dd81f52: removed NFC normalization before byte encoding, and verified e\\u0301 encode/decode roundtrip.
    Inline reply: Add native Qwen3 14B A8W8 serving path #48 (comment)

Validation: 48-token Qwen3 A8W8 generation remained normal, TTFT 7.054s, TPOT 67.8 ms/token.

@vegetabledoww
vegetabledoww force-pushed the qwen3-a8w8-stage5-serving-slim branch 6 times, most recently from 77e943b to e6a73fd Compare July 9, 2026 02:04
@vegetabledoww
vegetabledoww force-pushed the qwen3-a8w8-stage5-serving-slim branch from e6a73fd to 9a34ac6 Compare July 9, 2026 02:15
zhangqi-chen pushed a commit to hw-native-sys/pypto-lib that referenced this pull request Jul 9, 2026
## Summary

Add the Qwen3-14B A8W8 kernel implementation used by the native serving
path.

This PR keeps the existing BF16 Qwen3 path isolated and introduces
separate A8W8 prefill/decode modules for the quantized model:

- add `prefill_hidden` support for Qwen3-14B A8W8 hidden-state prefill
chunks
- add the optimized A8W8 `decode_fwd` layer kernel used by serving
decode
- handle INT8 weights, activation/weight scales, paged KV cache scale
metadata, and A8W8-specific decode constants inside the A8W8 modules
- keep scheduling, model loading, tokenizer, and request orchestration
in `pypto-serving` rather than carrying standalone lib-side runners
- keep the ordinary BF16 Qwen3-14B execution path separate from the A8W8
path

## Implementation Notes

The lib-side deliverable is intentionally limited to kernels and
kernel-adjacent compatibility:

- `models/qwen3/14b/prefill_fwd_a8w8.py` implements the A8W8 prefill
hidden path
- `models/qwen3/14b/decode_layer_a8w8.py` implements the A8W8 decode
layer path used by serving
- `golden/runner.py` compatibility changes keep generated/runtime
artifacts runnable for the JIT path
- obsolete standalone debug/golden entry points were removed during
slimming; debug-stage switches in the kernel remain available for
targeted numerical diagnosis

## Validation

End-to-end validation was run through the native serving stack with this
kernel PR plus the matching serving/backend PRs:

- prompt: `介绍一下北京故宫`
- generated tokens: 48
- output quality: normal Chinese continuation
- TTFT: `7.054s`
- TPOT: `67.8 ms/token`
- decode throughput: `14.76 tok/s`

Focused serving and PyPTO checks also passed in the matching PRs.

## Related PRs / Issues

- Tracking issue: #665
- Serving-side PR: hw-native-sys/pypto-serving#48
- PyPTO backend/lowering PR: hw-native-sys/pypto#1920

Co-authored-by: vegetabledoww <vegetabledoww@users.noreply.github.com>
@vegetabledoww
vegetabledoww force-pushed the qwen3-a8w8-stage5-serving-slim branch 4 times, most recently from 39924ca to 2a24e51 Compare July 10, 2026 01:10

vegetabledoww commented Jul 10, 2026

Copy link
Copy Markdown
Author

Maintainer note: hw-native-sys/pypto-lib#642 has been merged and contains the required prefill_fwd_a8w8.py and decode_layer_a8w8.py kernels. However, this PR currently still pins the pypto-lib submodule to 57772f304bbcaee927b51227f6aa495a5591debf, which predates those files. A clean checkout followed by git submodule update --init will therefore still fail when _load_pypto_lib_qwen14b_module() tries to load the A8W8 kernels.

Before merging this PR, please update the pypto-lib gitlink to the #642 merge commit (1ebb1193f4a1290b0c0f0d11b1f86a2f5c2959d3) or a newer compatible commit. This is a repository dependency-pin/merge-order note rather than an issue with the Python implementation itself.

@vegetabledoww
vegetabledoww force-pushed the qwen3-a8w8-stage5-serving-slim branch 5 times, most recently from 8a2b15f to 91aae68 Compare July 13, 2026 09:39
@vegetabledoww
vegetabledoww force-pushed the qwen3-a8w8-stage5-serving-slim branch 8 times, most recently from 51a55d4 to 8c4d493 Compare July 23, 2026 09:08
@vegetabledoww

Copy link
Copy Markdown
Author
image

@vegetabledoww
vegetabledoww force-pushed the qwen3-a8w8-stage5-serving-slim branch 3 times, most recently from d2141ea to b87e3d3 Compare July 24, 2026 06:28
Add the compressed-tensors A8W8 loader for Qwen3-14B checkpoints and extend the common PyPTO runtime plumbing for PTO ISA pinning.
Add the Qwen3-14B A8W8 L2 runner responsible for paged KV cache management, child-memory argument preparation, prefill dispatch, decode dispatch, and logits collection.
Add the A8W8 PyPTO executor, connect npu_generate.py to the qwen3-a8w8 model format, keep BF16 and A8W8 runtime settings isolated, and add regression coverage for loader, runner, and CLI behavior.
Route Qwen3-14B A8W8 prefill and decode through HOST-level L3 wrappers, preallocate shared IO buffers for the L3 runner, and remove the A8W8 L2 callable fallback from the serving path.

Consolidate A8W8 HOST wrappers into the existing Qwen3 L3 dispatch module. Use a closure-based factory to keep A8W8 kernel dependencies isolated from the BF16 dispatch globals.

Validation: Python compile and pre-commit checks passed; 8-token A8W8 generation produced expected text at 55.1 ms/token, and prior 48-token L3-only validation succeeded.
Use BF16 KV caches and remove the obsolete per-row KV scale buffers to match the updated pypto-lib kernel ABI.

Keep Gate and Up weights in INT8 form, propagate their scales through loading, compilation, and L3 dispatch, and update placeholder tensors accordingly.

Refresh batching assertions for the split prefill embedding paths.

Validated with: pytest -q tests/test_batching.py (37 tests completed; the local NPU runtime hung during process teardown).
Remove the obsolete pto_isa_commit CLI and executor plumbing now that PyPTO resolves managed PTO-ISA revisions from its runtime pin.

Validation: pre-commit passed; 12 focused batching tests passed; deterministic 48-token A8W8 generation preserved the expected token IDs at 42.7 ms/token.
@vegetabledoww
vegetabledoww force-pushed the qwen3-a8w8-stage5-serving-slim branch from b87e3d3 to 5d8e271 Compare July 27, 2026 01:50
Add explicit Qwen3 A8W8 model-format and tokenizer configuration to the online serving CLI, and propagate both settings through EngineConfig to worker processes.

Select the compressed-tensors A8W8 loader and executor in the serving worker. Preserve the physical runtime batch size of 16 while allowing the online request concurrency to be configured independently.

Validate the supported single-device topology, page size, runtime and KV dtypes, sequence limits, and checkpoint quantization method at startup so incompatible configurations fail before model execution.

Validation:
- Ruff, header, English-only, and diff checks pass
- 64 relevant unit tests pass, including Qwen3, HTTP, BF16, and DeepSeek coverage
- Device 0 completion, chat, and two-request concurrency tests pass
- 48-token output matches the offline golden result
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