Skip to content

A handful of efficiency optimizations - #19

Merged
psheehan merged 8 commits into
mainfrom
efficiency_optimizations
Jun 21, 2026
Merged

A handful of efficiency optimizations#19
psheehan merged 8 commits into
mainfrom
efficiency_optimizations

Conversation

@psheehan

Copy link
Copy Markdown
Owner

Including:

  • Use torch.no_grad for evaluating ML models
  • Emit photons using torch tensors on the appropriate device to speed up calculations and reduce overheads
  • Don't double calculate photon opacities on interaction in thermal simulation (though this doesn't end up being as big of an improvement as it sounds because one is only for the absorbed photons, which is a smaller number of them).

psheehan added 8 commits June 18, 2026 21:05
…device so they get an appropriate speedup on execution.
…he proper dtype to prevent downstream failures.
…brought back to the CPU for calculating the intensity.
…perties change; also don't update opacities after frequency change AND after cell properties change - only do once.
…hat they are coming from torch. Also remove spurious exp that somehow ended up in the direction.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 97.82609% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.83%. Comparing base (3118a92) to head (13024c9).

Files with missing lines Patch % Lines
pinballrt/dust.py 85.71% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
- Coverage   90.20%   89.83%   -0.37%     
==========================================
  Files          11       11              
  Lines        2440     2460      +20     
==========================================
+ Hits         2201     2210       +9     
- Misses        239      250      +11     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@psheehan

Copy link
Copy Markdown
Owner Author

Added two additional optimizations:

All tests are passing, including the offline GPU ones.

@psheehan
psheehan merged commit 84d20d3 into main Jun 21, 2026
4 checks passed
@psheehan
psheehan deleted the efficiency_optimizations branch June 21, 2026 01:37
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