Repository navigation
SPECTGPU - #1687
SPECTGPU#1687danieldeidda wants to merge 39 commits into
Conversation
…eton classe, atm a lot of copy from niftyGPU
…calls the kernels; we need to double check that the kernel can write into the sino but probably we need to dodevice_to_host(stir_sino,cuda_array_created_by_forward)
… that calls the kernels; we need to double check that the kernel can write into the sino but probably we need to dodevice_to_host(stir_sino,cuda_array_created_by_forward)
addition of wrappers for actual_FP/BP removal of most of helper currently FP and BP work pretty well and are very close to spectUB rough speed estimate on debug mode were: SPECTUB 3min36s SPECTGPU 20s 3x3x3 gaussian kernel was fine for FP but introduced holes artifact in BP it was necessary to change the kernel to a 5x5x7 with sigma 2 to make a BPimage very close to SPECTUB. Speed above is related to 5x5x7.
addition of wrappers for actual_FP/BP removal of most of helper currently FP and BP work pretty well and are very close to spectUB rough speed estimate on debug mode were: SPECTUB 3min36s SPECTGPU 20s 3x3x3 gaussian kernel was fine for FP but introduced holes artifact in BP it was necessary to change the kernel to a 5x5x7 with sigma 2 to make a BPimage very close to SPECTUB. Speed above is related to 5x5x7.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 65 |
| Duplication | 15 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
adapted PairProjectorByBinUsingSPECTGPU to be able to run reconstruction
|
Hi. looks like great progress! Obviously, I'm interested to know some timings :-)
no, we don't. The SPECTUB projector backprojector is adjoint (as it uses the matrix), so has the correct scale. |
|
I thought there was some scaling in SPECTUB as I always need to multiply by the number of views to get images in the right scale. Anyway in debug mode with no OMP around 300s 2 iterations fully 3D PSF and AC I am reconstructing with SPECTUB now but it's been running for a while and not finished the first iter yet. GPU recon with no correction is 90 s and 160s only AC |
Added Hei Yin Jowett Chan as an author to the file.
pdate authorship
Jowett: Revert authorship added to the wrong file
|
interesting. only with OMP? I think it's indeed the case that the There's various issues here:
I guess the last one is the main one. |
|
Yes that's it! I think that is because the image needs to be updated as the function is called for every view. But then I should copy outside of this call maybe in start_accumulating and free in get_output? so that the BP just updates the output image |
|
See also #1768 (comment) |
|
The .cu side is responsible for alloc ( |
|
yeah, but..
Either way, there seems to be little advantage now of having As it caused problems for @vcosmi as well (he needed to guard with Unless @casperdcl has a safe way of doing this after all. |
… a AllocatedStack structure was created: - all the allocations happen at setup so that in the loop we only initialise and assigne values. this has significantly speeded up performonce. - all arrays are now CuVec but at the end of the reconstruction we still have a free problem. The structure has a sestructor that calls resize(0) for all the cuvecs but the error is still there
… a AllocatedStack structure was created: - all the allocations happen at setup so that in the loop we only initialise and assigne values. this has significantly speeded up performonce. - all arrays are now CuVec but at the end of the reconstruction we still have a free problem. The structure has a sestructor that calls resize(0) for all the cuvecs but the error is still there - the new stack structure create some race problem when using OMP because many threads where accessing the same object, so a thread_local AllocatedStack was used for everythread in the BP part given that each thread contribute to the the same image it was also necessary to add an accumulation step as critical section, so a kernel for arrays accumulation was created; updated timing given that spectUB becomes really fast once the matrix is created: SPECTUB 2 iter 231 s (223 matrix + 4.2 s per full iter) SPECTGPU 2 iter: 8.7s (6.4 matrix + 2.3 per full iter)
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| BestPractice | 1 medium |
| ErrorProne | 2 high |
| CodeStyle | 3 minor |
🟢 Metrics 98 complexity · 25 duplication
Metric Results Complexity 98 Duplication 25
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
I guess I will put a comment because from the commit it's a bit weird to read:
@casperdcl maybe have a look at my resize(0) destructor to see if I misinterpreted your comment. |
creating OSMAPOSL and PpoissonLogLikelihood tests (these are running with the caveat that i had to make epsilon for the hessian product with input 0.001)
KrisThielemans
left a comment
There was a problem hiding this comment.
some changes in cuda_utilites for cuvec, which you're no longer using of course, but best to add them in anyway
KrisThielemans
left a comment
There was a problem hiding this comment.
some comments. mostly house-keeping.
I'm still a bit puzzled by the threading and GPU interaction, but need to do other things...
general clean up; moving cu_allocate and cu_free into cuda utilities; adressing all comments
|
@KrisThielemans I think I am done |
all tests are failing, so I guess not yet :-/ did you add the |
KrisThielemans
left a comment
There was a problem hiding this comment.
we have src/buildblock/cuda_utilities.cu and src/buildblock/CUDA/cuda_utilities.cu
I thought i did bu maybe not everywher. will need to check |
…g recontest data due to previous bag in setting number of sigma incorrectly; fixing test error for SPECTUB
|
Compiling fine, but SPECTUB test segfaulting. Do you have the same problem when running it locally? |
I actually never run it till the end, because is quite slow but running now and getting some difference in the gradient test |
it is giving seg fault locally too |
|
i found why the segfault happens but the issue will still be that the gradient test does not pass |







…eton classe, atm a lot of copy from niftyGPU
Changes in this pull request
Testing performed
Related issues
Checklist before requesting a review
documentation/release_XXX.mdhas been updated with any functionality change (if applicable)Contribution Notes
Please tick the following: