Skip to content

Add regulus-rb-usb / regulus-ra-usb target device support - #6

Merged
beomsu-mobilint merged 5 commits into
mainfrom
feat/regulus-rb-usb
Sep 9, 2026
Merged

Add regulus-rb-usb / regulus-ra-usb target device support#6
beomsu-mobilint merged 5 commits into
mainfrom
feat/regulus-rb-usb

Conversation

@beomsu-mobilint

@beomsu-mobilint beomsu-mobilint commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Register regulus-ra-usb and regulus-rb-usb in BACKEND_CLASSES, normalize_target_device, and the supported_target_devices tuples on the base and Regulus backends so callers can select the new qbruntime 1.4 USB variants without touching the runtime directly.
  • Forward the resolved target_device string as the first positional argument to qbruntime.Accelerator, matching the v1.4 signature that selects the physical device from the board name. Without this, USB and Regulus PCIe workloads silently landed on the default accelerator.
  • Route target_device into NPUTargetSpec.from_kwargs / NPUTargetSpecPending.finalize via a new _topology_for_target helper. dev_no sugar previously produced Aries's 2×4 grid regardless of board, so a Model Zoo config that named only target_device="regulus-*" was filled with eight Aries cores and then rejected by MobilintRegulusBackend. Every Regulus variant now expands to its sole d:0:0 core; Aries and unspecified callers keep the historical 8-core default.
  • Bump mobilint-qb-runtime>=1.4.0 — the new Accelerator(target_device, dev_no) signature is not backwards compatible with older releases.
  • Sync the README and AGENTS.md supported-board list, note the qbruntime floor, and pin the target-device-aware sugar rule so future spec entry points inherit it.

Test plan

  • python -m pytest tests/ — 80 passed (extended test_target_device.py with USB parametrizations, an Accelerator-signature check, direct NPUTargetSpec.from_kwargs sugar tests for every Regulus variant plus the Aries fallback, and Regulus-via-backend sugar tests; updated _FakeAccelerator in tests/test_npu_backend_multi_slot.py to the two-argument constructor).
  • python -m ruff check mblt_npu/ tests/
  • Verified end-to-end from mblt-model-zoo: _TargetDeviceConfig(target_device="regulus-rb-usb") now returns MobilintRegulusBackend with target_cores=["0:0:0"]; the default (no target_device) still resolves to MobilintAriesBackend.

qbruntime 1.4 accepts the board name as the first positional argument to
Accelerator and adds two USB variants ("regulus-ra-usb", "regulus-rb-usb").
Extend the dispatch table, backend supported-devices tuples, and validation
set to expose the new boards, and forward the resolved target_device string
to Accelerator so USB and PCIe workloads reach their intended hardware.

Bumps mobilint-qb-runtime>=1.4.0 because the new Accelerator signature is
not backwards compatible with older releases.
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

⚠️ Codex review did not complete successfully.

@beomsu-mobilint

Copy link
Copy Markdown
Contributor Author

@codex

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 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-09T06:55:20.421874Z a3e4385 Manual request
ℹ️ 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: 0553a5931d

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

Comment thread AGENTS.md
_resolve_targets hardcoded Aries's 2×4 grid when both target_cores and
target_clusters were absent. Model Zoo's MobilintConfigMixin runs the
config-layer normalization before the concrete backend __init__ can populate
its own default, so a Regulus config that named only target_device was
filled with eight Aries cores and then rejected by MobilintRegulusBackend's
one-core validation. The failure pre-dated regulus-rb-usb but blocks the
new target from being usable end-to-end from Model Zoo.

Add _topology_for_target and thread target_device through
NPUTargetSpec.from_kwargs, _resolve_targets, and NPUTargetSpecPending
(baseline / from_baseline / finalize). Backend __init__ and the _spec
promotion path forward self.target_device so setter-chain finalizes see
the same board as the config load. Aries and unspecified callers still
receive the historical 2×4 grid.

Tests cover both entry points (direct from_kwargs and end-to-end backend
construction) for every Regulus variant and the Aries fallback.
Codex review on PR #6 flagged .agents/skills/mblt-npu/SKILL.md as out of
sync with the supported-board / runtime-dependency changes; the
documentation-synchronization rule in AGENTS.md requires updating the
skill for either category. Record the USB identifiers, the qbruntime>=1.4
floor, and the board-aware dev_no sugar rule so the runtime guidance
matches the backend, README, and agent guide.
@beomsu-mobilint

Copy link
Copy Markdown
Contributor Author

Codex P1 addressed in 1ca5487: .agents/skills/mblt-npu/SKILL.md now records the USB identifiers, the mobilint-qb-runtime>=1.4.0 floor, and the board-aware dev_no sugar rule. The .claude/skills/mblt-npu/SKILL.md entry is a symlink to the same file per AGENTS.md, so no separate edit is needed.

@beomsu-mobilint

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 1ca5487f1a

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

Comment thread mblt_npu/npu_target.py
Codex P2 on PR #6: NPUTargetSpec.from_kwargs stored target_device only
on the transient normalization scope, not on the returned spec. A
follow-up spec._with(dev_no=...) constructed a fresh
NPUTargetSpecPending with target_device=None, so the sugar re-expansion
in finalize produced Aries's 2×4 grid — and passing the derived spec to
MobilintRegulusBackend then failed its sole-core validation.

Carry target_device as a metadata field on NPUTargetSpec (excluded from
equality/hash/repr so canonical identity is unchanged), thread it through
from_kwargs and finalize, and default NPUTargetSpecPending.from_baseline
to the baseline spec's board so specs constructed outside the backend
still keep their topology when derived.
@beomsu-mobilint

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: a3e4385401

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

Ships the qbruntime-1.4 USB target-device support (regulus-ra-usb,
regulus-rb-usb), the target_device-aware NPUTargetSpec sugar expansion,
and the associated qbruntime>=1.4.0 dependency floor.
@beomsu-mobilint
beomsu-mobilint merged commit 8075a26 into main Sep 9, 2026
3 checks passed
@beomsu-mobilint
beomsu-mobilint deleted the feat/regulus-rb-usb branch September 9, 2026 07:17
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