Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Adding python 3.12 in document.
Adding more cuda version (cu121, cu122) in doc, with a method to detect the driver's cuda version (with nvidia-smi)
Provide a way to probe the most recent CUDA version that oneflow support.
Adding things related to PEP 668
  • Loading branch information
Neutron3529 committed Sep 12, 2024
1 parent f0d13a6 commit da14bf2
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ OneFlow is a deep learning framework designed to be **user-friendly, scalable an

### General
- Linux
- Python 3.7, 3.8, 3.9, 3.10, 3.11
- Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12

### CUDA
- CUDA arch 60 or above
Expand All @@ -43,6 +43,33 @@ docker pull oneflowinc/oneflow:nightly-cuda11.8

### Pip Install

- (*Optional*) Dealing with [PEP 668](https://peps.python.org/pep-0668/)
<details>
<summary>PEP 668 introduce marking installations as EXTERNALLY-MANAGED, which might stop you from installing packages.</summary>

When python code
```python
__import__('os').path.exists(__import__('sysconfig').get_path('stdlib', __import__('sysconfig').get_default_scheme())+'/EXTERNALLY-MANAGED')
```
returns `True`, python without a virtual environment is regarded as an `EXTERNALLY-MANAGED` installation.

In this case, `pip` cannot install any package directly since it will *break system packages*.

To bypass that issue, either install oneflow in a virtual environment created by
```bash
python3 -m venv /path/to/venv
```
then use `/path/to/venv/bin/python3` instead of `python3` to execute the following steps.

Adding a flag `--break-system-packages` after `pip install` to prove you know the consequene.

If you are boring with adding `--break-system-packages` flag, you could directly delete the file located at
```bash
python -c "print(__import__('sysconfig').get_path('stdlib', __import__('sysconfig').get_default_scheme())+'/EXTERNALLY-MANAGED')"
```
(This operation usually needs root permission). After that, the python build no longer regarded as *EXTERNALLY-MANAGED* build, and you could directly execute commands below.
</details>

- (**Highly recommended**) Upgrade pip

```
Expand All @@ -66,7 +93,24 @@ docker pull oneflowinc/oneflow:nightly-cuda11.8
```bash
python3 -m pip install --pre oneflow -f https://oneflow-staging.oss-cn-beijing.aliyuncs.com/branch/master/cu118
```
<details>
<summary>Here, `cu118` could be changed into other supported version (e.g., `cu121`, `cu122`).</summary>

The highest support cuda version could be obtained by
`nvidia-smi --version | grep CUDA`
(in case CUDA toolkit is installed).

Suppose you have `CUDA Version : 12.6`, you could use https://oneflow-staging.oss-cn-beijing.aliyuncs.com/branch/master/cu122.

You could try visiting
```
https://oneflow-staging.oss-cn-beijing.aliyuncs.com/branch/master/cu126
https://oneflow-staging.oss-cn-beijing.aliyuncs.com/branch/master/cu127
...
```
to probe whether a new oneflow version is online.
</details>

If you are in China, you could run this to have pip download packages from domestic mirror of pypi:
```
python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Expand Down

0 comments on commit da14bf2

Please sign in to comment.