Skip to content

Commit b02e7aa

Browse files
committed
More ergonomic mem peak estimation in remove_stripe_fw
1 parent bea179d commit b02e7aa

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

httomo_backends/methods_database/packages/backends/httomolibgpu/supporting_funcs/prep/stripe.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import numpy as np
2626

2727
from httomo_backends.cufft import CufftType, cufft_estimate_1d
28-
from httomolibgpu.prep.stripe import DeviceMemStack, remove_stripe_fw
28+
from httomolibgpu.prep.stripe import remove_stripe_fw
2929

3030

3131
__all__ = [
@@ -60,9 +60,7 @@ def _calc_memory_bytes_for_slices_remove_stripe_fw(
6060
dtype: np.dtype,
6161
**kwargs,
6262
) -> Tuple[int, int]:
63-
mem_stack = DeviceMemStack()
64-
remove_stripe_fw(dims_shape, mem_stack=mem_stack, **kwargs)
65-
return mem_stack.highwater, 0
63+
return remove_stripe_fw(dims_shape, calc_peak_gpu_mem=True, **kwargs), 0
6664

6765

6866
def _calc_memory_bytes_remove_all_stripe(

tests/test_httomolibgpu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def test_remove_stripe_fw_memoryhook(slices, ensure_clean_memory):
391391
) # the amount of memory in bytes needed for the method according to memoryhook
392392

393393
# now we estimate how much of the total memory required for this data
394-
(estimated_memory_bytes, subtract_bytes) = _calc_memory_bytes_remove_stripe_fw(
394+
(estimated_memory_bytes, subtract_bytes) = _calc_memory_bytes_for_slices_remove_stripe_fw(
395395
(slices, dim_x, dim_y), dtype=np.float32()
396396
)
397397
estimated_memory_mb = round(estimated_memory_bytes / (1024**2), 2)

0 commit comments

Comments
 (0)