azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Support azureml-pipeline-steps on M1 Mac

Open davystrong opened this issue 2 years ago • 7 comments

  • Package Name: azureml-pipeline-steps
  • Package Version: 1.39.0
  • Operating System: macOS Monterey 12.3
  • Python Version: 3.8.12

Describe the bug I can't install azureml-pipeline-steps on an M1 Mac because some dependencies don't support ARM. I have found four problem dependencies:

  • pyarrow (azureml-pipeline-steps uses an old version which doesn't have ARM support. New versions do).
  • azureml-dataprep-native, azureml-dataprep-rslex and dotnetcore2, all of which are distributed as binary wheels and don't support ARM.

To Reproduce Steps to reproduce the behavior:

  1. Run pip install azureml-pipeline-steps

Expected behavior It should install correctly.

davystrong avatar Mar 16 '22 13:03 davystrong

@davystrong Thanks for reporting this issue. We are redirecting it to services team to look into it.

SaurabhSharma-MSFT avatar Mar 18 '22 18:03 SaurabhSharma-MSFT

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureml-github.

Issue Details
  • Package Name: azureml-pipeline-steps
  • Package Version: 1.39.0
  • Operating System: macOS Monterey 12.3
  • Python Version: 3.8.12

Describe the bug I can't install azureml-pipeline-steps on an M1 Mac because some dependencies don't support ARM. I have found four problem dependencies:

  • pyarrow (azureml-pipeline-steps uses an old version which doesn't have ARM support. New versions do).
  • azureml-dataprep-native, azureml-dataprep-rslex and dotnetcore2, all of which are distributed as binary wheels and don't support ARM.

To Reproduce Steps to reproduce the behavior:

  1. Run pip install azureml-pipeline-steps

Expected behavior It should install correctly.

Author: davystrong
Assignees: -
Labels:

question, Machine Learning, Service Attention, Client, customer-reported, needs-team-attention

Milestone: -

ghost avatar Mar 18 '22 18:03 ghost

HI @SaurabhSharma-MSFT, @bandsina May I ask, is there any update regarding the support of M1 ?

nagydavid avatar Jun 13 '22 10:06 nagydavid

Also have the same issue. Any update on this?

lnkirkham-datasparq avatar Jun 29 '22 09:06 lnkirkham-datasparq

Hi @SaurabhSharma-MSFT ,@xiangyan99, @bandsina Can we have an ETA or options for possible solutions.

Thanks in advance

nagydavid avatar Jul 05 '22 09:07 nagydavid

@azureml-github

xiangyan99 avatar Jul 08 '22 18:07 xiangyan99

It's almost 5 months since I opened this issue, would love an update. Is this anywhere near being fixed?

davystrong avatar Aug 09 '22 14:08 davystrong

Install x86_64 python packages on M1 MacBook Apple Silicon

Found a temporary workaround that will allow M1 MacBook Pros to install x86 binaries.

The steps here will install x86_64 binarys of homebrew, poetry and python. I am using pyenv and poetry to manage python environments and dependencies respectively.

Configure new rosetta terminal

  1. Duplicate a new terminal by going to applications>utilities>Terminal.app
  2. Rename the duplicated terminal app to Rosetta Terminal.
  3. Right click on Rosetta Terminal and select Get Info.
  4. Tick the box Open using Rosetta

Install x86 dependencies

  1. First of all to run x86 executables, we'll need to install [Rosetta]. Open a new Rosetta Terminal:
softwareupdate --install-rosetta --agree-to-license
  1. Install x86 Home-brew:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

This will install homebrew at /usr/local/Homebrew/bin/brew

  1. Add this short script in ~./zshrc:
archcheck () {
   if [ "$(uname -p)" = "i386" ]
   then
     echo "Running in i386 mode (Rosetta)"
     eval "$(/usr/local/Homebrew/bin/brew shellenv)"
     alias brew='/usr/local/Homebrew/bin/brew'
   elif [ "$(uname -p)" = "arm" ]
   then
     echo "Running in ARM mode (M1)"
     eval "$(/opt/homebrew/bin/brew shellenv)"
     alias brew='/opt/homebrew/bin/brew'
   else
     echo "Unknown architecture detected"
   fi
}
eval "archcheck"

This script will evaluate on start up of each terminal session and set the appropriate homebrew path.

  1. Install pyenv:
brew install pyenv
  1. Add pyenv configs in ~/.zshrc
export PYENV_ROOT="$HOME/.pyenv"
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
  1. Restart the shell:
exec "$SHELL"
  1. Install python build dependencies and poetry:
brew install openssl readline sqlite3 xz zlib tcl-tk poetry
  1. Add poetry alias to ~/.zshrc:
echo 'alias poetry="/usr/local/Cellar/poetry/1.2.0_1/libexec/bin/poetry"' >> ~/.zshrc
  1. Restart shell:
exec "$SHELL"
  1. Install python 3.8.13 using pyenv:
pyenv install 3.8.13

lloydhamilton avatar Sep 16 '22 14:09 lloydhamilton

+1

Developing Azure ML from M1 requires additional set up, both for local and remote development. Makes it harder to advocate for Azure ML to clients working with M1 local workspaces.

WiktorMadejski avatar Oct 10 '22 08:10 WiktorMadejski

Install x86_64 python packages on M1 MacBook Apple Silicon

Found a temporary workaround that will allow M1 MacBook Pros to install x86 binaries.

The steps here will install x86_64 binarys of homebrew, poetry and python. I am using pyenv and poetry to manage python environments and dependencies respectively.

Configure new rosetta terminal

  1. Duplicate a new terminal by going to applications>utilities>Terminal.app
  2. Rename the duplicated terminal app to Rosetta Terminal.
  3. Right click on Rosetta Terminal and select Get Info.
  4. Tick the box Open using Rosetta

Install x86 dependencies

  1. First of all to run x86 executables, we'll need to install [Rosetta]. Open a new Rosetta Terminal:
softwareupdate --install-rosetta --agree-to-license
  1. Install x86 Home-brew:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

This will install homebrew at /usr/local/Homebrew/bin/brew

  1. Add this short script in ~./zshrc:
archcheck () {
   if [ "$(uname -p)" = "i386" ]
   then
     echo "Running in i386 mode (Rosetta)"
     eval "$(/usr/local/Homebrew/bin/brew shellenv)"
     alias brew='/usr/local/Homebrew/bin/brew'
   elif [ "$(uname -p)" = "arm" ]
   then
     echo "Running in ARM mode (M1)"
     eval "$(/opt/homebrew/bin/brew shellenv)"
     alias brew='/opt/homebrew/bin/brew'
   else
     echo "Unknown architecture detected"
   fi
}
eval "archcheck"

This script will evaluate on start up of each terminal session and set the appropriate homebrew path.

  1. Install pyenv:
brew install pyenv
  1. Add pyenv configs in ~/.zshrc
export PYENV_ROOT="$HOME/.pyenv"
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
  1. Restart the shell:
exec "$SHELL"
  1. Install python build dependencies and poetry:
brew install openssl readline sqlite3 xz zlib tcl-tk poetry
  1. Add poetry alias to ~/.zshrc:
echo 'alias poetry="/usr/local/Cellar/poetry/1.2.0_1/libexec/bin/poetry"' >> ~/.zshrc
  1. Restart shell:
exec "$SHELL"
  1. Install python 3.8.13 using pyenv:
pyenv install 3.8.13

@lloydhamilton works for me, thanks for describing it so nicely.

My notes:

  • ) pyenv/poetry are not a must - key points are
  1. Install -x86_64 brew using Rosetta Terminal
  2. Use same brew to instal build dependencies
  3. When python installs dependency make sure correct build dependencies are used

-) Keep in mind the executions will be very slow.

WiktorMadejski avatar Oct 10 '22 11:10 WiktorMadejski

v1 SDK is in maintenance only mode in favor of the v2 SDK being GA. Please file an issue for v2 SDK if your requests stand for v2. https://learn.microsoft.com/en-us/azure/machine-learning/how-to-migrate-from-v1

luigiw avatar Oct 24 '22 22:10 luigiw

Folks you can also use conda:

  1. Instal miniconda on your MacOS with Apple Silicon

  2. create conda environment: CONDA_SUBDIR=osx-64 conda create -p conda python=3.8.13 -y conda activate conda config --env --set subdir osx-64

  3. Enjoy Azure ML Python SDK v1

WiktorMadejski avatar Feb 09 '23 12:02 WiktorMadejski