Roughly the required steps are:
(1) Ensure your Python environment is using your working-copy of gensim for the python & the `_inner` compiled code (typically `.so` shared-libraries) – this might involve invoking setup.py from inside your project directory, or doing a 'pip' install using a local path
(2) When your changes to the `.pyx` files seem ready, use `cython` to compile them to `.c` code. (You *might* need to do this from the root of the project, eg: `cython gensim/models/word2vec_inner.pyx`)
(3) Use the command `python ./setup.py build_ext --inplace`, from the root of your gensim directory, to compile the `.c` to shared-libraries. (Depending on how well you did step (1), you might also need to do something like `python ./setup.py install` to also install the shared-libraries elsewhere.)
(4) Run your tests, confirming especially that your changed code (and not some older or elsewhere-installed version) is being run from where you expect it. Debug & repeat (2)-(3) as necessary.
Beware that within the Cython & `nogil` sections, small bugs may cause memory-access process crashes without any useful stack traces, or subtle corruption (that isn't noticed, or doesn't cause a process-crash, until arbitrarily later). Normal Python logging/printing won't usually be available – see the Cython docs for alternatives. You may need to use `gdb` or similar to get a better view of error-conditions.
Hope this helps. Good luck!
- Gordon