Skip to content

Commit

Permalink
update docs for `install_tensorflow() on Arm Macs
Browse files Browse the repository at this point in the history
  • Loading branch information
t-kalinowski committed Aug 2, 2023
1 parent c038ca3 commit 068e506
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
and if so, and installs cuDNN, updates "~/.profile", and emits additional
instructions for how to install the necessary CUDA drivers to enable GPU usage.
Set new arg `configure_cuda_vars=FALSE` to disable.
- `pip_ignore_installed` default is now `FALSE` again.
- On Arm Macs (M1/M2), the default tensorflow package is once again installed,
rather than `tensorflow-macos` and `tensorflow-metal`.

- New `pillar:type_sum()` method for Tensors, giving a
more informative printout of Tensors in R tracebacks and tibbles.
Expand Down
15 changes: 5 additions & 10 deletions R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,12 @@
#' Sys.setenv("RETICULATE_PYTHON" = "~/path/to/python-env/bin/python")
#' ```
#'
#' @section Apple Silicon: Tensorflow on Apple Silicon is not officially
#' supported by the Tensorflow maintainers. However Apple has published a
#' custom version of Tensorflow compatible with Arm Macs.
#' `install_tensorflow()` will install the special packages `tensorflow-macos`
#' and `tensorflow-metal` on Arm Macs. See
#' @section Apple Silicon: Beginning with Tensorflow version 2.13, the default
#' tensorflow package now works on Apple Silicon. See
#' \url{https://developer.apple.com/metal/tensorflow-plugin/} for instructions
#' on how to do the equivalent manually. Please note that this is an
#' experimental build of both Python and Tensorflow, with known issues. In
#' particular, certain operations will cause errors, but can often be remedied
#' by pinning them to the CPU. For example:
#' on how to install older versions of Tensorflow on macOS. Please note that
#' not all operations are supported on Arm Mac GPUs. You can work around the
#' missing operations by pinning operations to CPU. For example:
#'
#' ```` R
#' x <- array(runif(64*64), c(1, 64, 64))
Expand Down Expand Up @@ -232,7 +228,6 @@ function(method = c("auto", "virtualenv", "conda"),
msg <- "# Configured by the R function tensorflow::install_tensorflow()"

if(!all(c(msg, vars) %in% profile)) {
browser()
profile <- c(profile, "", msg, vars, "")
writeLines(profile, "~/.profile")
message("- Updated file '~/.profile' with new environment variables.")
Expand Down
16 changes: 6 additions & 10 deletions man/install_tensorflow.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 068e506

Please sign in to comment.