2222import os
2323import platform
2424import sys
25- import textwrap
2625
2726from tools import command , utils
2827
@@ -66,7 +65,7 @@ def add_python_version_argument(parser: argparse.ArgumentParser):
6665 type = str ,
6766 choices = ["3.10" , "3.11" , "3.12" , "3.13" ],
6867 default = f"{ sys .version_info .major } .{ sys .version_info .minor } " ,
69- help = "Python version to use" ,
68+ help = "Hermetic Python version to use" ,
7069 )
7170
7271
@@ -75,7 +74,7 @@ def add_cuda_version_argument(parser: argparse.ArgumentParser):
7574 "--cuda_version" ,
7675 type = str ,
7776 default = "12.3.2" ,
78- help = "CUDA version to use" ,
77+ help = "Hermetic CUDA version to use" ,
7978 )
8079
8180
@@ -84,15 +83,15 @@ def add_cudnn_version_argument(parser: argparse.ArgumentParser):
8483 "--cudnn_version" ,
8584 type = str ,
8685 default = "9.1.1" ,
87- help = "cuDNN version to use" ,
86+ help = "Hermetic cuDNN version to use" ,
8887 )
8988
9089
9190def add_disable_nccl_argument (parser : argparse .ArgumentParser ):
9291 parser .add_argument (
9392 "--disable_nccl" ,
9493 action = "store_true" ,
95- help = "Whether to disable NCCL for CUDA/ROCM builds. " ,
94+ help = "Should NCCL be disabled? " ,
9695 )
9796
9897
@@ -109,10 +108,10 @@ def add_build_cuda_with_clang_argument(parser: argparse.ArgumentParser):
109108 parser .add_argument (
110109 "--build_cuda_with_clang" ,
111110 action = "store_true" ,
112- help = (
113- " Should we build CUDA code using Clang? The default value "
114- "is to build CUDA with NVCC."
115- ) ,
111+ help = """
112+ Should CUDA code be compiled using Clang? The default behavior is to
113+ compile CUDA with NVCC.
114+ """ ,
116115 )
117116
118117
@@ -147,11 +146,11 @@ def add_requirements_nightly_update_argument(parser: argparse.ArgumentParser):
147146 parser .add_argument (
148147 "--nightly_update" ,
149148 action = "store_true" ,
150- help = (
151- " If true, updates requirements_lock.txt for a corresponding version"
152- " of Python and will consider dev, nightly and pre-release versions"
153- " of packages."
154- ) ,
149+ help = """
150+ If true, updates requirements_lock.txt for a corresponding version of
151+ Python and will consider dev, nightly and pre-release versions of
152+ packages.
153+ """ ,
155154 )
156155
157156
@@ -171,21 +170,20 @@ def add_global_arguments(parser: argparse.ArgumentParser):
171170 "--bazel_startup_options" ,
172171 type = str ,
173172 default = "" ,
174- help = (
175- " Space separated list of additional startup options to pass to Bazel."
176- " E.g. --bazel_startup_options='--nobatch --noclient_debug'"
177- ) ,
173+ help = """
174+ Space separated list of additional startup options to pass to Bazel
175+ E.g. --bazel_startup_options='--nobatch --noclient_debug'
176+ """ ,
178177 )
179178
180179 parser .add_argument (
181180 "--bazel_build_options" ,
182181 type = str ,
183182 default = "" ,
184- help = (
185- "Space separated list of additional build options to pass to"
186- " Bazel.E.g. --bazel_build_options='--local_resources=HOST_CPUS"
187- " --nosandbox_debug'"
188- ),
183+ help = """
184+ Space separated list of additional build options to pass to Bazel
185+ E.g. --bazel_build_options='--local_resources=HOST_CPUS --nosandbox_debug'
186+ """ ,
189187 )
190188
191189 parser .add_argument (
@@ -207,18 +205,18 @@ def add_artifact_subcommand_global_arguments(parser: argparse.ArgumentParser):
207205 "--ci_mode" ,
208206 action = "store_true" ,
209207 help = """
210- When set, the CLI will assume the build is being run in CI or CI
211- like environment and will use the "ci_" configs in the .bazelrc.
212- """ ,
208+ When set, the CLI will assume the build is being run in CI or CI like
209+ environment and will use the "ci_" configs in the .bazelrc.
210+ """ ,
213211 )
214212
215213 parser .add_argument (
216214 "--request_rbe" ,
217215 action = "store_true" ,
218216 help = """
219- If set, the build will try to use RBE. Currently, only Linux x86
220- and Windows support RBE. RBE also requires GCP authentication set
221- up to work.
217+ If set, the build will try to use RBE. Currently, only Linux x86 and
218+ Windows support RBE. RBE also requires GCP authentication set up to
219+ work.
222220 """ ,
223221 )
224222
@@ -244,15 +242,14 @@ def add_artifact_subcommand_global_arguments(parser: argparse.ArgumentParser):
244242 "--target_cpu_features" ,
245243 choices = ["release" , "native" , "default" ],
246244 default = "release" ,
247- help = (
248- "What CPU features should we target? 'release' enables CPU "
249- "features that should be enabled for a release build, which on "
250- "x86-64 architectures enables AVX. 'native' enables "
251- "-march=native, which generates code targeted to use all "
252- "features of the current machine. 'default' means don't opt-in "
253- "to any architectural features and use whatever the C compiler "
254- "generates by default."
255- ),
245+ help = """
246+ What CPU features should we target? 'release' enables CPU features that
247+ should be enabled for a release build, which on x86-64 architectures
248+ enables AVX. 'native' enables -march=native, which generates code
249+ targeted to use all features of the current machine. 'default' means
250+ don't opt-in to any architectural features and use whatever the C
251+ compiler generates by default.
252+ """ ,
256253 )
257254
258255 parser .add_argument (
@@ -267,9 +264,9 @@ def add_artifact_subcommand_global_arguments(parser: argparse.ArgumentParser):
267264 type = str ,
268265 default = os .environ .get ("JAXCI_XLA_GIT_DIR" , "" ),
269266 help = """
270- Path to local XLA repository to use. If not set, Bazel uses the XLA
271- at the pinned version in workspace.bzl.
272- """ ,
267+ Path to local XLA repository to use. If not set, Bazel uses the XLA at
268+ the pinned version in workspace.bzl.
269+ """ ,
273270 )
274271
275272 parser .add_argument (
@@ -282,21 +279,19 @@ def add_artifact_subcommand_global_arguments(parser: argparse.ArgumentParser):
282279 )
283280
284281
285- def parse_and_append_bazel_options (
286- bazel_command : command .CommandBuilder , bazel_options : str
287- ):
282+ def parse_and_append_bazel_options (bazel_command : command .CommandBuilder , bazel_options : str ):
288283 """Parses the bazel options and appends them to the bazel command."""
289284 for option in bazel_options .split (" " ):
290285 bazel_command .append (option )
291286
292287
293288async def main ():
294289 parser = argparse .ArgumentParser (
295- description = (
296- " CLI for building one of the following packages from source: jaxlib, "
297- " jax-cuda-plugin, jax-cuda-pjrt, jax-rocm-plugin, jax-rocm-pjrt."
298- "and for updating the requirements_lock.txt files"
299- ) ,
290+ description = r"""
291+ CLI for building one of the following packages from source: jaxlib,
292+ jax-cuda-plugin, jax-cuda-pjrt, jax-rocm-plugin, jax-rocm-pjrt and for
293+ updating the requirements_lock.txt files
294+ """ ,
300295 epilog = EPILOG ,
301296 )
302297
0 commit comments