Skip to content

Commit 329f23a

Browse files
committed
Fix FP8 tests and bump Automodel pin
Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
1 parent 23761ed commit 329f23a

3 files changed

Lines changed: 27 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ no-build-isolation-package = [
465465
# indexes when resolving the speechlm2 extra (which pulls nemo_automodel
466466
# from git as a source dependency — uv treats these as workspace members).
467467
[tool.uv.sources]
468-
nemo_automodel = { git = "https://github.com/NVIDIA-NeMo/Automodel.git", rev = "9eccbb6102a260efd7cbdffa890fc57b94f94528" }
468+
nemo_automodel = { git = "https://github.com/NVIDIA-NeMo/Automodel.git", rev = "2f7c7e5ad39601c8cd20cd6b747950ebe8355b12" }
469469
torch = [
470470
{ index = "pytorch-cpu", marker = "sys_platform != 'linux' and sys_platform != 'darwin'" },
471471
{ index = "pytorch-cu132", marker = "sys_platform == 'linux'" },

tests/collections/speechlm2/test_fp8.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import sys
1616
import types
1717
from contextlib import contextmanager
18+
from importlib import import_module
1819

1920
import pytest
2021
import torch
@@ -30,8 +31,10 @@ def install_fake_module(monkeypatch, name, module):
3031
if idx == len(parts):
3132
current_module = module
3233
else:
33-
current_module = sys.modules.get(full_name, types.ModuleType(full_name))
34-
current_module.__path__ = []
34+
current_module = sys.modules.get(full_name)
35+
if current_module is None:
36+
current_module = types.ModuleType(full_name)
37+
current_module.__path__ = []
3538
monkeypatch.setitem(sys.modules, full_name, current_module)
3639

3740
for idx in range(1, len(parts)):
@@ -41,6 +44,22 @@ def install_fake_module(monkeypatch, name, module):
4144
monkeypatch.setattr(sys.modules[parent_name], child_name, sys.modules[child_full_name], raising=False)
4245

4346

47+
def test_install_fake_module_preserves_real_package_paths():
48+
nemo_automodel = pytest.importorskip("nemo_automodel")
49+
original_path = list(nemo_automodel.__path__)
50+
51+
with pytest.MonkeyPatch.context() as monkeypatch:
52+
fake_te_patches = types.ModuleType("nemo_automodel.shared.te_patches")
53+
fake_te_patches.apply_te_patches = lambda: None
54+
install_fake_module(monkeypatch, "nemo_automodel.shared.te_patches", fake_te_patches)
55+
56+
assert list(nemo_automodel.__path__) == original_path
57+
import_module("nemo_automodel.components.distributed.config")
58+
59+
assert list(nemo_automodel.__path__) == original_path
60+
import_module("nemo_automodel.components.distributed.config")
61+
62+
4463
@contextmanager
4564
def recording_context(events, name):
4665
events.append(f"{name}:enter")

uv.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)