Skip to content

Commit 89833fe

Browse files
committed
Make debug logs simpler and fix unbbound variable error
1 parent daf31aa commit 89833fe

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

build/build.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ async def main():
341341

342342
if args.verbose:
343343
logging.getLogger().setLevel(logging.DEBUG)
344-
logger.info("Verbose logging enabled.")
344+
logger.info("Verbose logging enabled")
345345

346346
logger.info(
347347
"Building %s for %s %s...",
@@ -352,21 +352,22 @@ async def main():
352352

353353
bazel_path, bazel_version = utils.get_bazel_path(args.bazel_path)
354354

355-
logging.debug("Running with Bazel version: %s", bazel_version)
355+
logging.debug("Bazel path: %s", bazel_path)
356+
logging.debug("Bazel version: %s", bazel_version)
356357

357358
executor = command.SubprocessExecutor()
358359

359360
# Start constructing the Bazel command
360361
bazel_command = command.CommandBuilder(bazel_path)
361362

362363
if args.bazel_startup_options:
363-
logging.debug("Using additional Bazel startup options: %s", args.bazel_startup_options)
364+
logging.debug("Additional Bazel startup options: %s", args.bazel_startup_options)
364365
parse_and_append_bazel_options(bazel_command, args.bazel_startup_options)
365366

366367
bazel_command.append("run")
367368

368369
if hasattr(args, "python_version"):
369-
logging.debug("Setting Hermetic Python version to %s", args.python_version)
370+
logging.debug("Hermetic Python version: %s", args.python_version)
370371
bazel_command.append(f"--repo_env=HERMETIC_PYTHON_VERSION={args.python_version}")
371372

372373
if args.command == "requirements_update":
@@ -399,26 +400,26 @@ async def main():
399400
bazel_command.append(f"--config={bazelrc_config}")
400401
else:
401402
clang_path = args.clang_path or utils.get_clang_path_or_exit()
402-
logging.debug("Setting the default compiler to be Clang, clang path: %s", clang_path)
403+
logging.debug("Using Clang as the compiler, clang path: %s", clang_path)
403404
bazel_command.append(f"--action_env CLANG_COMPILER_PATH={clang_path}")
404405
bazel_command.append(f"--repo_env CC={clang_path}")
405406
bazel_command.append(f"--repo_env BAZEL_COMPILER={clang_path}")
406407
bazel_command.append(f"--config=clang")
407408

408409
if args.target_cpu:
409-
logging.debug("Setting target CPU to %s", args.target_cpu)
410+
logging.debug("Target CPU: %s", args.target_cpu)
410411
bazel_command.append(f"--cpu={args.target_cpu}")
411412

412413
if args.enable_mkl_dnn:
413-
logging.debug("Enabling MKL DNN.")
414+
logging.debug("Enabling MKL DNN")
414415
bazel_command.append("--config=mkl_open_source_only")
415416

416417
if hasattr(args, "disable_nccl") and args.disable_nccl:
417-
logging.debug("Disabling NCCL.")
418+
logging.debug("Disabling NCCL")
418419
bazel_command.append("--config=nonccl")
419420

420421
if args.target_cpu_features == "release":
421-
logging.debug("Using release cpu features: --config=avx_windows on Windows and --config=avx_posix otherwise")
422+
logging.debug("Using release cpu features: --config=avx_%s", "windows" if utils.is_windows() else "posix")
422423
if arch == "x86_64":
423424
bazel_command.append("--config=avx_windows" if utils.is_windows() else "--config=avx_posix")
424425
elif args.target_cpu_features == "native":
@@ -428,7 +429,7 @@ async def main():
428429
logging.debug("Using native cpu features: --config=native_arch_posix")
429430
bazel_command.append("--config=native_arch_posix")
430431
else:
431-
logging.debug("Using default cpu features.")
432+
logging.debug("Using default cpu features")
432433

433434
if "cuda" in args.command:
434435
bazel_command.append("--config=cuda")
@@ -442,32 +443,32 @@ async def main():
442443
bazel_command.append("--config=build_cuda_with_nvcc")
443444

444445
if args.cuda_version:
445-
logging.debug("Setting Hermetic CUDA version to %s", args.cuda_version)
446+
logging.debug("Hermetic CUDA version: %s", args.cuda_version)
446447
bazel_command.append(f"--repo_env=HERMETIC_CUDA_VERSION={args.cuda_version}")
447448
if args.cudnn_version:
448-
logging.debug("Setting Hermetic cuDNN version to %s", args.cudnn_version)
449+
logging.debug("Hermetic cuDNN version: %s", args.cudnn_version)
449450
bazel_command.append(f"--repo_env=HERMETIC_CUDNN_VERSION={args.cudnn_version}")
450451
if args.cuda_compute_capabilities:
451-
logging.debug("Setting CUDA compute capabilities to %s", args.cuda_compute_capabilities)
452+
logging.debug("Hermetic CUDA compute capabilities: %s", args.cuda_compute_capabilities)
452453
bazel_command.append(f"--repo_env HERMETIC_CUDA_COMPUTE_CAPABILITIES={args.cuda_compute_capabilities}")
453454

454455
if "rocm" in args.command:
455456
bazel_command.append("--config=rocm")
456457
bazel_command.append("--action_env=CLANG_COMPILER_PATH={clang_path}")
457458

458459
if args.rocm_path:
459-
logging.debug("Setting ROCm path to %s", args.rocm_path)
460+
logging.debug("ROCm tookit path: %s", args.rocm_path)
460461
bazel_command.append(f"--action_env ROCM_PATH='{args.rocm_path}'")
461462
if args.rocm_amdgpu_targets:
462-
logging.debug("Setting ROCm AMD GPU targets to %s", args.rocm_amdgpu_targets)
463+
logging.debug("ROCm AMD GPU targets: %s", args.rocm_amdgpu_targets)
463464
bazel_command.append(f"--action_env TF_ROCM_AMDGPU_TARGETS={args.rocm_amdgpu_targets}")
464465

465466
if args.local_xla_path:
466-
logging.debug("Setting local XLA path to %s", args.local_xla_path)
467+
logging.debug("Local XLA path: %s", args.local_xla_path)
467468
bazel_command.append(f"--override_repository=xla={args.local_xla_path}")
468469

469470
if args.bazel_build_options:
470-
logging.debug("Using additional Bazel build options: %s", args.bazel_build_options)
471+
logging.debug("Additional Bazel build options: %s", args.bazel_build_options)
471472
parse_and_append_bazel_options(bazel_command, args.bazel_build_options)
472473

473474
# Append the build target to the Bazel command.
@@ -482,12 +483,12 @@ async def main():
482483
if os_name == "windows":
483484
output_path, target_cpu = utils.adjust_paths_for_windows(output_path, target_cpu)
484485

485-
logger.debug("Storing artifacts in %s", output_path)
486+
logger.debug("Artifacts output directory: %s", output_path)
486487

487488
bazel_command.append("--")
488489

489490
if args.editable:
490-
logger.debug("Building an editable build.")
491+
logger.debug("Building an editable build")
491492
output_path = os.path.join(output_path, args.command)
492493
bazel_command.append("--editable")
493494

ci/envs/default.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export JAXCI_DOCKER_ARGS=""
6363
# scripts.
6464
# #############################################################################
6565
# Bazel test environment variables.
66-
export JAXCI_RUN_BAZEL_TEST_CPU=0
66+
export JAXCI_RUN_BAZEL_TEST_CPU_RBE=0
6767
export JAXCI_RUN_BAZEL_TEST_GPU_RBE=0
6868
export JAXCI_RUN_BAZEL_TEST_GPU_NON_RBE=0
6969

0 commit comments

Comments
 (0)