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

Compute fields at multiple frequencies in parallel in one ray tracing #538

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Anplus
Copy link

@Anplus Anplus commented Aug 8, 2024

Description

I have revised the frequency check in scene.py and the frequency update for all ITU materials‘ properties in itu_material.py using TensorFlow. The old code was implemented in raw Python and NumPy, which could not be used to construct the computation graph needed for parallel computation. This enhancement enables the computation of fields at multiple frequencies in parallel within a single ray tracing process. Specifically, we can first trace all paths, and then use tf.map_fn(process_freq, freq, dtype=tf.complex64) to construct a parallel computation for field computation at multiple frequencies, where the process_freq function updates the frequency and recomputes the field with the given traced paths.

Additionally, I have added a Jupyter notebook as an example to illustrate this feature.

  • Fixes a bug?

NA.

  • Adds a new feature?

This feature allows for parallel computation of fields at multiple frequencies during ray tracing, enhancing computation efficiency. I think this is a good update for the discussion: #527

  • Introduces API changes?

No API changes.

  • Other contributions

Checklist

  • Detailed description
  • Added references to issues and discussions
  • Added / modified documentation as needed
  • Added / modified unit tests as needed
  • Passes all tests
  • Lint the code
  • Performed a self review
  • Ensure you Signed-off the commits. Required to accept contributions!
  • Co-authored with someone? Add Co-authored-by: user@domain and ensure they signed off their commits too.

@jhoydis
Copy link
Collaborator

jhoydis commented Aug 8, 2024

Hi @Anplus,

Thank you for this PR which seems like a useful feature. We'll review it and come back to you. This might take a bit of time though.

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.

3 participants