Update README.md and put Python 3.10 a prerequisite (#1821)

* Update README.md and put Python 3.10 a prerequisite

* Update README.md

* Follow up with comments

* Update README.md
pull/1740/merge snapshot-20230126.730
Yi Wang 2023-01-25 11:32:50 -08:00 committed by GitHub
parent 506aceae7f
commit 27a31157b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 5 deletions

View File

@ -43,15 +43,26 @@ We have few paths to lower down to the Torch MLIR Dialect.
## Install torch-mlir snapshot ## Install torch-mlir snapshot
This installs a pre-built snapshot of torch-mlir for Python 3.7/3.8/3.9/3.10 on Linux and macOS. At the time of writing, we release pre-built snapshot of torch-mlir for Python 3.10 on Linux and macOS.
If you have Python 3.10, the following commands initialize a virtual environment.
```shell ```shell
python -m venv mlir_venv python3.10 -m venv mlir_venv
source mlir_venv/bin/activate source mlir_venv/bin/activate
# Some older pip installs may not be able to handle the recent PyTorch deps ```
Or, if you want to switch over multiple versions of Python using conda, you can create a conda environment with Python 3.10.
```shell
conda create -n torch-mlir python=3.10
conda activate torch-mlir
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install --pre torch-mlir torchvision -f https://llvm.github.io/torch-mlir/package-index/ --extra-index-url https://download.pytorch.org/whl/nightly/cpu ```
# This will install the corresponding torch and torchvision nightlies
Then, we can install torch-mlir with the corresponding torch and torchvision nightlies.
```
pip install --pre torch-mlir torchvision \
-f https://llvm.github.io/torch-mlir/package-index/
--extra-index-url https://download.pytorch.org/whl/nightly/cpu
``` ```
## Demos ## Demos