Skip to content

Remove dead reference to inference.onnx_config.* subpackage in HTP config generator #859

@xieofxie

Description

@xieofxie

Context

`src/winml/modelkit/export/htp/config_generator.py` references a `winml.modelkit.inference.onnx_config` subpackage that does not exist in the repo:

  • `config_generator.py:206` — `from ...inference.onnx_config.input_generator import InputSpecGenerator`
  • `config_generator.py:268` — `from ...inference.onnx_config.patterns import TASK_TO_OUTPUTS`

Both imports are inside `try/except Exception` blocks that fall through to empty specs / generic defaults, so the missing modules are masked at runtime — the broken branches are silently skipped.

Tracked from PR review (typecheck cleanup PR) — silenced for the type-check pass with `# type: ignore[import-not-found]` while we decide whether to:

  1. Reintroduce `inference.onnx_config.{input_generator,patterns}` (if the integration was meant to land in a follow-up that never did), or
  2. Delete the dead try-blocks and let the function unconditionally return its fallback (`{}` for input specs, generic outputs).

Suggested action

Option 2 is the pragmatic cleanup unless there's a known plan to ship the `inference.onnx_config` subpackage. Option 1 needs design context this review doesn't have.

Reference

  • Skill: `modelkit-typechecking` — Pattern "Surface every `# type: ignore[import-not-found]`"
  • Related: bug: non exist code are imported #824 (similar dead-module pattern in `core/unified_optimizer.py` and `core/universal_hierarchy_exporter.py`)

Metadata

Metadata

Labels

P2Medium — minor bug or non-critical improvementrefactorCode refactoringtriagedIssue has been triaged

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions