Skip to content

feat(edgellm): add newer Qwen API dispatch - #1253

Draft
JCalafato wants to merge 2 commits into
NVIDIA:mainfrom
JCalafato:feat/edge-llm-config-dispatch
Draft

JCalafato wants to merge 2 commits into
NVIDIA:mainfrom
JCalafato:feat/edge-llm-config-dispatch

Conversation

@JCalafato

@JCalafato JCalafato commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Background

Newer Qwen families should reuse Edge-LLM when the checkpoint, build request and executing platform are supported. This adds automatic complete-network delegation while keeping ownership and failure isolation inside each family.

Exit Criteria

  • Automatically select family-owned Edge adapters for supported Qwen3.5/3.8 requests and native platforms; leave Qwen3 and older unchanged.
  • Provision a pinned dependency once through CMake; ordinary builds/inference never clone or install packages.
  • Demonstrate real Qwen3.5 build/inference and failure isolation without weakening quality criteria.
  • Pass required exact-head CI before marking this draft ready. The previously reported architecture-test mismatches are now repaired with approval and regression coverage.

Implementation

  • Independent family maps match compatible dense FP16 text-generation requests and OS/CPU/GPU SM. Installed-package checks enforce the pin and CUDA/TensorRT compatibility.
  • Thin adapters call upstream builder main() and persistent LLMInferenceRuntime APIs. Ordinary Edge preparation failure warns, retains diagnostics and retries native once with the unchanged request. Publication errors, cancellation and inference errors do not silently switch backends.
  • Optional native-only CMake find_package/ExternalProject provisioning installs Edge v0.10.1 at an immutable commit. Cross compilation is rejected.
  • Model-agnostic platform/prefix discovery and bounded BundleReader::copy_section support the integration. Family markers/assets identify Edge bundles; the existing task ABI and core bundle-format version remain unchanged.
  • Architecture tests retain the exact shared-file inventory and mandatory request fields. A bounded family-local traversal recognizes actual delegated calls and callbacks; negative tests reject unused helpers, unrelated requests, overwritten callbacks and missing handling. No family exemption or quality-threshold change is introduced.

Change categories

  • Model or runtime behavior
  • Public API
  • ABI
  • Bundle or artifact format
  • Dependencies
  • Documentation only
  • CI or developer tooling

Validation

Commands and Results

Architecture-only follow-up, candidate head 05700b6f25544e1126db4ad4ae903b774c3c44f9:

  • "$TEST_PYTHON" -m pytest -q tools/tests/test_architecture.py: 74 passed.
  • python -m tools.community_ci source-quality --base github/main: passed, including 157 contract tests, using pinned Ruff 0.16.4, clang-format 22.1.8 and lizard 1.21.2.
  • python -m tools.community_ci unit in a standalone exact-head checkout: passed. 447 Python tests passed, all 1,210 C++ build steps completed, and CTest finished successfully (142 passed, 6 skipped in the GPU-free container). The initial worktree-mounted attempt failed only because its external Git metadata was outside the container; no test criteria were changed.
  • GitHub Community CPU run34540437332: passed on 05700b6f25544e1126db4ad4ae903b774c3c44f9, including source quality, docs, ownership, units and Required aggregate. DCO and PR Metadata also passed.
  • Protected premerge: pending on the same head, dispatched through the trusted bridge after public CPU success. Dispatch is not a premerge pass.

Implementation/hardware evidence at 42cdea6c137839741443c9794610321fcfa59d8d, before the test-only follow-up:

  • "$QUALIFICATION_PYTHON" -m pytest -q core/builder/tests families/qwen3_5/tests families/qwen3_8/tests -m "not e2e and not gpu and not trt": 261 passed, 2 skipped.
  • ctest --test-dir /tmp/newer-edge-runtime --output-on-failure -R "edge|bundle_format": 8 passed, after rebuilding both family runtimes, validation drivers and bundle/adapter contracts.
"$QUALIFICATION_PYTHON" -m tensorrt_model_connect build \
  /tmp/trtmc-edge-validation/checkpoint --precision fp16 \
  --max-sequence-length 1024 \
  -o /tmp/trtmc-edge-validation/publish-42cdea6c/qwen35.bundle
