nanoGPT
nanoGPT copied to clipboard
Apple Silicon M1
Cannot get train.py to run on Apple Silicon M1 gives compilation errors or CUDA errors with "cpu" or "mps" as the device.
how cool is it to have so much power on which nothing actually works, the whole world is happy installing and moving forward but no not for Macs younger than 18 months (that is 2 human babies later and still hardly a thing works on it out of the box)! If you want to develop with Mac you must be prepared to severely suffer and jump to an insane amount of hoops to get the least done. When you must jump then ask how high and don't complain. There is always something "special" going on with Macs. At this point I cannot recall the motivation anymore for working with these wonderful machines for which no one can seem to make something just work, sad. A rant I know, I am the same point and was hoping to find some clues.
work well for me on M2 Mac... so M1 Mac would not be an issue. I used this to install the libraries and drivers and such
- Download and install Conda env: https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh sh ~/Downloads/Miniforge3-MacOSX-arm64.sh source ~/miniforge3/bin/activate
- Install the TensorFlow dependencies: conda install -c apple tensorflow-deps
- Install base TensorFlow: python -m pip install tensorflow-macos
- Install base TensorFlow-metal: python -m pip install tensorflow-metal
- other tools can be installed as well pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu pip install torch torchvision torchaudio -f https://download.pytorch.org/whl/cu111/torch_stable.html --force-reinstall
HTH
thanks for the instruction, strange enough I am already working fine with tensorflow installed in a conda env, I also try to run nanoGPT in that same active conda env. I saw elsewhere that I need to use special flag, msf if I recall ok. Anyways good to hear it must be possible. Maybe it is even better to start with CPU and the alphabet to see how it behaves and slowly build it up, at some point I would want to go GPU but not perse local. There is no active nanoGPT space on HF. I am figuring out how to run it on HF, or another cloud.