You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Two tests fail on a CUDA host since #736 / #697: test_nvfp4_experts_restricted_to_triton_for_swigluoai (sm_120) and test_graph_capture_reuses_warm_offload_cache_before_capture (any Linux host with libcuda) #765
FAILED tests/models/test_minimax_m3.py::test_nvfp4_experts_restricted_to_triton_for_swigluoai
assert 'w4a4' == 'triton'
FAILED tests/moe/test_offload.py::test_graph_capture_reuses_warm_offload_cache_before_capture
AttributeError: 'FakeGraph' object has no attribute 'raw_cuda_graph_exec'
The first fails only on sm_120. The second fails on any Linux host where libcuda.so.1 loads, even with CUDA_VISIBLE_DEVICES= (#739's description also lists it among the failures already on main on an RTX PRO 6000).
> rc = upload(graph.raw_cuda_graph_exec(), stream.cuda_stream)
E AttributeError: 'FakeGraph' object has no attribute 'raw_cuda_graph_exec'
python/freetoken/engine/graph.py:126: AttributeError
1 failed
The minimax test passes on a CPU host. The script below makes the same kernel selection as the test, then lets W4a4Nvfp4MoEKernel.worth_it() see what an sm_120 GPU reports:
importtorchfromfreetoken.kernelimportbackend, nvfp4_moefromfreetoken.layers.quantizationimportModelOptConfig, MoEConfig, select_kernelfromfreetoken.layers.quantization.moeimportNvfp4MoEMethodbackend.device_capability=lambda: (12, 0) # what the test monkeypatchesbackend.is_vllm_installed=backend.is_flashinfer_installed=lambda: Truecfg=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)
print("CPU host: ", select_kernel(Nvfp4MoEMethod.candidates, "auto", cfg).name)
torch.cuda.is_available=lambda: True# what worth_it() sees on a real sm_120 GPUtorch.cuda.current_device=lambda: 0nvfp4_moe.w4a4_available=lambdadevice_index: Trueprint("sm_120 GPU (worth_it):", select_kernel(Nvfp4MoEMethod.candidates, "auto", cfg).name)
tests/models/test_minimax_m3.py:273-285: the test monkeypatches backend.device_capability to (12, 0) and expects auto to pick triton. perf(moe): prefill nvfp4 W4A4 moe kernel on sm_120 #736 put W4a4Nvfp4MoEKernel first in Nvfp4MoEMethod.candidates (layers/quantization/moe/nvfp4.py:623). Its worth_it() (nvfp4.py:99-102) does not use backend.device_capability. It asks the real device through torch.cuda.is_available() and nvfp4_moe.w4a4_available(torch.cuda.current_device()). On a CPU host that is False, so the test passes. On sm_120 it is True, and w4a4 is a Triton subclass that accepts swigluoai, so auto picks w4a4. The test's intent ("marlin / b12x hard-code silu") still holds. Only the expected name is stale.
tests/moe/test_offload.py:467-469: FakeGraph has only pool(). fix(engine): upload cuda graphs at capture so a stream wait cannot block the first launch #697 added _upload_graph after each capture (engine/graph.py:118-128, called at :222), and it calls graph.raw_cuda_graph_exec() whenever _cu_graph_upload() (graph.py:108-115) is not None, which is any Linux, non-HIP host with libcuda.so.1.
Proposed fix
minimax test: assert that auto picks neither marlin nor b12x (in ("w4a4", "triton")). Or pin the device side as well, with monkeypatch.setattr(W4a4Nvfp4MoEKernel, "worth_it", lambda self, cfg: False), so that the test does not depend on the host GPU.
offload test: monkeypatch.setattr("freetoken.engine.graph._upload_graph", lambda graph, stream: None), or give FakeGraph a raw_cuda_graph_exec() and stub _cu_graph_upload.
Environment
Seen on an RTX 5080 16 GB (sm_120, driver 615.78.08), torch 2.14.1+cu130; reproduction CPU-only on main cc56b6b.
Activity