Commit 356f73d
authored
Fix hotspots dask performance: 2-pass streaming with O(chunk_size) memory (#855)
Rewrite _hotspots_dask_numpy to eliminate the global barrier that forced
materialization of the full intermediate convolution output. The old
implementation created a task graph where every chunk's z-score depended
on both the per-chunk convolution and global reductions over ALL chunks,
making it infeasible for datasets larger than RAM.
New approach:
- Pass 1: eagerly compute global_mean/global_std (two scalars, single
co-scheduled graph traversal via da.compute)
- Pass 2: fuse convolution + z-score + classification into one
map_overlap call, so each chunk streams through independently
Also fixes: redundant astype calls, pointwise map_overlap misuse,
separate nanmean/nanstd accumulation, and re-enables zero-std check.1 parent e1370ef commit 356f73d
1 file changed
+41
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
938 | 938 | | |
939 | 939 | | |
940 | 940 | | |
941 | | - | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
942 | 952 | | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
949 | | - | |
950 | | - | |
951 | | - | |
952 | | - | |
953 | | - | |
954 | | - | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
955 | 957 | | |
956 | | - | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
957 | 978 | | |
958 | | - | |
959 | | - | |
960 | | - | |
961 | 979 | | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
967 | 985 | | |
968 | 986 | | |
969 | 987 | | |
| |||
0 commit comments