Commit 38eecd2
distance slices: cupy-safe export (GPU runs were silently skipping every binary)
On a GPU run (--gpu/--force-xpy) the sampler stores CUPY arrays in _rvs and the
cached likelihood returns cupy. The .dslice export did plain numpy on them
(np.array(sampler._rvs["distance"]) etc.), so cupy raised "Implicit conversion to
a NumPy array is not allowed". That throw happens inside analyze_event, so ILE
caught it, printed the MISLEADING generic hint "Probable reasons: SEOB nyquist
..." + "Skipping the following binary!", and skipped EVERY binary at the extrinsic
stage -> all_dslice.dat empty (and consolidate --allow-empty masked it). Intrinsic
iterations never run the export, so they were clean -- the symptom was "only the
extrinsic ILE barfed" on the same binaries.
Fix: convert cupy -> numpy at the boundary.
- ILE dslice block: read _rvs / pdf outputs through the module-level
identity_convert (= cupy.asnumpy, or no-op without cupy): distance, log_weights,
log_integrand, joint_prior/joint_s_prior (+ log_ variants), integrand, the
sampler pdf/prior_pdf evaluations, and prior_pdf_d(d_all).
- distance_slices.py: add _to_cpu() helper; apply to every sampler._rvs read in
_ln_omega_iw_factor and importance_reweight_slices, to the cached-likelihood
return in importance_reweight_slices and fresh_sample_slices. Pure-numpy callers
(the CPU path, unit tests) are unaffected.
Affects both core+wing and all-fresh. A CPU smoke test passes even while broken,
so this MUST be validated on GPU (done separately). Re-verified the CPU all-fresh
smoke test still writes a 6-row .dslice.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 91e78c5 commit 38eecd2
2 files changed
Lines changed: 38 additions & 15 deletions
File tree
- MonteCarloMarginalizeCode/Code
- RIFT/misc
- bin
Lines changed: 24 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
35 | 50 | | |
36 | 51 | | |
37 | 52 | | |
| |||
105 | 120 | | |
106 | 121 | | |
107 | 122 | | |
108 | | - | |
109 | | - | |
| 123 | + | |
| 124 | + | |
110 | 125 | | |
111 | 126 | | |
112 | 127 | | |
113 | 128 | | |
114 | | - | |
115 | | - | |
| 129 | + | |
| 130 | + | |
116 | 131 | | |
117 | 132 | | |
118 | 133 | | |
| |||
159 | 174 | | |
160 | 175 | | |
161 | 176 | | |
162 | | - | |
| 177 | + | |
163 | 178 | | |
164 | 179 | | |
165 | 180 | | |
| |||
173 | 188 | | |
174 | 189 | | |
175 | 190 | | |
176 | | - | |
| 191 | + | |
177 | 192 | | |
178 | 193 | | |
179 | 194 | | |
| |||
435 | 450 | | |
436 | 451 | | |
437 | 452 | | |
438 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
439 | 456 | | |
440 | 457 | | |
441 | 458 | | |
| |||
Lines changed: 14 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2632 | 2632 | | |
2633 | 2633 | | |
2634 | 2634 | | |
2635 | | - | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
2636 | 2641 | | |
2637 | 2642 | | |
2638 | 2643 | | |
2639 | | - | |
| 2644 | + | |
2640 | 2645 | | |
2641 | 2646 | | |
2642 | 2647 | | |
| |||
2647 | 2652 | | |
2648 | 2653 | | |
2649 | 2654 | | |
2650 | | - | |
| 2655 | + | |
2651 | 2656 | | |
2652 | 2657 | | |
2653 | 2658 | | |
| |||
2658 | 2663 | | |
2659 | 2664 | | |
2660 | 2665 | | |
| 2666 | + | |
2661 | 2667 | | |
2662 | | - | |
| 2668 | + | |
2663 | 2669 | | |
2664 | | - | |
| 2670 | + | |
2665 | 2671 | | |
2666 | | - | |
2667 | | - | |
| 2672 | + | |
| 2673 | + | |
2668 | 2674 | | |
2669 | 2675 | | |
2670 | 2676 | | |
| |||
2760 | 2766 | | |
2761 | 2767 | | |
2762 | 2768 | | |
2763 | | - | |
| 2769 | + | |
2764 | 2770 | | |
2765 | 2771 | | |
2766 | 2772 | | |
| |||
0 commit comments