Skip to content

Commit

Permalink
[Doc] Update installation doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dddg617 committed Jan 31, 2024
1 parent 8013eab commit 0c84b13
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 14 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,6 @@ Currently, GammaGL requires **Python Version >= 3.9**.
$ python setup.py install
```

or directly use the stable version:

```bash
$ pip install gammagl
```
> 大陆用户如果遇到网络问题,推荐从启智社区安装
>
> Try to git clone from OpenI
Expand All @@ -179,6 +174,8 @@ Currently, GammaGL requires **Python Version >= 3.9**.
>
> `git submodule update --init`
You may also download the stable version refer to our [document](https://gammagl.readthedocs.io/en/latest/notes/installation.html).

## Quick Tour for New Users

In this quick tour, we highlight the ease of creating and training a GNN model with only a few lines of code.
Expand Down
6 changes: 3 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sphinx-markdown-tables
sphinx-intl
recommonmark
sphinx_copybutton==0.4.0
numpy<=1.23
numpy
scipy
tensorflow<=2.11.0
torch
Expand All @@ -14,5 +14,5 @@ tensorlayerx==0.5.8
pytest
pyparsing
pybind11
pybind11
pandas==2.0.3
pandas
nbsphinx
16 changes: 12 additions & 4 deletions docs/source/notes/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,26 @@ System requrements
GammaGL works with the following operating systems:

* Linux
* Windows
* Windows (Currently, we only support python 3.9, pytorch 2.1 and CPU on Windows)

GammaGL requires Python version 3.9 or 3.10(partially).
GammaGL requires Python version 3.9, 3.10, 3.11.

Backend
-------

- `tensorflow <https://www.tensorflow.org/api_docs/>`_ : We recommend tensorflow version under 2.12.0
- `pytorch <https://pytorch.org/get-started/locally/>`_ : Support version from 1.9 to 2.1
- `pytorch <https://pytorch.org/get-started/locally/>`_ : Support version from 1.9 to 2.1, the defalut backend
- `paddlepaddle <https://www.paddlepaddle.org.cn/>`_ : We recommend paddlepaddle version under 2.3.2
- `mindspore <https://www.mindspore.cn/install>`_ : Support version to 2.2.10

Quick Start with PyTorch
------------------------

.. raw:: html
:file: quick-start.html

If you choose the other backend, you can directly install gammagl with `pip install gammagl`.

Install from pip
----------------

Expand Down Expand Up @@ -51,7 +59,7 @@ Install from pip
**3. GammaGL:** Install `GammaGL <https://github.com/BUPT-GAMMA/GammaGL>`_ and its dependencies.

.. code:: bash
pip install gammgl
Install from source
Expand Down
138 changes: 138 additions & 0 deletions docs/source/notes/quick-start.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<style>
.quick-start {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
margin-bottom: 20px;
}

.title-column {
flex-grow: 0;
}

.content-column {
flex-grow: 1;
}

.row {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}

.title-column div, .row div {
white-space: nowrap;
}

.title-column div {
padding: 14px 10px 12px 0;
font-weight: 700;
}

.row div {
flex-grow: 1;
text-align: center;
margin: 2px;
padding: 12px 0 10px 0;
background: #e3e3e3;
cursor: pointer;
}

.row div.selected {
background: rgba(59,155,239,0.7);
color: #ffffff;
}

#command {
margin: 2px;
padding: 12px 10px 10px 10px;
}

#command pre {
padding: 0;
margin: 0;
white-space: pre-wrap;
}

</style>

<div class="quick-start">
<div class="title-column">
<div>PyTorch</div>
<div>Your OS</div>
<div>CUDA</div>
<div>Run:</div>
</div>
<div class="content-column">
<div class="row" id="torch"></div>
<div class="row" id="os"></div>
<div class="row" id="cuda"></div>
<div class="row" id="command"><pre></pre></div>
</div>
</div>

<script>
var torchList = [
['pt21', 'PyTorch 2.1.*'],
['pt20', 'PyTorch 2.0.*'],
['pt113', 'PyTorch 1.13.*'],
];

var osList = [
['linux', 'Linux'],
['windows', 'Windows'],
];

var cudaList = [
['post116', '11.6'],
['post118', '11.8'],
['cpu', 'CPU'],
];

torchList.forEach(x => $("#torch").append(`<div id="${x[0]}">${x[1]}</div>`));
osList.forEach(x => $("#os").append(`<div id="${x[0]}">${x[1]}</div>`));
cudaList.forEach(x => $("#cuda").append(`<div id="${x[0]}">${x[1]}</div>`));

function updateCommand() {
var torch = $("#command").attr("torch");
var os = $("#command").attr("os");
var cuda = $("#command").attr("cuda");

if (os == "windows" && torch != "pt21" && cuda != "cpu") {
$("#command pre").text('# Currently, we only support PyTorch 2.1.* and CPU on Windows');
}

else if (torch == "pt20" && cuda == "post116") {
$("#command pre").text('# PyTorch 2.0.* binaries do not support CUDA 11.6');
}

else if (torch == "pt21" && cuda == "post116") {
$("#command pre").text('# PyTorch 2.1.* binaries do not support CUDA 11.6');
}

else if (torch == "pt113" && cuda == "post118") {
$("#command pre").text('# PyTorch 1.13.* binaries do not support CUDA 11.8');
}

else if (cuda == "cpu") {
$("#command pre").text(`pip install gammag-${$("#command").attr("torch")}==0.4.0`);
}

else {
$("#command pre").text(`pip install gammag-${$("#command").attr("torch")}==0.4.0.${$("#command").attr("cuda")}`);
}
}

$(".quick-start .content-column .row div").click(function() {
$(this).parent().children().removeClass("selected");
$(this).addClass("selected");
$("#command").attr($(this).parent().attr("id"), $(this).attr("id"));
updateCommand();
});

$("#torch").children().get(0).click();
$("#linux").click();
$("#cpu").click();

</script>
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
numpy<=1.23
numpy
scipy
pybind11
tensorflow
torch
git+https://github.com/tensorlayer/tensorlayerx.git
pytest
tqdm
Expand Down

0 comments on commit 0c84b13

Please sign in to comment.