Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
eaa4269
Fix ard-seq unit tests
Dantali0n Mar 6, 2024
ce36a4f
Upgrade required OpenCL tot 2.2
Dantali0n Mar 6, 2024
3503fbf
FFTW plan before copying data
Dantali0n Mar 6, 2024
01209fe
Test entire output
Dantali0n Mar 6, 2024
dc25be9
Update OpenCL header and version referencing method
Dantali0n Mar 6, 2024
ed175e4
Update objcopy example
Dantali0n Mar 6, 2024
8ce33d1
Update python reference naming
Dantali0n Mar 6, 2024
c1796da
Move wav and csv to git lfs
Dantali0n Mar 6, 2024
28a5396
Support quick iterations and csv output for flk-ocl and flk-ocl-fp32
Dantali0n Mar 7, 2024
cda9437
Document new versions
Dantali0n Mar 7, 2024
cbd4271
5700xt results for fp32
Dantali0n Mar 7, 2024
f62dd9c
Optimize local placement for flk-ocl-fp32 kernels
Dantali0n Mar 7, 2024
a82e89f
Verify operational bounds of parameters
Dantali0n Mar 7, 2024
ddcf86c
Update performance results for new version
Dantali0n Mar 8, 2024
fc72762
Use threads for FFTW and optimize bit_reverse placement
Dantali0n Mar 8, 2024
7c9259d
Start quantization of FFT error
Dantali0n Mar 26, 2024
e3ce49f
Arbitrary precision Random Number Generator
Dantali0n Mar 27, 2024
01d508f
Migrate from shell to docker runner
Dantali0n Mar 29, 2024
a521e5a
Test noexecstack linker argument
Dantali0n Mar 29, 2024
6ce39a0
Try using pocl for tests
Dantali0n Mar 29, 2024
52d4d68
Add test release job
Dantali0n Mar 29, 2024
e7c4d6a
Print release notes during generation job
Dantali0n Mar 29, 2024
1d0676c
Rms error random number arbitrary precision
Dantali0n Apr 10, 2024
e2611d1
Merge branch 'rms-error-random-number' into 'master'
Dantali0n Apr 10, 2024
2851a9b
Update .gitlab-ci.yml
Dantali0n Apr 10, 2024
7817b6b
Override release working directories pipeline
Dantali0n Apr 10, 2024
e33714d
Change measurement csv header to prevent pandas leading space
Dantali0n Aug 2, 2025
37c75cc
Separate new and old python files
Dantali0n Aug 2, 2025
1f9a571
Update CMake for new boost include method
Dantali0n Aug 2, 2025
7da02c0
Support not wait for queue finish
Dantali0n Aug 2, 2025
23dfa47
Add hipFFT measurements and version
Dantali0n Aug 2, 2025
9270896
Starting working on numerical analysis
Dantali0n Oct 2, 2025
14e0da5
Bump wavefront limit
Dantali0n Oct 2, 2025
e594d17
Document rocprof arguments
Dantali0n Oct 2, 2025
9196e3d
LFS track pftraces
Dantali0n Oct 2, 2025
c85a929
Add rocprof counters
Dantali0n Oct 2, 2025
98092b1
Improve instructions and perfetto image
Dantali0n Oct 8, 2025
0dfee44
Compare apfft and flk-ocl-fp32
Dantali0n Oct 9, 2025
82fc70d
Fix broken l norm math
Dantali0n Oct 9, 2025
3e2548c
Measurements performed
Dantali0n Oct 12, 2025
a26a008
Numerical analysis
Dantali0n Oct 22, 2025
7a53f72
Quantify linf norm
Dantali0n Oct 30, 2025
90524f7
Document FFT numerical error paper in readme
Dantali0n Oct 31, 2025
342bf7d
Add new numerical error graph
Dantali0n Oct 31, 2025
642902d
Fix error axis labels
Dantali0n Oct 31, 2025
dba04f2
Conclude numerical analysis!
Dantali0n Oct 31, 2025
587342c
Fix pipeline
Dantali0n Oct 31, 2025
5c6a13f
Run all tests and force build
Dantali0n Nov 17, 2025
7e7e56f
Dependencies for hipfft in Dockerfile
Dantali0n Oct 31, 2025
08db554
Docker cache image properly
Dantali0n Oct 31, 2025
9f35650
Fix docker directory
Dantali0n Oct 31, 2025
46c6a20
Fix build maybe
Dantali0n Nov 2, 2025
cd86098
Change rms target to numerical-analysis
Dantali0n Nov 16, 2025
3445ae7
install all the LaTeX
Dantali0n Nov 16, 2025
60bc33a
Add dependencies
Dantali0n Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
csv/xpa2.csv filter=lfs diff=lfs merge=lfs -text
csv/acars.csv filter=lfs diff=lfs merge=lfs -text
csv/ads-b.csv filter=lfs diff=lfs merge=lfs -text
csv/flex.csv filter=lfs diff=lfs merge=lfs -text
csv/jorn.csv filter=lfs diff=lfs merge=lfs -text
csv/lofar-20m-x.csv filter=lfs diff=lfs merge=lfs -text
csv/test-reverse.csv filter=lfs diff=lfs merge=lfs -text
csv/xpa1.csv filter=lfs diff=lfs merge=lfs -text
wav/lofar-20m-x.wav filter=lfs diff=lfs merge=lfs -text
wav/xpa1-8000.wav filter=lfs diff=lfs merge=lfs -text
wav/acars1-iq-48000.wav filter=lfs diff=lfs merge=lfs -text
wav/dvb-t-iq-5333333.wav filter=lfs diff=lfs merge=lfs -text
wav/flex-iq-39062.wav filter=lfs diff=lfs merge=lfs -text
130 changes: 107 additions & 23 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,77 @@
image: $CI_REGISTRY_IMAGE/ci-build-runner:$CI_COMMIT_REF_SLUG
variables:
GIT_SUBMODULE_STRATEGY: recursive

