Skip to content

Commit

Permalink
updating README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fschlimb committed Oct 7, 2022
1 parent 78ac247 commit 34db4a5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "third_party/bitsery"]
path = third_party/bitsery
url = https://github.com/fraillt/bitsery
[submodule "third_party/mlir-extensions"]
path = third_party/mlir-extensions
url = https://github.com/intel/mlir-extensions
38 changes: 34 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,27 @@ A tensor implementation following the [array API as defined by the data-API cons
It supports a controller-worker execution model as well as a CSP-like execution.

## Setting up build environment
``` bash
Install MLIR/LLVM and IMEX from branch refactor (see https://github.com/intel/mlir-extensions/tree/refactor).
```bash
git --recurse-submodules clone https://github.com/intel-sandbox/personal.fschlimb.ddptensor
cd personal.fschlimb.ddptensor
conda env create -f conda-env.yml -n ddpt
conda activate ddpt
export MPIROOT=$CONDA_PREFIX
export MKLROOT=$CONDA_PREFIX
export MLIRROOT=<your-MLIR-install-dir>
export IMEXROOT=<your-IMEX-install-dir>
```
## Building ddptensor
``` bash
CC=gcc-9 CXX=g++-9 CMAKE_BUILD_PARALLEL_LEVEL=8 python setup.py develop
```bash
python setup.py develop
```
If your compiler does not default to a recent version, try something like `CC=gcc-9 CXX=g++-9 python setup.py develop`

## Running Tests
``` bash
__Test are currently not operational on this branch.__

```bash
# single rank
pytest test
# multiple ranks, controller-worker, controller spawns ranks
Expand All @@ -28,3 +34,27 @@ mpirun -n $N python -m pytest test
# multiple ranks, CSP
DDPT_CW=0 mpirun -n $N python -m pytest test
```

## Running
```python
import ddptensor as dt
dt.init(False)
a = dt.arange(0, 10, 1, dt.int64)
#print(a) # should trigger compilation
b = dt.arange(0, 100, 10, dt.int64)
#print(b.dtype) # should _not_ trigger compilation
c = a * b
#print(c)
d = dt.sum(c, [0])
#del b # generated function should _not_ return b
print(a, c, d) # printing of c (not a!) should trigger compilation
dt.fini()
```
Assuming the above is in file `simple.py` a single-process run is executed like
```bash
python DDPT_IDTR_SO=`pwd`/ddptensor/libidtr.so python simple.py
```
and multi-process run is executed like
```bash
python DDPT_IDTR_SO=`pwd`/ddptensor/libidtr.so mpirun -n 5 python simple.py
```

0 comments on commit 34db4a5

Please sign in to comment.