Skip to content
This repository was archived by the owner on Jun 9, 2021. It is now read-only.

Commit 542bc26

Browse files
authored
Version 0.1-alpha3 (#185)
* Release 0.1-alpha3 * Fixes several failures in TensorFlow unit tests and other bug fixes. * Resolves <#165> * Improves README.
1 parent 340f381 commit 542bc26

File tree

4 files changed

+38
-16
lines changed

4 files changed

+38
-16
lines changed

README.md

+30-14
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
### INTRODUCTION
55

6-
This pre-release delivers hardware-accelerated TensorFlow and TensorFlow Addons for macOS 11.0+. Native hardware acceleration is supported on Macs with M1 and Intel-based Macs through Apple’s [ML Compute](https://developer.apple.com/documentation/mlcompute) framework.
6+
This pre-release delivers hardware-accelerated TensorFlow and TensorFlow Addons for macOS 11.0+. Native hardware acceleration is supported on M1 Macs and Intel-based Macs through Apple’s [ML Compute](https://developer.apple.com/documentation/mlcompute) framework.
77

88
### CURRENT RELEASE
99

10-
- 0.1-alpha2
10+
- 0.1-alpha3
1111

1212
### SUPPORTED VERSIONS
1313

@@ -17,35 +17,46 @@ This pre-release delivers hardware-accelerated TensorFlow and TensorFlow Addons
1717
### REQUIREMENTS
1818

1919
- macOS 11.0+
20-
- Python 3.8, available from the [Xcode Command Line Tools](https://developer.apple.com/download/more/?=command%20line%20tools).
20+
- Python 3.8 (required to be downloaded from [Xcode Command Line Tools](https://developer.apple.com/download/more/?=command%20line%20tools) for M1 Macs).
2121

2222
### INSTALLATION
2323

2424
An archive containing Python packages and an installation script can be downloaded from the [releases](https://github.com/apple/tensorflow_macos/releases).
2525

26-
#### Details
27-
2826
- To quickly try this out, copy and paste the following into Terminal:
2927

3028
```
31-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/apple/tensorflow_macos/master/scripts/download_and_install.sh)"
29+
% /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/apple/tensorflow_macos/master/scripts/download_and_install.sh)"
3230
```
3331

34-
This will verify your system, ask you for confirmation, then create a virtual environment (https://docs.python.org/3.8/tutorial/venv.html) with TensorFlow for macOS installed.
32+
This will verify your system, ask you for confirmation, then create a [virtual environment](https://docs.python.org/3.8/tutorial/venv.html) with TensorFlow for macOS installed.
3533

3634
- Alternatively, download the archive file from the [releases](https://github.com/apple/tensorflow_macos/releases). The archive contains an installation script, accelerated versions of TensorFlow, TensorFlow Addons, and needed dependencies.
3735

36+
```
37+
% curl -fLO https://github.com/apple/tensorflow_macos/releases/download/v0.1alpha2/tensorflow_macos-${VERSION}.tar.gz
38+
% tar xvzf tensorflow_macos-${VERSION}.tar
39+
% cd tensorflow_macos
40+
% ./install_venv.sh --prompt
41+
```
42+
3843
#### Installation on Conda
3944

4045
This pre-release version supports installation and testing using the Python from Xcode Command Line Tools. See [#153](https://github.com/apple/tensorflow_macos/issues/153) for more information on installation in a Conda environment.
4146

4247
#### Notes
4348

44-
For Macs with M1, the following packages are currently unavailable:
49+
For M1 Macs, the following packages are currently unavailable:
4550

4651
- SciPy and dependent packages
4752
- Server/Client TensorBoard packages
4853

54+
When installing pip packages in a virtual environment, you may need to specify `--target` as follows:
55+
56+
```
57+
% pip install --upgrade -t "${VIRTUAL_ENV}/lib/python3.8/site-packages/" PACKAGE_NAME
58+
```
59+
4960
### ISSUES AND FEEDBACK
5061

5162
Please submit feature requests or report issues via [GitHub Issues](https://github.com/apple/tensorflow_macos/issues).
@@ -63,9 +74,17 @@ There is an optional `mlcompute.set_mlc_device(device_name='any')` API for ML Co
6374
from tensorflow.python.compiler.mlcompute import mlcompute
6475
6576
# Select CPU device.
66-
mlcompute.set_mlc_device(device_name='cpu') # Available options are 'cpu', 'gpu', and any'.
77+
mlcompute.set_mlc_device(device_name='cpu') # Available options are 'cpu', 'gpu', and 'any'.
6778
```
6879

80+
#### Unsupported TensorFlow Features
81+
82+
The following TensorFlow features are currently not supported in this fork:
83+
84+
- [tf.vectorized_map](https://www.tensorflow.org/api_docs/python/tf/vectorized_map)
85+
- [Higher-order gradients](https://www.tensorflow.org/guide/advanced_autodiff#higher-order_gradients)
86+
- Jacobian-vector products (aka. [forwardprop](https://www.tensorflow.org/api_docs/python/tf/autodiff/ForwardAccumulator))
87+
6988

7089
#### Logs and Debugging
7190

@@ -96,10 +115,7 @@ Unlike graph mode, logging in eager mode is controlled by `TF_CPP_MIN_VLOG_LEVEL
96115

97116
- Larger models being trained on the GPU may use more memory than is available, resulting in paging. If this happens, try decreasing the batch size or the number of layers.
98117
- TensorFlow is multi-threaded, which means that different TensorFlow operations, such as` MLCSubgraphOp`, can execute concurrently. As a result, there may be overlapping logging information. To avoid this during the debugging process, set TensorFlow to execute operators sequentially by setting the number of threads to 1 (see [`tf.config.threading.set_inter_op_parallelism_threads`](https://www.tensorflow.org/api_docs/python/tf/config/threading/set_inter_op_parallelism_threads)).
99-
100-
##### Additional tips for debugging in eager mode:
101-
102-
- To find information about a specific tensor in the log, search for its buffer pointer in the log. If the tensor is defined by an operation that ML Compute does not support, you will need to cast it to `size_t` and search for it in log entries with the pattern `MemoryLogTensorAllocation ... true ptr: <(size_t)ptr>`. You may also need to modify the `OpKernelContext::input()` to print out the input pointer so that you can see the entire use-def chain in the log.
103-
- You may disable the conversion of any eager operation to ML Compute by using `TF_DISABLE_MLC_EAGER=“;Op1;Op2;...”`. The gradient op may also need to be disabled by modifying the file `$PYTHONHOME/site-packages/tensorflow/python/ops/_grad.py` (this avoids TensorFlow recompilation).
118+
- In eager mode, you may disable the conversion of any operation to ML Compute by using `TF_DISABLE_MLC_EAGER=“;Op1;Op2;...”`. The gradient op may also need to be disabled by modifying the file `$PYTHONHOME/site-packages/tensorflow/python/ops/_grad.py` (this avoids TensorFlow recompilation).
104119
- To initialize allocated memory with a specific value, use `TF_MLC_ALLOCATOR_INIT_VALUE=<init-value>`.
120+
- To disable ML Compute acceleration (e.g. for debugging or results verification), set the environment variable `TF_DISABLE_MLC=1`.
105121

RELEASE.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Release 0.1-alpha3
2+
3+
* Fixes several failures in TensorFlow unit tests and other bug fixes.
4+
* Resolves <https://github.com/apple/tensorflow_macos/issues/165>
5+
* Improves README.
6+
17
# Release 0.1-alpha2
28

39
* Fixes several failures in TensorFlow unit tests and other bug fixes.

scripts/download_and_install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
VERSION=0.1alpha2
5+
VERSION=0.1alpha3
66
INSTALLER_PACKAGE=tensorflow_macos-$VERSION.tar.gz
77
INSTALLER_PATH=https://github.com/apple/tensorflow_macos/releases/download/v$VERSION/$INSTALLER_PACKAGE
88
INSTALLER_SCRIPT=install_venv.sh

scripts/install_venv.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ arch_list_arm64=( numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl
5353
h5py-2.10.0-cp38-cp38-macosx_11_0_arm64.whl )
5454

5555

56-
tensorflow_version=0.1a2
56+
tensorflow_version=0.1a3
5757

5858

5959
function usage() {

0 commit comments

Comments
 (0)