Add Optional Fast Build Configuration (#8925)

* Fast builds by default

* Update doc/source/development.rst

Co-authored-by: Simon Mo <xmo@berkeley.edu>

Co-authored-by: Mehrdad <noreply@github.com>
Co-authored-by: Simon Mo <xmo@berkeley.edu>
This commit is contained in:
mehrdadn
2020-06-18 14:12:12 -07:00
committed by GitHub
parent 110f88ff61
commit 92f67cd2ae
5 changed files with 68 additions and 1 deletions
+17
View File
@@ -1,12 +1,15 @@
"""This is the script for `ray microbenchmark`."""
import asyncio
import logging
import os
import time
import numpy as np
import multiprocessing
import ray
logger = logging.getLogger(__name__)
# Only run tests matching this filter pattern.
filter_pattern = os.environ.get("TESTS_TO_RUN", "")
@@ -89,7 +92,21 @@ def timeit(name, fn, multiplier=1):
round(np.std(stats), 2))
def check_optimized_build():
if not ray._raylet.OPTIMIZED:
msg = ("WARNING: Unoptimized build! "
"To benchmark an optimized build, try:\n"
"\tbazel build -c opt //:ray_pkg\n"
"You can also make this permanent by adding\n"
"\tbuild --compilation_mode=opt\n"
"to your user-wide ~/.bazelrc file. "
"(Do not add this to the project-level .bazelrc file.)")
logger.warning(msg)
def main():
check_optimized_build()
print("Tip: set TESTS_TO_RUN='pattern' to run a subset of benchmarks")
ray.init()