Skip to content

Preserve timm architecture names in model identity - #86

Merged
piotrekno1 merged 1 commit into
develfrom
fix/timm-model-identity
Oct 20, 2026
Merged

piotrekno1 merged 1 commit into
develfrom
fix/timm-model-identity

Conversation

@piotrekno1

Copy link
Copy Markdown
Collaborator

timm models currently register under their Python class name, so different architectures such as resnet18 and resnet50 both become ResNet. Their telemetry is merged under one handle and retains the first model's metadata.

Preserve the full name passed to timm.create_model() on the returned model before automatic registration. Use it for both model ID and display name, including variant tags and hub-qualified names. For manually registered models, fall back to the architecture in timm's pretrained/default config. Explicit model IDs still take priority; ordinary PyTorch models keep the class-name fallback.

Promotes the existing architecture-collision regression from expected failure to a passing compatibility test. Tests also verify inference attribution, repeated-architecture identity, positional/keyword names, variant/hub names and explicit overrides.

Fixes #73.

Validation

  • Full SDK suite: 784 passed, 28 skipped.
  • Real timm 1.0.30 models: all 3 compatibility tests passed, including forwards on separate resnet34/resnet50 models and repeated resnet18 instances.
  • Minimum supported timm 1.0.11: all 39 targeted PyTorch, patching and compatibility tests passed.
  • Real-model checks use randomly initialized models with pretrained=False, without downloading weights. Tested with Python 3.12, PyTorch 2.14.1 and NumPy 1.26.4 on macOS.
  • Ruff lint, formatting and whitespace checks pass.

Existing stored records under class-based IDs are not migrated; new registrations use the corrected identity.

@github-actions

Copy link
Copy Markdown

Coverage report

  • Total: 88% (10793/12228 lines)

Top uncovered files

  • wildedge/integrations/mlx.py: 28.7% (122 lines missed)
  • wildedge/integrations/transformers.py: 62.9% (112 lines missed)
  • wildedge/integrations/ultralytics.py: 67.7% (86 lines missed)
  • wildedge/integrations/pytorch.py: 66.0% (69 lines missed)
  • wildedge/platforms/macos.py: 56.8% (67 lines missed)

@piotrekno1
piotrekno1 merged commit dfb7b13 into devel Oct 20, 2026
14 checks passed
@piotrekno1
piotrekno1 deleted the fix/timm-model-identity branch October 20, 2026 17:04
@github-actions github-actions Bot mentioned this pull request Oct 21, 2026
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.

timm models are registered by class name, so resnet18 and resnet50 share one id

1 participant