Skip to content

chore: remove unused PYTHON_JULIACALL_OPTLEVEL setting - #1424

Open
MilesCranmerBot wants to merge 2 commits into
astroautomata:masterfrom
MilesCranmerBot:fix/juliacall-optimize
Open

MilesCranmerBot wants to merge 2 commits into
astroautomata:masterfrom
MilesCranmerBot:fix/juliacall-optimize

Conversation

@MilesCranmerBot

@MilesCranmerBot MilesCranmerBot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

PySR sets PYTHON_JULIACALL_OPTLEVEL=3 on import, meaning to run Julia at -O3. juliacall has no optlevel option (it has optimize and min_optlevel, in every release since at least 0.9.10), so the setting never took effect and Julia has always run at the default -O2.

Setting PYTHON_JULIACALL_OPTIMIZE=3 would enable -O3, but it does not help. On one 128-core Rusty node with PySR 2.7.0 (K=300, 3 interleaved repetitions), search speed was:

Cell -O2 -O3 -O3 / -O2
threads, 128 625.5 pops/s 613.9 pops/s 0.98
local processes, 128 666.3 pops/s 673.4 pops/s 1.01

Both differences are within run-to-run spread. Switching would also force every user through a one-time recompile of about 3 minutes, since Julia caches compiled packages per optimization level.

This removes the dead line and its mention in the warning shown when juliacall was imported before PySR. Behavior is unchanged.

PySR set PYTHON_JULIACALL_OPTLEVEL=3, but juliacall reads the optimization level from PYTHON_JULIACALL_OPTIMIZE, so Julia ran at the default -O2. Set PYTHON_JULIACALL_OPTIMIZE instead.

Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T19:29:15.216872Z c06d6a4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

juliacall has no optlevel option, so this setting never took effect and Julia has always run at -O2. Enabling -O3 through PYTHON_JULIACALL_OPTIMIZE gave no speedup on a 128-core node and forced a one-time recompile of about 3 minutes, so keep -O2 and drop the dead line.

Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
@MilesCranmerBot MilesCranmerBot changed the title perf: run Julia at -O3 as intended chore: remove unused PYTHON_JULIACALL_OPTLEVEL setting Oct 9, 2026

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