"$QUALIFICATION_PYTHON" -m families.qwen3_5.tests.edge_validation \
  --bundle /tmp/trtmc-edge-validation/publish-42cdea6c/qwen35.bundle \
  --runtime-root /tmp/newer-edge-runtime \
  --output /tmp/trtmc-edge-validation/publish-42cdea6c/proof \
  --hf-checkpoint /tmp/trtmc-edge-validation/checkpoint \
  --hf-reference /tmp/trtmc-edge-validation/hf-reference.json

Passed: automatic Edge build; exact Model Connect/direct-Edge greedy token/text parity; raw/chat/EOS; unsupported-control and capacity rejection; persistent repeat after rejection; unchanged family quality criteria against an independently generated CPU FP32 HF reference. The harness rejects native fallback bundles. These hardware results are not a fresh run on the test-only follow-up head. No performance qualification is claimed.

Hardware, Environment, and Revisions

  • Candidate head: 05700b6f25544e1126db4ad4ae903b774c3c44f9; base: a50cf5dc215e84c1d9341a8ef72f7df746bde894. Hardware proof head: 42cdea6c137839741443c9794610321fcfa59d8d.
  • A30 SM80, x86_64 Ubuntu 24.04, Python 3.12, CUDA 13.3, TensorRT 11.1.0.106; FP16 engines.
  • Qwen/Qwen3.5-0.8B: 2fc06364715b967f1860aea9cf38778875588b17.
  • Edge v0.10.1: e8b29522938901f6df19ebeedd4b69bc8edbcd97. Its package, all 28 FMHA/GDN AOT variants and separate-prefix installation were validated before the hardware-proof rebase; the installed package was reused with CMAKE_PREFIX_PATH=/tmp/trtmc-edge-native-install.

Not Run / Remaining Gaps

  • Protected premerge remains pending on 05700b6f25544e1126db4ad4ae903b774c3c44f9; public CPU has passed. No protected premerge pass is claimed.
  • Qwen3.8 GPU inference remains unvalidated: the selected 27B FP16 checkpoint does not fit the available A30. Other candidate platforms are not individually qualified.
  • Community GPU execution has separate pre-existing workflow/runner blockers; draft fix(ci): fail closed in community GPU workflow #1255 contains the isolated safety/status repair and is not part of this feature diff. No Community GPU pass is claimed.

Contributor Self-Review

  • I have completed a self-review of this change.

Manual and independent reviews covered family ownership, fallback boundaries, direct upstream APIs, validation evidence and conservative architecture-test attribution. Required exact-head CI remains the draft readiness gate.

Notes For Future Readers

Review CMake provisioning, family dispatch/build mapping, bounded streaming, then family runtime/tests and architecture regressions. Suggested reviewers: @yifeif-nv, @chaofengw-nv and @xuanzic.

Edge support is optional at CMake configuration time and automatic at model build time. Bundles retain the selected implementation and require a matching native SDK/platform at inference. Update the pin and rebuild artifacts together; model-specific orchestration must remain family-owned. Family documentation includes setup and reproduction without the precomputed HF report.

Risk level

  • Low
  • Medium
  • High

Optional provisioning limits exposure, but package compatibility and complete-network delegation span build/runtime boundaries. The test-only follow-up changes no production behavior or model acceptance threshold.

Provision pinned native Edge-LLM through optional CMake infrastructure. Let Qwen3.5 and Qwen3.8 own configuration/platform dispatch and thin builder/runtime API adapters, with warning and one native retry after builder failure.

Add family-local contract and real inference validation. Keep legacy Qwen unchanged and document unqualified configurations and the architecture checks awaiting maintainer review.

Signed-off-by: Joshua Calafato <jcalafato@nvidia.com>
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

Keep the closed CMake inventory explicit for Edge provisioning. Follow bounded family-local request and invoked callback handling without crediting dead, shadowed, foreign or unrelated helpers. Preserve the mandatory field set and cover positive and negative delegation cases.

Signed-off-by: Joshua Calafato <jcalafato@nvidia.com>
@nvluxiaoz

Copy link
Copy Markdown

Please add more model to the dispatch logic since we have seen more Edge-LLM supported model being reimplemented here.

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