Skip to content

Commit d62f61b

Browse files
authored
Refactor README for clarity and organization
Updated README.md to improve formatting and structure. (changes in build rules and LLVM recomandations)
1 parent 9f57c0e commit d62f61b

File tree

1 file changed

+69
-37
lines changed

1 file changed

+69
-37
lines changed

README.md

Lines changed: 69 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
![Nouveau projet](https://github.com/user-attachments/assets/5f75f1f9-999d-410b-971e-ba3bd5e8b5e9)
22
# Tensorium_lib
3-
### !!!DISCLAMER!!!
3+
> !!!DISCLAMER!!!
44
Tensorium_lib is still in the early development phase, and many of its features work, but I'm not yet convinced of the solidity of some of them (especially the tensor manipulations).
55
The python binding is usable without any other python librairy, but I'm still working on it to make it all clean and usable using a simple pip3 install (see the Jupiter Notebook).
66

77
**Tensorium_lib** is a high-performance scientific C++ library designed for demanding computational domains such as **numerical relativity**, **machine learning (ML)**, **deep learning (DL)** and general **scientific simulations**.
88

9-
Here is the full documentation : https://tensoriumcore.github.io/Tensorium_lib/
9+
## Documentation
1010

11+
> Here is the full documentation : https://tensoriumcore.github.io/Tensorium_lib/
12+
13+
## Highlight
1114
It provides a modern, extensible infrastructure for efficient vector, matrix, and tensor computations by leveraging:
1215
- **SIMD acceleration** (SSE, AVX2, AVX512),
1316
- **Multithreading** with OpenMP,
@@ -24,6 +27,70 @@ This library is built with the goal of empowering projects that require both spe
2427
- Fast manipulation of large scientific datasets and image matrices (not atm),
2528
- Research and education projects needing intuitive yet high-performance numerical tools.
2629

30+
## Requirements
31+
32+
> **Recommended:** build and use with **LLVM/Clang** for maximum performance.
33+
34+
### Core Dependencies
35+
- **C++17/20 compiler** with `AVX2` / `FMA` support
36+
`AVX512` is automatically detected and enabled if available
37+
→ Recommended: **Clang ≥ 17** or **LLVM ≥ 20**
38+
- **OpenMP** (`fopenmp`)
39+
- **MPI** (for distributed parallelism)
40+
- **libmemkind-dev** *(required only for Intel Xeon Phi Knight Landing CPUs)*
41+
- **CMake ≥ 3.16**
42+
- **Python ≥ 3.10** (for Python bindings)
43+
- **pybind11**
44+
- Arch Linux: `sudo pacman -S python-pybind11`
45+
- Other: `pip install pybind11 --user`
46+
- **OpenBLAS** *(optional)* — used for benchmarking against BLAS kernels
47+
48+
---
49+
## Build Instructions
50+
51+
### Recommended LLVM/Clang Toolchain
52+
53+
If you want the best performance, use **LLVM/Clang 20+**.
54+
55+
### Install LLVM/Clang (example for Linux)
56+
57+
```bash
58+
# Clone the official LLVM project
59+
git clone https://github.com/llvm/llvm-project.git
60+
cd llvm-project
61+
mkdir llvm-build-release && cd llvm-build-release
62+
63+
# Configure the build
64+
cmake -G Ninja ../llvm \
65+
-DCMAKE_BUILD_TYPE=Release \
66+
-DLLVM_ENABLE_PROJECTS="clang;mlir;lld;lldb;openmp" \
67+
-DLLVM_TARGETS_TO_BUILD="X86;AArch64;NVPTX" \
68+
-DLLVM_ENABLE_RTTI=ON \
69+
-DCMAKE_INSTALL_PREFIX=/opt/llvm-20
70+
71+
# Build & install
72+
ninja -j$(nproc)
73+
sudo ninja install
74+
```
75+
Then you can compile the Tensorium_lib. If you want to use it on your own projects, simply change the Test rule to Srcs (or another) and set the recommended options in the CmakeLists.txt file in the `
76+
Tests` folder, or add a src rule and create a src folder :
77+
then
78+
```cmake
79+
###inside the main CmakeLists.txt
80+
if(BUILD_SRCS)
81+
add_subdirectory(SRCS)
82+
endif()
83+
```
84+
### Build the lib
85+
86+
```bash
87+
git clone https://github.com/TensoriumCore/Tensorium_lib.git && cd Tensorium_lib
88+
mkdir build && cd build
89+
cmake .. (options if you need, a documentation is comming soon)
90+
make -j
91+
```
92+
The Python module will be created as a .so file in the pybuild/ directory.
93+
2794
## Highlights
2895
2996
- Optimized `Tensor`, `Vector` and `Matrix` classes with aligned memory
@@ -45,43 +112,8 @@ This library is built with the goal of empowering projects that require both spe
45112
- Some (several) optimizations
46113
- Plug Tensorium_MLIR and externalize Compiler plugins (subdependencies)
47114
- ARM support
48-
## Build Instructions
49115
50-
### Requirements
51-
- !!! USE CLANG/LLVM if you want to use the max performances of this lib !!!
52-
- C++17/20 compiler with AVX2/FMA support or AVX512 if avalaible on your plateform (Intel compilers will be added later)
53-
- fopenmp
54-
- MPI
55-
- libmemkind-dev (if you are using Xeon Phi knight landing CPU)
56-
- CMake ≥ 3.16
57-
- Python ≥ 3.10 (for Python bindings)
58-
- `pybind11` installed (`pacman -S python-pybind11` on Arch, or `pip install pybind11 --user`)
59-
- OpenBLAS (optional, for benchmarking with BLAS)
60116
61-
## Build over Nix for pythton binding
62-
63-
```bash
64-
./build_linux.sh && pip install --user -e .
65-
```
66-
if you are on Macos :
67-
```bash
68-
nix --extra-experimental-features 'nix-command flakes' develop && ./build_macos && pip install --user -e .
69-
```
70-
71-
Then you can use it as the .ipynb show
72-
### Build C++ only for special targets and options
73-
74-
```bash
75-
make # Default AVX2
76-
make help # Show differents compile options
77-
make AVX512=true # AVX512
78-
make USE_KNL=true # MCDRAM Memkind HBW (Xeon phi KNL)
79-
make DEBUG=true # debug symbols
80-
make VERBOSE=true # VERBOSE log
81-
make benchmark # BLAS vs Tensorium mat_mult benchmark
82-
```
83-
84-
The Python module will be created as a .so file in the pybuild/ directory.
85117
### Exemple using in C++
86118
```cpp
87119
#include "Tensorium.hpp"

0 commit comments

Comments
 (0)