stages:
- prepare
- build-lib
- build
- test
- release

include:
- template: Security/SAST.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml

default:
before_script:
- mkdir -p build
- cd build || exit
cache:
paths:
- "build/*"

trigger-prepare:
stage: prepare
trigger:
strategy: depend
include: .prepare.gitlab-ci.yml

prepare-release:
stage: prepare
image: alpine:latest
rules:
- if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"'
before_script:
- apk add curl jq
script:
- 'curl -H "PRIVATE-TOKEN: $CI_API_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/repository/changelog?version=$CI_COMMIT_TAG" | jq -r .notes > release_notes.md'
- cat release_notes.md
artifacts:
paths:
- release_notes.md

build-library:
stage: build-lib
needs:
- trigger-prepare
script:
- cd $CI_PROJECT_DIR
- mkdir -p build
- cd build || exit
- cmake ..
- make oCLFFTsup -j $(nproc)
artifacts:
paths:
- build/lib/liboCLFFTsup.so
cache:

build-lookup:
stage: build-lib
needs:
- trigger-prepare
script:
- cmake ..
- make play-lookup play-lookup-fp32
- ./playground/play-lookup > ../oclfft/ard-ocl/src/lookup.cl
- ./playground/play-lookup > ../oclfft/bit-ocl/src/lookup.cl
- ./playground/play-lookup > ../oclfft/flk-ocl/src/lookup.cl
- ./playground/play-lookup-fp32 > ../oclfft/flk-ocl-fp32/src/lookup.cl
artifacts:
paths:
- "build/*"
- oclfft/**/lookup.cl

build-documents:
stage: build
needs:
- trigger-prepare
script:
- cd $CI_PROJECT_DIR/proposal || exit
- texi2pdf proposal.tex
Expand All @@ -26,40 +80,70 @@ build-documents:
artifacts:
paths:
- "*/*.pdf"

build-documentation:
stage: build
needs:
- trigger-prepare
script:
- cd $CI_PROJECT_DIR
- mkdir -p build
- cd build || exit
- cmake -DENABLE_DOXYGEN=on ..
- make doxygen
artifacts:
paths:
- "docs/*"

build-binaries:
stage: build
needs:
- trigger-prepare
- build-lookup
- build-library
script:
- cd $CI_PROJECT_DIR || exit
- mkdir -p build
- cd build || exit
- cmake -DENABLE_DOXYGEN=off ..
- make -j $(nproc)
- make ard-ocl
- make ard-omp
- make ard-seq
- make bit-ocl
- make dft-seq
- make dft-seq-fp32
- make flk-ocl
- make flk-ocl-fp32
- make numerical-analysis
- make play-objcopy
- make play-example
- make play-reversegen
artifacts:
paths:
- "*/**/play-objcopy"
- "*/**/play-example"
- "*/**/testexample"
cache:
paths:
- "build/*"

test:
stage: test
needs:
- trigger-prepare
- build-lookup
- build-library
- build-binaries
variables:
CTEST_OUTPUT_ON_FAILURE: 1
script:
- cd $CI_PROJECT_DIR || exit
- mkdir -p build
- cd build || exit
- make test
cache:
paths:
- "build/*"
- make run_tests

release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
environment: gitlab-releases
needs:
- job: prepare-release
artifacts: true
rules:
- if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"'
before_script:
- echo "Creating release ${CI_COMMIT_TAG}"
script:
- cat release_notes.md
release:
name: '${CI_COMMIT_TAG}'
description: release_notes.md
tag_name: '${CI_COMMIT_TAG}'
ref: '$CI_COMMIT_SHA'
21 changes: 21 additions & 0 deletions .prepare.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
stages:
- build

build_ci_runner_image:
stage: build
image: docker:latest
tags:
- dind
before_script:
- apk add yq
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker context create my-builder
- docker buildx create my-builder --driver docker-container --use
- docker buildx build --push -t $CI_REGISTRY_IMAGE/ci-build-runner:$CI_COMMIT_REF_SLUG --cache-to type=registry,ref=$CI_REGISTRY_IMAGE/ci-build-runner-cache:$CI_COMMIT_REF_SLUG,mode=max --cache-from type=registry,ref=$CI_REGISTRY_IMAGE/ci-build-runner-cache:$CI_COMMIT_REF_SLUG docker/



workflow:
rules:
- when: always
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
PROJECT(oCLFFT)

# 3.0 is minimum version as it is the first version to include FindOpenCL
Expand Down Expand Up @@ -43,16 +43,16 @@ use_cxx_warning_pedantic()
# Configurable options and defaults
OPTION(ENABLE_TESTS "Enable unit tests" ON)
OPTION(ENABLE_CODECOV "Measure code coverage" OFF)
OPTION(ENABLE_DOXYGEN "Generate documentation" ON)
OPTION(ENABLE_DOXYGEN "Generate documentation" OFF)
OPTION(ENABLE_CI "Enable continuous integration" OFF)

include_directories(${CMAKE_SOURCE_DIR}/lib/include)
#include_directories(${CMAKE_SOURCE_DIR}/lib/include)

# Required packages
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
find_package(OpenCL 2.0 REQUIRED)
find_package(OpenCL 2.2 REQUIRED)

# Include Commonly required headers
# include_directories(${ZeroMQ_INCLUDE_DIR})
Expand Down Expand Up @@ -89,8 +89,8 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3 -O0")
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
message("${PRJ_PRX}: Enabling extensive optimizations")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Ofast -ffast-math -ftree-vectorize")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Ofast -ffast-math -ftree-vectorize")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -O3 -ftree-vectorize")
endif()

