Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change readme install instructions #243

Merged
merged 69 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
abf1494
Update requirements.txt (#242)
PhiSpel Aug 23, 2024
c29fb64
Update requirements.txt
PhiSpel Aug 23, 2024
05156e6
Update README.rst
PhiSpel Aug 23, 2024
3b044ab
Update requirements.txt
PhiSpel Aug 23, 2024
33d4f1a
update requirements.txt removed exact matplotlib version
PhiSpel Aug 23, 2024
3145795
update requirements.txt add cudatoolkit for CUDA_HOME
PhiSpel Aug 23, 2024
e37131b
Merge branch 'master' into 234-feature-change-readme-install-instruct…
PhiSpel Aug 25, 2024
01f5cc1
made CI install from requirements.txt
PhiSpel Aug 26, 2024
a22c34b
removed exact pytorch-cuda restriction from requirements.txt and adde…
PhiSpel Aug 26, 2024
1636401
Update CI.yml
PhiSpel Aug 26, 2024
31621ff
Update CI.yml
PhiSpel Aug 26, 2024
428be89
Update CI.yml
PhiSpel Aug 26, 2024
5d1f076
Update CI.yml
PhiSpel Aug 26, 2024
5ac3493
Update CI.yml
PhiSpel Aug 26, 2024
2a9b481
Update setup.py to python 3.11
PhiSpel Aug 26, 2024
e74d9e2
require python 3.12
PhiSpel Aug 26, 2024
8ad1fbf
Merge remote-tracking branch 'lettucecfd/234-feature-change-readme-in…
PhiSpel Aug 26, 2024
4fdefc8
Update CI.yml
PhiSpel Aug 26, 2024
ce4ed8e
minor
PhiSpel Aug 26, 2024
2fbb890
removed pytorch-cuda from requirements
PhiSpel Aug 26, 2024
fdcc610
Update CI.yml
PhiSpel Aug 26, 2024
4d21b1e
Merge remote-tracking branch 'lettucecfd/234-feature-change-readme-in…
PhiSpel Aug 26, 2024
76ede64
update to matplotlib 3.9.2
PhiSpel Aug 26, 2024
a508350
Update CI.yml
PhiSpel Aug 26, 2024
6375e34
Update CI.yml
PhiSpel Aug 26, 2024
2e12a87
Update CI.yml
PhiSpel Aug 26, 2024
ac2ad70
Update CI.yml
PhiSpel Aug 26, 2024
f784498
update setuptools to 72.1
PhiSpel Aug 26, 2024
ebb30c0
Merge remote-tracking branch 'lettucecfd/234-feature-change-readme-in…
PhiSpel Aug 26, 2024
f20f317
Update CI.yml
PhiSpel Aug 26, 2024
f7f0b07
Update CI.yml
PhiSpel Aug 26, 2024
7deb3e7
Update CI.yml
PhiSpel Aug 26, 2024
2359ee6
Update CI.yml
PhiSpel Aug 26, 2024
4ffe7ae
Update CI.yml
PhiSpel Aug 26, 2024
961c2ba
Update CI.yml
PhiSpel Aug 26, 2024
d2a66fd
update setup.py
PhiSpel Aug 26, 2024
222e6b3
Update CI.yml
PhiSpel Aug 26, 2024
0e949c1
Update CI.yml
PhiSpel Aug 26, 2024
15a3e1e
Update CI.yml
PhiSpel Aug 26, 2024
e4b411e
Update CI.yml
PhiSpel Aug 26, 2024
d67640b
Update CI.yml
PhiSpel Aug 26, 2024
1e15679
Merge remote-tracking branch 'lettucecfd/234-feature-change-readme-in…
PhiSpel Aug 26, 2024
3e9e7de
Update CI.yml
PhiSpel Aug 26, 2024
64ee0e5
Update CI.yml
PhiSpel Aug 26, 2024
ce4ce6d
Update CI.yml
PhiSpel Aug 26, 2024
526cb35
Update CI.yml
PhiSpel Aug 26, 2024
4d5f2bf
Update CI.yml
PhiSpel Aug 26, 2024
c3902ef
removed deprecated test_suite
PhiSpel Aug 26, 2024
5d9f4b8
Merge remote-tracking branch 'lettucecfd/234-feature-change-readme-in…
PhiSpel Aug 26, 2024
4eb4331
update to use 'pip install setup.py'
PhiSpel Aug 26, 2024
ce89d02
Update CI.yml
PhiSpel Aug 26, 2024
b7addc4
Update CI.yml
PhiSpel Aug 26, 2024
7697eb9
Merge branch 'master-lettucecfd' into 234-feature-change-readme-insta…
PhiSpel Aug 26, 2024
060e329
use --use-pep517 for changable installation
PhiSpel Aug 26, 2024
7ac3e67
Merge branch 'master-lettucecfd' into 234-feature-change-readme-insta…
PhiSpel Aug 26, 2024
c80b139
fixed setuptools subversion
PhiSpel Aug 26, 2024
b68e2db
renamed TestEqBC
PhiSpel Aug 26, 2024
0342694
trying without specifying bash in CI
PhiSpel Aug 26, 2024
1482504
trying without miniconda specifications
PhiSpel Aug 26, 2024
770b7dc
trying np 2.0.0 again
PhiSpel Aug 26, 2024
24af75e
trying np 2.1.0 again
PhiSpel Aug 26, 2024
8d88c25
Merge remote-tracking branch 'lettucecfd/234-feature-change-readme-in…
PhiSpel Aug 26, 2024
6836bbd
Update CI.yml
PhiSpel Aug 26, 2024
6e11c93
Update CI.yml
PhiSpel Aug 26, 2024
655bb83
Update README.rst
PhiSpel Aug 28, 2024
a364853
Update README.rst
PhiSpel Aug 28, 2024
fdaf94a
Update README.rst
McBs Aug 28, 2024
68b0b39
Update CI.yml
PhiSpel Aug 28, 2024
ed5e852
Update README.rst
PhiSpel Aug 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,32 @@ jobs:
fail-fast: false
matrix:
cfg:
- { os: ubuntu-latest, python-version: '3.10', torch-version: 'torch>=2.1' }
- { os: windows-latest, python-version: '3.10', torch-version: 'torch>=2.1' }
- { os: macos-latest, python-version: '3.10', torch-version: 'torch>=2.1' }
- { os: ubuntu-latest, python-version: '3.11', torch-version: 'torch>=2.1' }
- { os: windows-latest, python-version: '3.11', torch-version: 'torch>=2.1' }
- { os: macos-latest, python-version: '3.11', torch-version: 'torch>=2.1' }
- { os: ubuntu-latest, python-version: '3.12', torch-version: 'pytorch>=2.4' }
- { os: windows-latest, python-version: '3.12', torch-version: 'pytorch>=2.4' }
- { os: macos-latest, python-version: '3.12', torch-version: 'pytorch>=2.4' }

steps:

- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.cfg.python-version }}
uses: actions/setup-python@v5
- name: Setup Miniconda
uses: conda-incubator/setup-[email protected]
with:
python-version: ${{ matrix.cfg.python-version }}
- name: Install dependencies
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
pip install pytest "${{ matrix.cfg.torch-version }}" numpy==1.26.4 pyevtk h5py mmh3
- name: Install package
conda install "${{ matrix.cfg.torch-version }}" -c pytorch -c nvidia
conda install --file requirements.txt -c conda-forge -c pytorch -c nvidia
- name: Install lettuce
shell: bash -el {0}
run: |
python setup.py install
pip install --use-pep517 .
- name: Unit tests with pytest
shell: bash -el {0}
run: |
py.test tests
pytest tests
- name: Integration tests
shell: bash -el {0}
run: |
lettuce --no-cuda convergence --use-no-cuda_native
lettuce --no-cuda benchmark --use-no-cuda_native
52 changes: 23 additions & 29 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ Resources
Getting Started
---------------

