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

New Feature: GPU Mode Solving #19

Open
hammy4815 opened this issue Jun 20, 2022 · 7 comments
Open

New Feature: GPU Mode Solving #19

hammy4815 opened this issue Jun 20, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@hammy4815
Copy link
Collaborator

There was an effort to vectorize electromagnetic python (EMpy) mode solving on a gpu (hence the name EMpy_gpu) for my cloned dependency of EMEPy. I didn't get it to work at the time and gave up early but it should be able to be done. We may want to use a modified version of EMpy again but different.

@hammy4815 hammy4815 added the enhancement New feature or request label Jun 20, 2022
@hammy4815
Copy link
Collaborator Author

Note: we are keeping the empy mode solver only because it supports a full permittivity tensor. Otherwise, we are migrating towards tidy3d. I recommend trying to gpu-ize tidy3d instead since it is easier to use, has PML, has bends, and is faster

@smartalecH
Copy link
Collaborator

smartalecH commented Oct 2, 2022

The hardest thing about throwing a mode solver on the gpu right now is finding a suitable targeted eigensolver compatible with complex, sparse matrices. Unfortunately, none of the "popular" wrapper packages (torch, jax, pycuda, etc) seem to support this.

Furthermore, we probably want to offload the entire kernel to the gpu, not just the mode solving section.

@hammy4815
Copy link
Collaborator Author

@smartalecH ,

Do you mean the entire EME process onto the gpu?

@smartalecH
Copy link
Collaborator

Yes. Mode calculation + mode overlap + Redheffer Star product.

@hammy4815
Copy link
Collaborator Author

@smartalecH ,

Mode calculation + mode overlap - easy. We can reformulate the Mode object in a simple way on the gpu

Redheffer star product, not possible with Simphony (without forking and reformulating it). We could use sax however if we wanted it there. Doing so would require modifying about half the code in the repo however

@smartalecH
Copy link
Collaborator

I would just write a quick function that does it. It's rather easy and has been done in dozens of packages already.

@hammy4815
Copy link
Collaborator Author

@smartalecH ,

It's easy for small-port systems. But when you have different numbers of ports on each side of an interface, with lots of modes, can't it get tricky?

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

No branches or pull requests

2 participants