Skip to content

Interfaces continuum bg#519

Open
ckarwin wants to merge 31 commits intocositools:developfrom
ckarwin:interfaces_continuum_bg
Open

Interfaces continuum bg#519
ckarwin wants to merge 31 commits intocositools:developfrom
ckarwin:interfaces_continuum_bg

Conversation

@ckarwin
Copy link
Contributor

@ckarwin ckarwin commented Mar 16, 2026

Reopening PR.

@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 87.05036% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.38%. Comparing base (4b43a59) to head (cd58f1e).

Files with missing lines Patch % Lines
...ipy/background_estimation/ContinuumEstimationNN.py 86.92% 54 Missing ⚠️
Files with missing lines Coverage Δ
cosipy/__init__.py 88.88% <100.00%> (ø)
cosipy/background_estimation/__init__.py 100.00% <100.00%> (ø)
...ipy/background_estimation/ContinuumEstimationNN.py 86.92% <86.92%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@israelmcmc israelmcmc added this to the v4.0 - DC4 milestone Mar 16, 2026
@israelmcmc israelmcmc moved this to Active / In Progress in cosipy Mar 16, 2026
@israelmcmc israelmcmc moved this from Active / In Progress to Under review in cosipy Mar 16, 2026
@israelmcmc
Copy link
Collaborator

I tracked down the issue with unit_tests_ml_macos to the fact that both pytorch and healpy are shipped with their own compiles OpenMP libraries, which end up colliding. See pytorch/pytorch#44282.

The unit test fail in the imaging deconvolution module during a call to hp.smoothing. This is a minimal reproducible example:

import torch
import healpy as hp
import numpy as np

m = np.ones(hp.nside2npix(32))
hp.smoothing(m)

I'm importing pytorch to reproduce the problem, but as you can see it's not really needed for this example. If I install both pytorch and healpy from conda, things work just find. If I install them with pip, I get:

OMP: Error #15: Initializing libomp.dylib, but found libomp.dylib already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://openmp.llvm.org/

I then tried to set KMP_DUPLICATE_LIB_OK=TRUE, but I'm getting Segmentation fault: 11.

I’ll look into the links in the pytorch issue to see if someone has a good workaround. For now, it seems that the only think that consistently works is to install both healpy and torch from conda. Which is not ideal, since it seems to me that pytorch is moving toward supporting mainly the pip installation (they don’t even mention conda in the installation instructions, and the official anaconda channel was deprecated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Under review

Development

Successfully merging this pull request may close these issues.

3 participants