Skip to content

Add Hiera to NormalizedConfigManager - #2507

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

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

Conversation

@kratos0718

Copy link
Copy Markdown

Summary

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

  • Added "hiera": NormalizedVisionConfig to _conf (alphabetically, between gptj and imagegpt)
  • Removed hiera from the TODO: missing normalized configs comment above it
  • HieraConfig exposes image_size and num_channels directly, which is exactly what NormalizedVisionConfig expects, so no custom subclass was needed. Note image_size resolves to a list ([224, 224]) rather than a scalar for this model — verified the mapping still round-trips correctly.

Test plan

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

Hiera 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