To find some very simple examples of how to use lettuce, please have a look
at the examples_. These will guide you through lettuce's main features. The
simplest example is:
To find some very simple examples of how to use lettuce, please have a look at the examples_. These will guide you through lettuce's main features. The simplest example is:

https://github.com/lettucecfd/lettuce/blob/ef9830b59c6ad50e02fdf0ce24cc47ea520aa354/examples/00_simplest_TGV.py#L6-L21

Expand All @@ -56,55 +54,51 @@ Please ensure you have Jupyter installed to run the Jupyter notebooks.
Installation
------------

* Install the anaconda or miniconda package manager from www.anaconda.org
* Create a new conda environment and activate it::
* Install the anaconda or miniconda package manager from https://www.anaconda.org

* Clone this repository from github and change to it::

git clone https://github.com/lettucecfd/lettuce
cd lettuce

* Update conda, create a new conda environment and activate it::

conda update conda
conda create -n lettuce
conda activate lettuce

* Follow the recommendations at https://pytorch.org/get-started/locally/ to
install pytorch based on your GPU's CUDA version. You may need to install
the nvidia toolkit. You may follow the instructions at https://developer
.nvidia.com/cuda-downloads. You may need to check the compatibility of your
NVIDIA driver with the desired CUDA version:
https://docs.nvidia.com/deploy/cuda-compatibility/. To get your CUDA version,
run::
* Follow the recommendations at https://pytorch.org/get-started/locally/ to install pytorch based on your GPU's CUDA version. You may need to install the nvidia toolkit. You may follow the instructions at https://developer.nvidia.com/cuda-downloads. You may need to check the compatibility of your NVIDIA driver with the desired CUDA version: https://docs.nvidia.com/deploy/cuda-compatibility/. To get your CUDA version, run::

