Skip to content

Enable unity(Jumbo) builds #5768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 4, 2024
Merged

Conversation

jslap-ubi
Copy link
Contributor

Description

Added a cmake option to enable Unity builds.
Added missing include guards
Fixed some missing/extra #undef that cause Unity builds to fail.
Fixed some duplicated symbol names that made Unity builds to fail

Motivation and Context

For large code base, especially in the game dev industry, Unity builds (https://en.wikipedia.org/wiki/Unity_build) are used to speed up the compilations.
Special care must be taken to enable Unity builds for a project, since many translation units will be merged togheter.

Signed-off-by: Jean-Simon Lapointe <jean-simon.lapointe@ubisoft.com>
@jslap-ubi jslap-ubi requested review from a team as code owners November 23, 2023 15:23
Copy link

codecov bot commented Nov 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (75671b3) 56.39% compared to head (c54f7eb) 56.39%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5768   +/-   ##
=======================================
  Coverage   56.39%   56.39%           
=======================================
  Files         503      503           
  Lines       29620    29620           
  Branches     4426     4426           
=======================================
  Hits        16704    16704           
  Misses      12109    12109           
  Partials      807      807           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Jean-Simon Lapointe <jean-simon.lapointe@ubisoft.com>
@jslap-ubi
Copy link
Contributor Author

Also, I think it would be best to have at least one unity build part of the CI process, to make sure it does not get broken. Do you think it is something we could do? If so, how?

Copy link
Member

@justinchuby justinchuby left a comment

Choose a reason for hiding this comment

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

Could you fix the linting errors? Thanks!

@justinchuby justinchuby changed the title Enable untity(Jumbo) builds. Enable unity(Jumbo) builds. Dec 21, 2023
@justinchuby justinchuby changed the title Enable unity(Jumbo) builds. Enable unity(Jumbo) builds Dec 21, 2023
Signed-off-by: Jean-Simon Lapointe <jean-simon.lapointe@ubisoft.com>
@justinchuby justinchuby requested a review from xadupre December 22, 2023 05:59
@justinchuby justinchuby added topic: build Issues related to ONNX builds and packages review needed: operators approvers Require reviews from members of operators-approvers labels Dec 22, 2023
@justinchuby justinchuby removed the review needed: operators approvers Require reviews from members of operators-approvers label Jan 4, 2024
@justinchuby justinchuby added this pull request to the merge queue Jan 4, 2024
Merged via the queue into onnx:main with commit eb6241f Jan 4, 2024
linshokaku pushed a commit to linshokaku/onnx that referenced this pull request Oct 2, 2024
Added a cmake option to enable Unity builds.
Added missing include guards
Fixed some missing/extra #undef that cause Unity builds to fail.
Fixed some duplicated symbol names that made Unity builds to fail

For large code base, especially in the game dev industry, Unity builds
(https://en.wikipedia.org/wiki/Unity_build) are used to speed up the
compilations.
Special care must be taken to enable Unity builds for a project, since
many translation units will be merged togheter.

---------

Signed-off-by: Jean-Simon Lapointe <jean-simon.lapointe@ubisoft.com>
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com>
Co-authored-by: G. Ramalingam <grama@microsoft.com>
Signed-off-by: Linsho Kaku <linsho@preferred.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: build Issues related to ONNX builds and packages
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants