Skip to content

Commit

Permalink
tests readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lkct committed Sep 6, 2022
1 parent fd9ce2f commit ff5a929
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## tests and utils

This is intended for development and includes unit tests and profiling utils. The code relies on a proper version of SpikeInterface with hs-detection integrated.

The test on correctness is performed using a small dataset, the same as the one used in SI tests. The identical results compared to HS2 are not enforced due to behaviour differences, but could be helpful in development.

The performance profiling uses different profiler packages and produces different kinds of reports. The `PROFILE` flag in [setup.py](../setup.py#L33) should be set properly for Cython profiling: 0 to turn off, 1 to profile function calls, and 2 to profile line traces.

The script [useful.sh](./useful.sh) contains some command lines useful to development, and are used to inspect and optimize.

The code in [cpp_mode](./cpp_mode) builds to a pure C++ program running the detection algorithm. Without the Python overhead, it's easier to profile performance bottlenecks in detail. In the Dissertation, the Intel Vtune Profiler is employed to perform event-based profiling.
13 changes: 13 additions & 0 deletions tests/useful.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# all in repo root dir

# rebuild c++ code only
python setup.py build_ext -i -f

# recuild cython, -a for annotated report, -Wextra for all warnings
cython -a -3 --cplus -Wextra detect.py

# inspect asm code of main detection loops
objdump -S -r -M intel --insn-width 8 build/temp.linux-x86_64-cpython-39/hs_detection/detect/Detection.o > Detection.s

# profile with Intel Vtune
vtune -collect hotspots --app-working-dir=. -- python tests/test_run.py 10

0 comments on commit ff5a929

Please sign in to comment.