nvcc --version

* For CUDA 12.1 (if supported by your GPU) use::

conda install pytorch pytorch-cuda=12.1 -c pytorch -c nvidia

* Install the remaining dependencies::
* Install the remaining dependencies. _This will not include CUDA-support unless you installed `pytorch-cuda`!_::

conda activate lettuce
conda install -c pytorch -c conda-forge matplotlib pytest click pyevtk mmh3 h5py scipy pandas numpy

* Clone this repository from github and change to it::
conda install --file requirements.txt -c pytorch -c nvidia -c conda-forge

git clone https://github.com/lettucecfd/lettuce
cd lettuce

* If you want to only **USE** lettuce, run the install script::

python setup.py install
* **NOTE**: Sometimes, the installation does not properly set the `CUDA_HOME` variable. In this case, you may install `cudatoolkit` and set `CUDA_HOME` to the package directory (it should containa `/bin/nvcc/` subdirectory!).

* If you are a **developer**, do this to update the lettuce package when running a script::
* If you want to only **use** lettuce, run the installation using PEP517 (from the lettuce base directory!)::

python setup.py develop
pip install --use-pep517 .

* Run the test cases::
* If you are a **developer**, add the changeable-installation-flag (`-e`)::

python setup.py test
pip install --use-pep517 -e .

* Check out the convergence order, running on CPU::

lettuce --no-cuda convergence

* For running a CUDA-driven LBM simulation on one GPU omit the `--no-cuda`.
If CUDA is not found, make sure that cuda drivers are installed and
compatible with the installed cudatoolkit (see conda install command above).
* Run the test cases::

pytest tests

* For running a CUDA-driven LBM simulation on one GPU omit the `--no-cuda`. If CUDA is not found, make sure that cuda drivers are installed and compatible with the installed cudatoolkit (see conda install command above).

* Check out the performance, running on GPU::

Expand Down
21 changes: 11 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Click>=6.0
pytorch>=2.4
numpy==1.26.4
matplotlib==3.9.0
pyevtk
pytest
h5py>=3.2.1
mmh3
packaging~=24.1
setuptools~=71.0.1
click==8.1.7
h5py==3.11.0
matplotlib==3.9.2
mmh3==4.1.0
numpy==2.1.0
packaging==24.1
pyevtk==1.6.0
pytest==8.3.2
python==3.12
pytorch==2.4
setuptools==72.1.0
17 changes: 8 additions & 9 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
pip==23.3
wheel==0.38.1
watchdog==4.0.0
coverage==4.5.1
flake8==3.5.0
pip==23.3
pyevtk==1.6.0
pytest==8.3.2
pytest-runner==4.2
sphinx==7.2.6
tox==3.14.0
coverage==4.5.1
Sphinx==7.2.6
twine==1.12.1