# Commonly shared library
Expand Down
64 changes: 48 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Project for University of Amsterdam (UvA) performance engineering course,
boilerplate CMake files are from
[a previous project](https://github.com/hexoxide/O2-Balancer2)

![Performance results on Ryzen 5900X & Radeon 5700XT](measurements/results-march-2024-cpu-vs-gpu.png)

![Numerical error comparison](numerical-analysis/fft-numerical-analysis-2025-10-30.png)

### Directory structure

* cmake - small cmake snippets to enable various features
Expand All @@ -13,6 +17,7 @@ boilerplate CMake files are from
* lib - support library with functions and definitions
* measurements - performance evaluation scripts as well as measured values
* midterm - LaTeX files for the presentation at the first half of the course
* numerical-analysis - Results and measurements to determine numerical error
* playground - small toy examples or other experiments
* [python](python/README.md) - python scripts to aid in visualization or measurements
* proposal - LaTeX source for project proposal
Expand All @@ -23,31 +28,44 @@ boilerplate CMake files are from

### Implementations

| Executable | Hardware Target | Base Algorithm | Properties |
|------------|-------------------|----------------|-------------------------------|
| ard-seq | CPU Single Thread | Cooley-Tukey | Bit-reversal in-place radix-2 |
| dft-seq | CPU Single Thread | DFT | |
| ard-omp | CPU OpenMP | Cooley-Tukey | Bit-reversal in-place radix-2 |
| ard-ocl | GPU | Cooley-Tukey | Slow bit-reversal, fft lookup |
| bit-ocl | GPU | Cooley-Tukey | 2D bit-reversal, fft lookup |
| flk-ocl | GPU | Cooley-Tukey | 2D bit-reversal, fast lookup |
| Executable | Hardware Target | Base Algorithm | Precision | Properties |
|--------------------|-------------------|----------------|--------------|------------------------------------------------------------|
| ard-seq | CPU Single Thread | Cooley-Tukey | 64bit double | Bit-reversal in-place radix-2 |
| dft-seq | CPU Single Thread | DFT | 64bit double | |
| dft-seq-fp32 | CPU Single Thread | DFT | 32bit float | |
| ard-omp | CPU OpenMP | Cooley-Tukey | 64bit double | Bit-reversal in-place radix-2 |
| ard-ocl | GPU | Cooley-Tukey | 64bit double | Slow bit-reversal, fft lookup |
| bit-ocl | GPU | Cooley-Tukey | 64bit double | 2D bit-reversal, fft lookup |
| flk-ocl | GPU | Cooley-Tukey | 64bit double | 2D bit-reversal, fast lookup |
| flk-ocl-fp32 | GPU | Cooley-Tukey | 32bit float | 2D bit-reversal, fast lookup, optimized local groups |
| numerical-analysis | CPU/GPU | N.A | arbitrary | Arbitrary precision MPFR FFR, compute L1,L2 and Linf norms |

#### Dependencies

* cmake 3.0 or higher
* cmake 3.9 or higher (ard-omp)
* doxygen (documentation)
* cmake 3.10 or higher
* boost 1.32 or higher
* boost 1.53 or higher (unit tests)
* OpenCL 2.0 or higher
* OpenCL C++ headers
* MPFR
* MPFR C++, MPREAL (rms-error)
* doxygen (documentation)
* python 3.x (python)
* virtualenv (python)

#### Setup

Initialize lfs:

```bash
git lfs install
git lfs checkout
```

Python environment:

```bash
virtualenv -p python3 python/e
virtualenv -p python3 python/
cd python
source bin/activate
pip install -r requirements.txt
Expand All @@ -58,11 +76,14 @@ Generating lookup tables:
```bash
mkdir build
cd build
cmake ..
cmake -DCMAKE_BUILD_TYPE=Release ..
make play-lookup
./playground/play-lookup > ../oclfft/ard-ocl/src/lookup.cl
./playground/play-lookup > ../oclfft/bit-ocl/src/lookup.cl
./playground/play-lookup > ../oclfft/flk-ocl/src/lookup.cl
make play-lookup-fp32
./playground/play-lookup-fp32 > ../oclfft/flk-ocl-fp32/src/lookup.cl
make
```

#### Licensing
Expand All @@ -81,13 +102,24 @@ A few examples of files licensed under different authors:

* [Emebedding source files into binaries](https://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967)
* [OpenCL, SyCL and SPIR-V progress 2016](https://www.youtube.com/watch?v=TYp1d6yzHUQ)
* [RDNA whitepaper](https://www.amd.com/system/files/documents/rdna-whitepaper.pdf)
* Arbitrary Precision Arithmetic (FFTs)
* [Python Arbitrary Precision FFT](https://github.com/dbstein/apfft/tree/master)
* [C++ Arbitrary Precision Arithmetic](https://github.com/anxieuse/Arbitrary-precision-arithmetic/tree/main)
* [BenchFFT](https://fftw.org/benchfft/)
* [RRMSE](https://stats.stackexchange.com/questions/413209/is-there-something-like-a-root-mean-square-relative-error-rmsre-or-what-is-t#413217)

#### Snippets

```bash
../cmake-build-debug/oclfft/bit-ocl/bit-ocl -f ../csv/ads-b.csv -s 262144 -o real | python evaluate-error.py
cd python
../cmake-build-debug/oclfft/flk-ocl-fp32/flk-ocl-fp32 -w 256 -f ../csv/lofar-20m-x.csv -s 4194304 -o real | python evaluate-error.py
```

```bash
/opt/rocm/bin/rocprof --obj-tracking on --hsa-trace binary
```
/opt/rocm/bin/rocprofv3 --obj-tracking on --hsa-trace binary
rocprofv2 --sys-trace --kernel-trace --plugin perfetto -o results.json binary
rocprofv3 -r -s --output-format pftrace -i ../counters.txt -- oclfft/flk-ocl-fp32/flk-ocl-fp32 -w 256 -f ../csv/lofar-20m-x.csv -s 4194304 -o TIME
```

Open pftrace in https://ui.perfetto.dev
Loading