Skip to content
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

Skip geometry validation in simulation subsection and mode solver reduction #2022

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

weiliangjin2021
Copy link
Collaborator

@weiliangjin2021 weiliangjin2021 commented Oct 17, 2024

This is part of efforts in speeding up mode solver when a geometry group contains large number of geometries. (Last piece in resolving https://github.com/flexcompute/tidy3d-core/issues/692)

  • Add options in updated_copy to skip valiation.
  • The geometry is validated when the simulation object is initialized, and they are not modified in subsection. Thus we can skip validators that are directly associated with geometry.
  • For validators of other simulation fields associated with geometry, only the bounding box of the geometry matters. So to validate other simulation fields, we use an auxiliary simulation object whose geometry is replaced by its bounding box.

@weiliangjin2021
Copy link
Collaborator Author

Total mode computation time in a test:

  • develop branch: 1000s
  • pre/2.8 with recent parallel computing changes: 600s
  • pre/2.8 + this PR: 200s

Copy link
Collaborator

@tylerflex tylerflex left a comment

Choose a reason for hiding this comment

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

HI Weiliang, a few higher level comments about the subsection options.

The new validate option looks good to me!

# validate mode solver here where geometry is replaced by its bounding box
new_mode = self.updated_copy(simulation=aux_new_sim, deep=False)
# return full mode solver and skip validation
return new_mode.updated_copy(simulation=new_sim, deep=False, validate=False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm pretty happy with this, I mean it definitely feels somewhat hacky but also it achieves the performance boost we want while still doing just about as little of validation skipping as possible.

Agree with @tylerflex 's comments otherwise.

@tylerflex tylerflex self-requested a review October 18, 2024 18:23
@weiliangjin2021 weiliangjin2021 merged commit b5aeef1 into pre/2.8 Oct 19, 2024
15 checks passed
@weiliangjin2021 weiliangjin2021 deleted the weiliang/subsection branch October 19, 2024 16:55
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.

4 participants