FLAML icon indicating copy to clipboard operation
FLAML copied to clipboard

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

Open bbudescu opened this issue 11 months ago • 4 comments

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

  • [x] 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.
  • [ ] I've included any doc changes needed for https://microsoft.github.io/FLAML/. See https://microsoft.github.io/FLAML/docs/Contribute#documentation to build and test documentation locally.
  • [ ] I've added tests (if relevant) corresponding to the changes introduced in this PR.
  • [ ] I've made sure all auto checks have passed.

bbudescu avatar Aug 03 '23 12:08 bbudescu

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

bbudescu avatar Aug 03 '23 12:08 bbudescu

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.

bbudescu avatar Aug 04 '23 09:08 bbudescu

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.

bbudescu avatar Aug 04 '23 14:08 bbudescu

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.

sonichi avatar Aug 04 '23 16:08 sonichi