Skip to content

Commit 601e1f0

Browse files
authored
Merge pull request #69 from DiamondLightSource/memfix
Memory fixing and reorder of pipeline dirrectives for 360deg scans
2 parents 86e498b + bbd132b commit 601e1f0

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

httomo_backends/methods_database/packages/backends/httomolibgpu/httomolibgpu.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ misc:
77
save_result_default: False
88
padding: True
99
memory_gpu:
10-
multiplier: 2.1
10+
multiplier: 2.5
1111
method: direct
1212
remove_outlier:
1313
pattern: all
@@ -16,7 +16,7 @@ misc:
1616
save_result_default: False
1717
padding: True
1818
memory_gpu:
19-
multiplier: 2.1
19+
multiplier: 2.5
2020
method: direct
2121
denoise:
2222
total_variation_ROF:
@@ -198,7 +198,7 @@ recon:
198198
save_result_default: False
199199
padding: False
200200
memory_gpu:
201-
multiplier: 0
201+
multiplier: 2
202202
method: direct
203203
find_center_pc:
204204
pattern: projection

httomo_backends/pipelines_full/deg360_distortion_FBP3d_tomobar_directive.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
- method: standard_tomo
22
module_path: httomo.data.hdf.loaders
3+
- method: find_center_360
4+
module_path: httomolibgpu.recon.rotation
35
- method: normalize
46
module_path: httomolibgpu.prep.normalize
57
- method: distortion_correction_proj_discorpy
68
module_path: httomolibgpu.prep.alignment
7-
- method: find_center_360
8-
module_path: httomolibgpu.recon.rotation
99
- method: sino_360_to_180
1010
module_path: httomolibgpu.misc.morph
1111
- method: remove_stripe_based_sorting

httomo_backends/pipelines_full/deg360_paganin_FBP3d_tomobar_directive.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
- method: standard_tomo
22
module_path: httomo.data.hdf.loaders
3-
- method: normalize
4-
module_path: httomolibgpu.prep.normalize
53
- method: find_center_360
64
module_path: httomolibgpu.recon.rotation
5+
- method: normalize
6+
module_path: httomolibgpu.prep.normalize
77
- method: sino_360_to_180
88
module_path: httomolibgpu.misc.morph
99
- method: remove_stripe_based_sorting

httomo_backends/scripts/yaml_pipelines_generator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@
3333

3434
CS = ruamel.yaml.comments.CommentedSeq # defaults to block style
3535

36+
3637
class SweepRange:
3738
"""SweepRange class."""
3839

3940
def __init__(self, start, stop, step):
4041
self._start, self._stop, self._step = start, stop, step
4142

43+
4244
def __sweeprange_representer(
4345
dumper: yaml.SafeDumper, swp: SweepRange
4446
) -> yaml.nodes.MappingNode:
@@ -52,6 +54,7 @@ def __sweeprange_representer(
5254
},
5355
)
5456

57+
5558
class SweepManual:
5659
"""SweepManual class."""
5760

tests/test_httomolibgpu.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,11 @@ def test_normalize_memoryhook(flats, darks, ensure_clean_memory, dtype, slices):
113113

114114

115115
@pytest.mark.parametrize("dtype", ["uint16"])
116-
@pytest.mark.parametrize("slices", [151, 321])
116+
@pytest.mark.parametrize("slices", [10, 20])
117117
@pytest.mark.cupy
118118
def test_remove_outlier_memoryhook(flats, ensure_clean_memory, dtype, slices):
119119
hook = MaxMemoryHook()
120-
data = cp.random.random_sample(
121-
(slices, flats.shape[1], flats.shape[2]), dtype=np.float32
122-
)
120+
data = cp.random.random_sample((slices, 2560, 2560), dtype=np.float32)
123121
if dtype == "uint16":
124122
data = data.astype(np.uint16)
125123
with hook:
@@ -148,7 +146,7 @@ def test_remove_outlier_memoryhook(flats, ensure_clean_memory, dtype, slices):
148146
# the estimated_memory_mb should be LARGER or EQUAL to max_mem_mb
149147
# the resulting percent value should not deviate from max_mem on more than 20%
150148
assert estimated_memory_mb >= max_mem_mb
151-
assert percents_relative_maxmem <= 20
149+
assert percents_relative_maxmem <= 25
152150

153151

154152
@pytest.mark.parametrize("slices", [3, 10, 20])

0 commit comments

Comments
 (0)