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

Enable running FLAML using the -O flag for the python interpreter #1169

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bbudescu
Copy link

@bbudescu bbudescu commented Aug 3, 2023

by implementing regular control flow without relying on exception semantics

Why are these changes needed?

The code of the user defined function the parameters of which FLAML is being used to optimize might make some expensive assertions which were designed to be turned off during the optimization process by passing the -O option as an interpreter flag.

Related issue number

Closes #981

Checks

  • Checked whether Ray's execution runtime passes the compiler options to worker threads/processes. It appears to do so when running locally, on a single machine.

- should enable using the -O flag for the python interpreter
@bbudescu
Copy link
Author

bbudescu commented Aug 3, 2023

Still need to check whether ray passes interpreter flags to workers in a remote setting, e.g., on an aws cluster.

@bbudescu
Copy link
Author

bbudescu commented Aug 4, 2023

Still need to check whether ray passes interpreter flags to workers in a remote setting, e.g., on an aws cluster.

Did it and it works by means of setting the PYTHONOPTIMIZE environment variable.

Copy link
Contributor

@sonichi sonichi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. To merge this PR Contributor License Agreement needs to be accepted.

@bbudescu
Copy link
Author

bbudescu commented Aug 4, 2023

Looks good. To merge this PR Contributor License Agreement needs to be accepted.

How do I do this? There used to be a message from a bot in this thread about it, but I can't see it any more.

@sonichi
Copy link
Contributor

sonichi commented Aug 4, 2023

Looks good. To merge this PR Contributor License Agreement needs to be accepted.

How do I do this? There used to be a message from a bot in this thread about it, but I can't see it any more.

Could you create another PR or draft? The bot should appear again there. And you only need to accept it once.

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.

Running flaml[tune] using "-O" flag for python interpreter (optimization - disables assertions) crashes
2 participants