|
36 | 36 | "/opt/nemo_rl_venv/lib/python3.*/site-packages/_soundfile_data/libsndfile_*.so", |
37 | 37 | "/opt/ray_venvs/*/lib/python3.*/site-packages/_soundfile_data/libsndfile_*.so", |
38 | 38 | "/opt/uv_cache/archive-v0/*/_soundfile_data/libsndfile_*.so", |
| 39 | + # The shim is removed with the codec; see docker/rl/codec-file-removals.txt for why |
| 40 | + # keeping it is worse than not shipping soundfile at all. |
| 41 | + "/opt/nemo_rl_venv/lib/python3.*/site-packages/soundfile.py", |
| 42 | + "/opt/ray_venvs/*/lib/python3.*/site-packages/soundfile.py", |
| 43 | + "/opt/uv_cache/archive-v0/*/soundfile.py", |
39 | 44 | ) |
40 | 45 |
|
41 | 46 | # Actor FQN -> packages that must import inside that actor's venv. |
@@ -230,6 +235,27 @@ def test_soundfile_libsndfile_removed(): |
230 | 235 | assert remaining == [], f"codec cleanup left scanner-visible libsndfile files: {remaining}" |
231 | 236 |
|
232 | 237 |
|
| 238 | +@pytest.mark.smoke_nmp_rl_training |
| 239 | +def test_transformers_audio_backend_probe_is_off(): |
| 240 | + """Removing the codec must also switch off the probe that guards its import. |
| 241 | +
|
| 242 | + ``transformers.audio_utils`` does ``if is_soundfile_available(): import soundfile``, |
| 243 | + and that probe is ``find_spec("soundfile")`` -- file presence, not loadability. Delete |
| 244 | + the codec but keep the module and the probe says yes to a backend that then fails to |
| 245 | + dlopen, so ``from transformers import AutoProcessor`` raises. That import is at module |
| 246 | + scope in ``nemo_rl.algorithms.grpo``, so the GRPO driver dies before it reads a config. |
| 247 | + """ |
| 248 | + from transformers.utils.import_utils import is_soundfile_available |
| 249 | + |
| 250 | + assert not is_soundfile_available() |
| 251 | + |
| 252 | + |
| 253 | +@pytest.mark.smoke_nmp_rl_training |
| 254 | +def test_grpo_driver_module_imports(): |
| 255 | + """The exact import the GRPO driver performs first, and the one the codec strip broke.""" |
| 256 | + from nemo_rl.algorithms.grpo import MasterConfig # noqa: F401 |
| 257 | + |
| 258 | + |
233 | 259 | @pytest.mark.smoke_nmp_rl_training |
234 | 260 | def test_no_git_directories_shipped(): |
235 | 261 | """The published image must not carry repository history. |
|
0 commit comments