Skip to content

Add MobileViT to NormalizedConfigManager - #2506

Open
kratos0718 wants to merge 1 commit into
huggingface:mainfrom
kratos0718:add-mobilevit-normalized-config
Open

kratos0718 wants to merge 1 commit into
huggingface:mainfrom
kratos0718:add-mobilevit-normalized-config

Conversation

@kratos0718

Copy link
Copy Markdown

Summary

Part of #351. MobileViT already has an ONNX export config but was missing from NormalizedConfigManager, so ORTOptimizer can't run on it yet.

  • Added "mobilevit": NormalizedVisionConfig to _conf (alphabetically, between mixtral and modernbert)
  • Removed mobilevit from the TODO: missing normalized configs comment above it
  • MobileViTConfig exposes image_size and num_channels directly, which is exactly what NormalizedVisionConfig expects, so no custom subclass was needed

Test plan

  • Added two tests to tests/utils/test_normalized_config.py: one confirming mobilevit resolves to NormalizedVisionConfig, and one instantiating a real MobileViTConfig() and asserting the normalized image_size/num_channels match the underlying config
  • Ran both locally against the actual transformers.MobileViTConfig (not mocked) — both pass

MobileViT has an ONNX export config but was missing from NormalizedConfigManager.
Its config exposes image_size and num_channels directly, matching
NormalizedVisionConfig, so no custom subclass is needed.
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