Skip to content

FreeToken brings datacenter-scale model serving to your desktop. Run massive models locally, fast and efficiently.

fix(tests): pin host-dependent probes in nvfp4 kernel and graph capture tests (#799)

Manish Biswal00fe83b7290b
diff --git a/tests/models/test_minimax_m3.py b/tests/models/test_minimax_m3.py
index dc0ab90d..cf1b8c4f 100644
--- a/tests/models/test_minimax_m3.py
+++ b/tests/models/test_minimax_m3.py
@@ -275,8 +275,10 @@ def test_nvfp4_experts_restricted_to_triton_for_swigluoai(monkeypatch):
from freetoken.kernel import backend
from freetoken.layers.quantization import KernelSelectionError, ModelOptConfig, select_kernel
from freetoken.layers.quantization.moe import Nvfp4MoEMethod
+ from freetoken.layers.quantization.moe.nvfp4 import W4a4Nvfp4MoEKernel
monkeypatch.setattr(backend, "device_capability", lambda: (12, 0))
+ monkeypatch.setattr(W4a4Nvfp4MoEKernel, "worth_it", lambda self, cfg: False)
monkeypatch.setattr(backend, "is_vllm_installed", lambda: True)
monkeypatch.setattr(backend, "is_flashinfer_installed", lambda: True)
cfg = MoEConfig(num_experts=256, hidden=6144, intermediate=3072, top_k=4, scheme=ModelOptConfig.SCHEMES["NVFP4"], strategy="offload", activation="swigluoai", alpha=1.702, limit=7.0)
diff --git a/tests/moe/test_offload.py b/tests/moe/test_offload.py
index bc8dc26d..9c741691 100644
--- a/tests/moe/test_offload.py
+++ b/tests/moe/test_offload.py
@@ -497,6 +497,7 @@ def test_graph_capture_reuses_warm_offload_cache_before_capture(monkeypatch):
monkeypatch.setattr("torch.cuda.empty_cache", lambda: None)
monkeypatch.setattr("torch.cuda.reset_peak_memory_stats", lambda device=None: None)
monkeypatch.setattr("freetoken.engine.graph.get_free_memory", lambda device: 1024)
+ monkeypatch.setattr("freetoken.engine.graph._upload_graph", lambda graph, stream: None)
dummy_req = Req(
input_ids=torch.tensor([0], dtype=torch.int32),