Skip to content

Delete the ModelMetadata half field that only mirrored quantize - #471

Merged
onuralpszr merged 1 commit into
mainfrom
cleanup/drop-metadata-half
Sep 1, 2026
Merged

Delete the ModelMetadata half field that only mirrored quantize#471
onuralpszr merged 1 commit into
mainfrom
cleanup/drop-metadata-half

Conversation

@onuralpszr

@onuralpszr onuralpszr commented Sep 1, 2026

Copy link
Copy Markdown
Member

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Removed the redundant ModelMetadata::half field and its synchronization logic, keeping quantize as the sole precision metadata representation.

📊 Key Changes

  • Deleted the hidden half: bool field from ModelMetadata.
  • Removed initialization of half in Default and assignment during YAML metadata parsing.
  • Updated precision compatibility tests to validate only quantize.
  • Preserved parsing behavior for legacy half metadata by mapping it to Quantization::Fp16 when applicable.

🎯 Purpose & Impact

  • Simplifies ModelMetadata by eliminating a field that duplicated quantize.
  • Existing metadata parsing continues to determine precision through quantize; consumers can no longer access the removed half field.

Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
@UltralyticsAssistant UltralyticsAssistant added the enhancement New feature or request label Sep 1, 2026
@UltralyticsAssistant

Copy link
Copy Markdown
Member

👋 Hello @onuralpszr, thank you for submitting a ultralytics/inference 🚀 PR! This automated message confirms your contribution was received, and an Ultralytics engineer will assist with the review. To ensure a seamless integration of your work, please review the following checklist:

  • Define a Purpose: Clearly explain the purpose of your fix or feature in your PR description, and link to any relevant issues. Ensure your commit messages are clear, concise, and adhere to the project's conventions.
  • Synchronize with Source: Confirm your PR is synchronized with the ultralytics/inference main branch. If it's behind, update it by clicking the 'Update branch' button or by running git pull and git merge main locally.
  • Ensure CI Checks Pass: Verify all Ultralytics Continuous Integration (CI) checks are passing. If any checks fail, please address the issues.
  • Update Documentation: Update the relevant documentation for any new or modified features.
  • Add Tests: If applicable, include or update tests to cover your changes, and confirm that all tests are passing.
  • Sign the CLA: Please ensure you have signed our Contributor License Agreement if this is your first Ultralytics PR by writing "I have read the CLA Document and I sign the CLA" in a new message.
  • Minimize Changes: Limit your changes to the minimum necessary for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀

@UltralyticsAssistant UltralyticsAssistant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔍 PR Review

Made with ❤️ by Ultralytics Actions

LGTM. The diff cleanly removes the redundant public ModelMetadata::half field, preserves legacy YAML half parsing through quantize, updates the default initializer, and adjusts the precision compatibility tests. No remaining repository references to ModelMetadata::half were found.

@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@onuralpszr
onuralpszr merged commit ee58e0c into main Sep 1, 2026
16 checks passed
@onuralpszr
onuralpszr deleted the cleanup/drop-metadata-half branch September 1, 2026 12:27
@UltralyticsAssistant

Copy link
Copy Markdown
Member

🎉 PR #471 has been merged—thank you, @onuralpszr!

“Simple can be harder than complex.” — Steve Jobs

This change simplifies ModelMetadata by removing the redundant half field and keeping quantize as the sole precision representation, while preserving legacy half metadata parsing through Quantization::Fp16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants