Wait for compilation to complete in PyClient::CompileIfrtProgram
Wait for compilation to complete in PyClient::CompileIfrtProgram

Users expect jax compile() API to raise an exception when compilation fails.
Some backends return a future of an executable rather than the compilation result.
This does not raise exceptions in case of failures.

jax.stages.Compiled object in python is not a Future. To get an exception, users must wait on the compilation to complete. Only way to wait for the compilation to complete is to wait for compilation using APIs like get_compiled_memory_stats on the executable that internally materialize the executable.

Users already can run compilation asynchonously in a threadpool to have it generally be non-blocking across backends.

To simplify semantics, this CL makes JAX compilation always blocking regardless of whether IFRT implementations support async compilation so that it raises an exception in case of a failure to compile.
