Skip to content

Commit

Permalink
Update instructions for XLA build
Browse files Browse the repository at this point in the history
  • Loading branch information
SiLiKhon authored Aug 24, 2022
1 parent fe90ed9 commit 0a93bdd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions model_export/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
# Build the model lib:

If running in docker, first run the container and cd to the home path:
```bash
./run_docker_centos.sh
cd ~
```

The `setup_centos.sh` script (`model_export/setup_centos.sh`) contains all the environment setup.

*Note: this was only tested in a clean CentOS environment (in the docker container above), there might be conflicts with the main environment used for model training and evaluation.*

The `setup_centos.sh` script also creates a symlink to the `model_export/model_v4` folder and puts it into `tensorflow`. This folder contains bazel build instructions and needs to be inside the `tensorflow` directory to be built.
```bash
./setup_centos.sh
```

Now we need to build TensorFlow and our model (note: this make take a few hours for the first time...). The `./configure` command will ask for a bunch of configuration options - all of these, except for the path to python3, need to be set to default (i.e., just hit ENTER):
```bash
cd tensorflow/
./configure
# show path to python3 (/usr/bin/python3)
# rest options to default
BAZEL_LINKLIBS=-l%:libstdc++.a bazel build --local_resources 30000,15,1.0 -c opt model_v4:all_models
```
The `--local_resources` parameter from the last line allows to limit the resources to be used by bazel. 30000 is memory in megabytes, 15 is the number of CPU cores and 1.0 is the I/O capability. Not limiting the resources may result in a compiler crash.

# Test:
```bash
Expand Down

0 comments on commit 0a93bdd

Please sign in to comment.