Skip to content

Commit

Permalink
corrections to the memory estimators
Browse files Browse the repository at this point in the history
  • Loading branch information
dkazanc committed Jul 26, 2023
1 parent 5c87b5d commit 0b6069b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions httomolibgpu/recon/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def _calc_max_slices_SIRT(
# update_term
C_R_res = C_mat + 2*R_mat
# a guess for astra toolbox memory usage for projection/backprojection
astra_size = 0.5*(x_rec+data_out)
astra_size = 2*(x_rec+data_out)

total_mem = int(data_out + x_rec + R_mat + C_mat + C_R_res + astra_size)
slices_max = available_memory // total_mem
Expand Down Expand Up @@ -224,7 +224,7 @@ def _calc_max_slices_CGLS(
Ad = 2*data_out
s = x_rec
# a guess for astra toolbox memory usage for projection/backprojection
astra_size = 0.5*(x_rec+data_out)
astra_size = 2*(x_rec+data_out)

total_mem = int(data_out + x_rec + d + r + Ad + s + astra_size)
slices_max = available_memory // total_mem
Expand Down
10 changes: 5 additions & 5 deletions tests/test_recon/test_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_reconstruct_FBP_hook(data, flats, darks, ensure_clean_memory):
max_mem,
objsize=objrecon_size)
assert estimated_slices <= actual_slices
assert estimated_slices / actual_slices >= 0.8
assert estimated_slices / actual_slices >= 0.5 # lowering because hook doesn't extend to ASTRA functions

recon_data = recon_data.get()
assert_allclose(np.mean(recon_data), 0.00079770206, rtol=1e-6)
Expand Down Expand Up @@ -127,7 +127,7 @@ def test_reconstruct_SIRT_hook(data, flats, darks, ensure_clean_memory):
max_mem,
objsize=objrecon_size)
assert estimated_slices <= actual_slices
assert estimated_slices / actual_slices >= 0.8
assert estimated_slices / actual_slices >= 0.5 # lowering because hook doesn't extend to ASTRA functions


@cp.testing.gpu
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_reconstruct_SIRT_hook2(ensure_clean_memory):
max_mem,
objsize=objrecon_size)
assert estimated_slices <= actual_slices
assert estimated_slices / actual_slices >= 0.8
assert estimated_slices / actual_slices >= 0.5 # lowering because hook doesn't extend to ASTRA functions


@cp.testing.gpu
Expand Down Expand Up @@ -213,7 +213,7 @@ def test_reconstruct_CGLS_hook(data, flats, darks, ensure_clean_memory):
objsize=objrecon_size)

assert estimated_slices <= actual_slices
assert estimated_slices / actual_slices >= 0.8
assert estimated_slices / actual_slices >= 0.5 # lowering because hook doesn't extend to ASTRA functions


@cp.testing.gpu
Expand Down Expand Up @@ -248,7 +248,7 @@ def test_reconstruct_CGLS_hook2(ensure_clean_memory):
max_mem,
objsize=objrecon_size)
assert estimated_slices <= actual_slices
assert estimated_slices / actual_slices >= 0.8
assert estimated_slices / actual_slices >= 0.5 # lowering because hook doesn't extend to ASTRA functions


@cp.testing.gpu
Expand Down

0 comments on commit 0b6069b

Please sign in to comment.