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

feature[design]: allow design plugin to interface with pytorch via Result #2189

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

groberts-flex
Copy link
Contributor

This PR fixes a small bug in the design plugin wherein the optimization method returns the dimensions in a different order and so labeling with the self.dims parameter can end up being incorrect.

It also implements accessor and length functions for the Result class so that it can be used directly as a Dataset in PyTorch. This also may be useful generally.

Marking this as a draft for now to discuss if we want to make these changes to the plugin. The changes are currently needed for the surrogate notebooks draft PR. (flexcompute/tidy3d-notebooks#228)

@groberts-flex
Copy link
Contributor Author

converting now to a PR since the notebook PR is out

@groberts-flex groberts-flex marked this pull request as ready for review January 22, 2025 19:28
Copy link

Copy link
Collaborator

@yaugenst-flex yaugenst-flex left a comment

Choose a reason for hiding this comment

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

Thanks @groberts-flex the accessors definitely are a great addition!

@groberts-flex groberts-flex force-pushed the groberts-flex/design_plugin_fixes branch from ce8bc51 to 9a166b0 Compare January 24, 2025 20:12
@yaugenst-flex
Copy link
Collaborator

Thanks @groberts-flex I think this is good to go implementation-wise, but still needs tests and a changelog entry. For the tests, I think the accessor methods can be tested easily (check len, indexing, list/tuple conversion). For the dimension ordering, maybe identify one (or ideally more than one distinct) cases where this broke previously?

@groberts-flex groberts-flex force-pushed the groberts-flex/design_plugin_fixes branch 3 times, most recently from 86a8d2b to eaa243f Compare January 27, 2025 17:04
@groberts-flex
Copy link
Contributor Author

tests and changelog entry are in, how does this look for merging @yaugenst-flex?

Copy link
Collaborator

@yaugenst-flex yaugenst-flex left a comment

Choose a reason for hiding this comment

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

Thanks @groberts-flex I think this looks good, only a minor comment.

@groberts-flex groberts-flex force-pushed the groberts-flex/design_plugin_fixes branch 2 times, most recently from 0fb2b3f to f0af5b7 Compare January 28, 2025 14:41
@groberts-flex groberts-flex force-pushed the groberts-flex/design_plugin_fixes branch from f0af5b7 to 06c33fc Compare January 28, 2025 14:42
@yaugenst-flex yaugenst-flex merged commit f15a2ed into pre/2.8 Jan 28, 2025
15 checks passed
@yaugenst-flex yaugenst-flex deleted the groberts-flex/design_plugin_fixes branch January 28, 2025 15:17
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.

2 participants