Skip to content

fix(geo): honor explicit JAX platform settings in geo.jit - #690

Open
jungdaesuh wants to merge 1 commit into
hiddenSymmetries:masterfrom
jungdaesuh:fix/geo-jit-platform
Open

jungdaesuh wants to merge 1 commit into
hiddenSymmetries:masterfrom
jungdaesuh:fix/geo-jit-platform

Conversation

@jungdaesuh

@jungdaesuh jungdaesuh commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary
Importing simsopt.geo.jit unconditionally called jax.config.update("jax_platform_name", "cpu"), overriding explicit GPU or device choices configured via jax_platforms, jax_platform_name, or jax_default_device (by environment variable, jax.config.update, or jax.default_device). It now applies that CPU default only when none of those settings is already configured, preserving existing defaults for unconfigured callers.

  • I used AI to generate this PR.
  • I have read every diffed line of code that I am submitting.

@jungdaesuh
jungdaesuh force-pushed the fix/geo-jit-platform branch from 77c4a15 to 8637dcd Compare December 2, 2026 22:00
Only set jax_platform_name to 'cpu' on import when none of jax_platforms, jax_platform_name, or jax_default_device is already configured, so callers selecting a GPU or device before importing simsopt.geo are not overridden.
@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.94%. Comparing base (62fb5f2) to head (7b8a78e).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #690   +/-   ##
=======================================
  Coverage   90.94%   90.94%           
=======================================
  Files          86       86           
  Lines       18600    18601    +1     
=======================================
+ Hits        16915    16916    +1     
  Misses       1685     1685           
Flag Coverage Δ
unittests 90.94% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/simsopt/geo/jit.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jungdaesuh
jungdaesuh force-pushed the fix/geo-jit-platform branch from 8637dcd to 7b8a78e Compare December 3, 2026 01:25

This branch has not been deployed

No deployments
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.

1 participant