pytest==4.4.1
pytest-runner==4.2
pyevtk==1.1.1
watchdog==4.0.0
wheel==0.38.1
12 changes: 7 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
with open('README.rst') as readme_file:
readme = readme_file.read()

requirements = ['Click>=6.0', "torch>=2.1", "numpy==1.26.4", "matplotlib==3.9.0", "pyevtk", "h5py>=3.2.1", "mmh3"]
requirements = ["click", "h5py", "matplotlib", "mmh3", "numpy", "packaging",
"pyevtk", "pytest", "torch"]

setup_requirements = ['pytest-runner', 'pytest']

Expand All @@ -21,8 +22,7 @@
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.12',
],
description="Lattice Boltzmann Python GPU",
entry_points={
Expand All @@ -33,7 +33,10 @@
install_requires=requirements,
license="MIT license",
long_description=readme,
package_data={'lettuce.native_generator': ['lettuce/native_generator/template/setup.py']},
package_data={
'lettuce.native_generator':
['lettuce/native_generator/template/setup.py']
},
include_package_data=True,
keywords='lettuce',
name='lettuce',
Expand All @@ -55,7 +58,6 @@
'lettuce.cuda_native.ext._force',
'lettuce.util']),
setup_requires=setup_requirements,
test_suite='tests',
url='https://github.com/lettucecfd/lettuce',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
Expand Down
22 changes: 11 additions & 11 deletions tests/boundary/test_equilibrium_bc_pu.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def fix_stencil_x_moment_dims(request):
return request.param


class TestEquilibriumBoundary(EquilibriumBoundaryPU):
class DummyEquilibriumBoundary(EquilibriumBoundaryPU):

# def make_no_collision_mask(self, shape: List[int], context: 'Context'
# ) -> Optional[torch.Tensor]:
Expand Down Expand Up @@ -53,9 +53,9 @@ class DummyEQBC(TestFlow):
def boundaries(self) -> List['Boundary']:
m = self.context.zero_tensor(self.resolution, dtype=bool)
m[..., :1] = True
return [TestEquilibriumBoundary(context=self.context,
mask=m, velocity=velocity,
pressure=pressure)]
return [DummyEquilibriumBoundary(context=self.context,
mask=m, velocity=velocity,
pressure=pressure)]

flow_1 = DummyEQBC(context, resolution=fix_stencil.d * [16],
reynolds_number=1, mach_number=0.1, stencil=fix_stencil)
Expand Down Expand Up @@ -95,7 +95,7 @@ def boundaries(self):
p = 0 # self.context.zero_tensor([1, 1, 1])
m = self.context.zero_tensor(self.resolution, dtype=bool)
m[..., :1] = True
return [TestEquilibriumBoundary(
return [DummyEquilibriumBoundary(
self.context, m, u, p)]

flow_1 = DummyEQBC(context, resolution=16, reynolds_number=1,
Expand Down Expand Up @@ -140,12 +140,12 @@ class DummyEQBC(TestFlow):
def boundaries(self) -> List[Boundary]:
m = self.context.zero_tensor(self.resolution, dtype=bool)
m[..., :1] = True
return [TestEquilibriumBoundary(context=self.context,
mask=m,
velocity=self.context.
convert_to_tensor(velocity),
pressure=self.context.
convert_to_tensor(pressure))]
return [DummyEquilibriumBoundary(context=self.context,
mask=m,
velocity=self.context.
convert_to_tensor(velocity),
pressure=self.context.
convert_to_tensor(pressure))]

flow_native = DummyEQBC(context_native, resolution=16, reynolds_number=1,
mach_number=0.1, stencil=stencil)
Expand Down
Loading