From fcd521be1643c1cda408d0ada8b3b18854f92713 Mon Sep 17 00:00:00 2001 From: Nishidha Panpaliya Date: Thu, 13 Oct 2022 06:24:58 +0000 Subject: [PATCH 1/5] Updated readme for issue# 324 --- doc/README.open_ce_build.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/README.open_ce_build.md b/doc/README.open_ce_build.md index 05fb8dba..a8a47119 100644 --- a/doc/README.open_ce_build.md +++ b/doc/README.open_ce_build.md @@ -32,13 +32,21 @@ while a similar build for pytorch may look like this: ``` Note that `bazel` is used to build `TensorFlow`. By default, `bazel` caches the files/source code it downloads during the build to ~/.cache/bazel. In case the home directory is low in memory, the packages using bazel as a build tool might fail. -One can change the cache directory location used by bazel by setting `$TEST_TMPDIR` in the `build.sh` of the respective feedstock like this: +One can change the cache directory location used by bazel in two ways as follows - + +1. By setting `$TEST_TMPDIR` in the `build.sh` of the respective feedstock like this: ```shell export TEST_TMPDIR=/dev/shm/.cache bazel build ... ``` +2. By making a global change in user specific `~/.bazelrc` for all packages that use bazel as a build tool. This way one doesn't need to modify every feedstock: + +```shell + echo "startup --output_user_root=/dev/shm/.cache" >> ~/.bazelrc +``` + Other environment files for other packages can also be found in the `envs` directory; simply specify the file for whichever package environment you want. From 71ce99ee32538be85a618a1bf79d54cdd448121f Mon Sep 17 00:00:00 2001 From: Nishidha Panpaliya Date: Thu, 13 Oct 2022 06:31:20 +0000 Subject: [PATCH 2/5] Some more update --- doc/README.open_ce_build.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/README.open_ce_build.md b/doc/README.open_ce_build.md index a8a47119..4cbc6005 100644 --- a/doc/README.open_ce_build.md +++ b/doc/README.open_ce_build.md @@ -463,14 +463,14 @@ For example: GCC 11 setup is automated if the builds are done in a podman container using `--container_build` option. Please see [`Dockerfile`](https://github.com/open-ce/open-ce-builder/blob/main/open_ce/images/builder/Dockerfile-p10) used for containerized build of these packages. #### Build packages -Power10 MMA Optimization is applicable for cpu only builds. One has to use `--ppc_arch=p10` flag in the `open-ce build env` or `open-ce build feedstock` command to build P10 enabled packages. Another important argument which is must to build these packages is `--conda_build_config=open-ce/envs/conda_build_config.yaml,open-ce/envs/conda_build_config_p10.yaml`.[`conda_build_config_p10.yaml`](https://github.com/open-ce/open-ce/blob/main/envs/conda_build_config_p10.yaml) contains Power10 specific settings. +Power10 MMA Optimization is applicable for cpu only builds. One has to use `--ppc_arch=p10` flag in the `open-ce build env` or `open-ce build feedstock` command to build P10 enabled packages. Another important argument which is must to build these packages is `--conda_build_config=open-ce/envs/conda_build_config.yaml,open-ce/envs/conda_build_config_p10.yaml`.[`conda_build_config_p10.yaml`](https://github.com/open-ce/open-ce/blob/main/envs/conda_build_config_p10.yaml) contains Power10 specific settings. For example: ```shell open-ce build env --build_type=cpu --ppc_arch=p10 --conda_build_config=open-ce/envs/conda_build_config.yaml,open-ce/envs/conda_build_config_p10.yaml tensorflow-env.yaml ``` -Open-CE also contains [`open-ce/envs/opence-p10-env.yaml`](https://github.com/open-ce/open-ce/blob/main/envs/opence-p10-env.yaml) which builds all the Power10 enabled packages in one go. +Open-CE also contains [`open-ce/envs/opence-p10-env.yaml`](https://github.com/open-ce/open-ce/blob/main/envs/opence-p10-env.yaml) which builds all the Power10 enabled packages in one go. If P10 packages are built using `opence-p10-env.yaml`, one can skip specifying argument `--conda_build_config=open-ce/envs/conda_build_config.yaml,open-ce/envs/conda_build_config_p10.yaml` as these conda build config files are imported in `opence-p10-env.yaml` by default. But with individual environment files like `tensorflow-env.yaml`, one must provide this argument. #### Using packages with Power10 MMA optimization When using packages that were built with ppc_arch=p10, note that: From 20dd0651d4a2668ea6678124fd23f2bd49921de0 Mon Sep 17 00:00:00 2001 From: Nishidha Date: Thu, 13 Oct 2022 12:03:06 +0530 Subject: [PATCH 3/5] Minor change --- doc/README.open_ce_build.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/README.open_ce_build.md b/doc/README.open_ce_build.md index 4cbc6005..3dd429d3 100644 --- a/doc/README.open_ce_build.md +++ b/doc/README.open_ce_build.md @@ -470,7 +470,7 @@ For example: open-ce build env --build_type=cpu --ppc_arch=p10 --conda_build_config=open-ce/envs/conda_build_config.yaml,open-ce/envs/conda_build_config_p10.yaml tensorflow-env.yaml ``` -Open-CE also contains [`open-ce/envs/opence-p10-env.yaml`](https://github.com/open-ce/open-ce/blob/main/envs/opence-p10-env.yaml) which builds all the Power10 enabled packages in one go. If P10 packages are built using `opence-p10-env.yaml`, one can skip specifying argument `--conda_build_config=open-ce/envs/conda_build_config.yaml,open-ce/envs/conda_build_config_p10.yaml` as these conda build config files are imported in `opence-p10-env.yaml` by default. But with individual environment files like `tensorflow-env.yaml`, one must provide this argument. +Open-CE also contains [`open-ce/envs/opence-p10-env.yaml`](https://github.com/open-ce/open-ce/blob/main/envs/opence-p10-env.yaml) which builds all the Power10 enabled packages in one go. If Power10 packages are built using `opence-p10-env.yaml`, one can skip specifying argument `--conda_build_config=open-ce/envs/conda_build_config.yaml,open-ce/envs/conda_build_config_p10.yaml` as these conda build config files are imported in `opence-p10-env.yaml` by default. But with individual environment files like `tensorflow-env.yaml`, one must provide this argument. #### Using packages with Power10 MMA optimization When using packages that were built with ppc_arch=p10, note that: From 9ddf2ed872b02906b57302d2c6850fa507fa6bf1 Mon Sep 17 00:00:00 2001 From: Nishidha Panpaliya Date: Thu, 13 Oct 2022 07:02:36 +0000 Subject: [PATCH 4/5] Some more doc updates --- doc/README.open_ce_build.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/doc/README.open_ce_build.md b/doc/README.open_ce_build.md index 3dd429d3..3cd13a95 100644 --- a/doc/README.open_ce_build.md +++ b/doc/README.open_ce_build.md @@ -31,6 +31,18 @@ while a similar build for pytorch may look like this: open-ce build env pytorch-env.yaml ``` +Other environment files for other packages can also be found in the `envs` +directory; simply specify the file for whichever package environment you want. + +> Note: that the `open-ce build env` command executes the `open-ce build feedstock` command +> as needed, behind the scenes. This script builds each individual feedstock +> component dependency using the build recipe within its own repository. +> You do not need to execute `open-ce build feedstock` directly yourself, although +> you may do so if you wish to perform an individual build of your own +> for any given Open-CE feedstock repository. + +#### Tips for bazel builds #### + Note that `bazel` is used to build `TensorFlow`. By default, `bazel` caches the files/source code it downloads during the build to ~/.cache/bazel. In case the home directory is low in memory, the packages using bazel as a build tool might fail. One can change the cache directory location used by bazel in two ways as follows - @@ -47,15 +59,8 @@ One can change the cache directory location used by bazel in two ways as follows echo "startup --output_user_root=/dev/shm/.cache" >> ~/.bazelrc ``` -Other environment files for other packages can also be found in the `envs` -directory; simply specify the file for whichever package environment you want. - -> Note: that the `open-ce build env` command executes the `open-ce build feedstock` command -> as needed, behind the scenes. This script builds each individual feedstock -> component dependency using the build recipe within its own repository. -> You do not need to execute `open-ce build feedstock` directly yourself, although -> you may do so if you wish to perform an individual build of your own -> for any given Open-CE feedstock repository. +Also, in case the build fails, many a times, a stale process remains alive. And this could slow down subsequent builds. +Make sure to kill this stale bazel process before retrying the builds. ### Container build From 794dce3c0b1106c0dd805803e96a74ab14be6494 Mon Sep 17 00:00:00 2001 From: Nishidha Panpaliya Date: Thu, 13 Oct 2022 07:54:34 +0000 Subject: [PATCH 5/5] Review comments addressed --- doc/README.open_ce_build.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/README.open_ce_build.md b/doc/README.open_ce_build.md index 3cd13a95..837d5136 100644 --- a/doc/README.open_ce_build.md +++ b/doc/README.open_ce_build.md @@ -468,14 +468,14 @@ For example: GCC 11 setup is automated if the builds are done in a podman container using `--container_build` option. Please see [`Dockerfile`](https://github.com/open-ce/open-ce-builder/blob/main/open_ce/images/builder/Dockerfile-p10) used for containerized build of these packages. #### Build packages -Power10 MMA Optimization is applicable for cpu only builds. One has to use `--ppc_arch=p10` flag in the `open-ce build env` or `open-ce build feedstock` command to build P10 enabled packages. Another important argument which is must to build these packages is `--conda_build_config=open-ce/envs/conda_build_config.yaml,open-ce/envs/conda_build_config_p10.yaml`.[`conda_build_config_p10.yaml`](https://github.com/open-ce/open-ce/blob/main/envs/conda_build_config_p10.yaml) contains Power10 specific settings. +Power10 MMA Optimization is applicable for cpu only builds. To build Power10 packages, use one of the following options: -For example: -```shell - open-ce build env --build_type=cpu --ppc_arch=p10 --conda_build_config=open-ce/envs/conda_build_config.yaml,open-ce/envs/conda_build_config_p10.yaml tensorflow-env.yaml -``` +1. To build an individual environment: open-ce build env --ppc_arch=p10 --build_type=cpu --conda_build_config=open-ce/envs/conda_build_config.yaml,open-ce/envs/conda_build_config_p10.yaml . + +2. To build an individual feedstock: open-ce build feedstock --ppc_arch=p10 --build_type=cpu --conda_build_config=../open-ce/envs/conda_build_config.yaml,../open-ce/envs/conda_build_config_p10.yaml + +3. To build all Power10 enabled packages in one go: open-ce build env --ppc_arch=p10 --build_type=cpu opence-p10-env.yaml -Open-CE also contains [`open-ce/envs/opence-p10-env.yaml`](https://github.com/open-ce/open-ce/blob/main/envs/opence-p10-env.yaml) which builds all the Power10 enabled packages in one go. If Power10 packages are built using `opence-p10-env.yaml`, one can skip specifying argument `--conda_build_config=open-ce/envs/conda_build_config.yaml,open-ce/envs/conda_build_config_p10.yaml` as these conda build config files are imported in `opence-p10-env.yaml` by default. But with individual environment files like `tensorflow-env.yaml`, one must provide this argument. #### Using packages with Power10 MMA optimization When using packages that were built with ppc_arch=p10, note that: