Skip to content

[Benchmark] Guess correct input dtypes#230

Open
kozlov721 wants to merge 16 commits into
feat/general-device-monitorfrom
fix/incorrect-archives
Open

[Benchmark] Guess correct input dtypes#230
kozlov721 wants to merge 16 commits into
feat/general-device-monitorfrom
fix/incorrect-archives

Conversation

@kozlov721
Copy link
Copy Markdown
Collaborator

@kozlov721 kozlov721 commented May 15, 2026

Purpose

Improved ability to guess the correct input types in case the information contained in the NN Archive is incorrect.

Specification

  • Reverted some changes made in Support multi-input model benchmarking #222
    • The precision field from the HubAI GET /modelInstance response is usually the most trustworthy
    • If the dtype is too ambiguous, the dtypes are read from the DLC itself

Dependencies & Potential Impact

None / not applicable

Deployment Plan

None / not applicable

Testing & Validation

None / not applicable

AI Usage

Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]

Submitted code was reviewed by a human: YES/NO

The author is taking the responsibility for the contribution: YES/NO

@kozlov721 kozlov721 requested a review from a team as a code owner May 15, 2026 14:22
@kozlov721 kozlov721 requested review from conorsim, klemen1999 and tersekmatija and removed request for a team May 15, 2026 14:22
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: f8c91c9320

ℹ️ 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 modelconverter/packages/rvc4/benchmark.py
Comment thread modelconverter/packages/rvc4/benchmark.py Outdated
@kozlov721 kozlov721 force-pushed the fix/incorrect-archives branch from afcd8be to c9b9961 Compare May 15, 2026 14:46
if model_precision_type == "FP32":
return DataType.FLOAT32

return DataType.INT8
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's explicitly check for INT8 and if it doesn't match any of the cases explicitly error out. This is because shortly Hub will add mixed precision types and our backend will assume INT8 always with this code

archive_precision: DataType | None,
hubai_precision: DataType | None = None,
) -> DataType:
if dtype is DataType.INT32:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where would this case apply?

) -> DataType:
if dtype is DataType.INT32:
return DataType.INT32
if hubai_precision is not None:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have some log when this happens so it is clearn from the CLI that precision was taken from HubAI "metadata". And similarly, let's log if precision was taken from the NNArchive metadata

if shutil.which("snpe-dlc-info") is not None:
input_specs = self._get_dlc_input_specs(modelPath)
else:
model_archive = dai.NNArchive(modelPath)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still have this switched around so that we first try to read from DLC directly using SNPE tools and if that fails have the archive spec as a backup. Reason being that reading from DLC directly is 100% guranteed, other paths are not

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