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)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 70/100
Línea de trabajo
Lee las dos pruebas mencionadas, tests/models/test_minimax_m3.py y tests/moe/test_offload.py, junto con el código relacionado en python/freetoken/engine/graph.py y layers/quantization/moe/nvfp4.py. Ejecuta la reproducción en CPU del issue y luego comprueba las correcciones de prueba propuestas tanto con CUDA como con CPU. El trabajo estará terminado cuando ambas pruebas pasen en las condiciones del host descritas en el issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happened
On an RTX 5080 (sm_120), on main cc56b6bd:
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).
Minimal reproduction (CPU only, PYTHONPATH=python):
CUDA_VISIBLE_DEVICES= python -m pytest -q -p no:cacheprovider \
"tests/moe/test_offload.py::test_graph_capture_reuses_warm_offload_cache_before_capture"
> 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:
import torch
from freetoken.kernel import backend, nvfp4_moe
from freetoken.layers.quantization import ModelOptConfig, MoEConfig, select_kernel
from freetoken.layers.quantization.moe import Nvfp4MoEMethod
backend.device_capability = lambda: (12, 0) # what the test monkeypatches
backend.is_vllm_installed = 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)
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 GPU
torch.cuda.current_device = lambda: 0
nvfp4_moe.w4a4_available = lambda device_index: True
print("sm_120 GPU (worth_it):", select_kernel(Nvfp4MoEMethod.candidates, "auto", cfg).name)
CPU host: triton
sm_120 GPU (worth_it): w4a4
Cause (current main, cc56b6bd)
tests/models/test_minimax_m3.py:273-285: the test monkeypatchesbackend.device_capabilityto (12, 0) and expectsautoto picktriton. #736 putW4a4Nvfp4MoEKernelfirst inNvfp4MoEMethod.candidates(layers/quantization/moe/nvfp4.py:623). Itsworth_it()(nvfp4.py:99-102) does not usebackend.device_capability. It asks the real device throughtorch.cuda.is_available()andnvfp4_moe.w4a4_available(torch.cuda.current_device()). On a CPU host that is False, so the test passes. On sm_120 it is True, andw4a4is a Triton subclass that accepts swigluoai, soautopicksw4a4. The test's intent ("marlin / b12x hard-code silu") still holds. Only the expected name is stale.tests/moe/test_offload.py:467-469:FakeGraphhas onlypool(). #697 added_upload_graphafter each capture (engine/graph.py:118-128, called at:222), and it callsgraph.raw_cuda_graph_exec()whenever_cu_graph_upload()(graph.py:108-115) is not None, which is any Linux, non-HIP host withlibcuda.so.1.
Proposed fix
- minimax test: assert that
autopicks neither marlin nor b12x (in ("w4a4", "triton")). Or pin the device side as well, withmonkeypatch.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 giveFakeGrapharaw_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 cc56b6bd.
- Lenguaje dominante
- Python
- Estrellas
- 14.2k
- Forks
- 1.4k
- Merge medio
- 23 h 47 min
- PR fusionados (30 d)
- 88
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de FlashML-org/FreeToken
-
Desktop feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
FlashML-org/FreeToken#800 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
FlashML-org/FreeToken#767 ·
Los mantenedores suelen responder en 1 día
-
test_gemv_path_matches_the_transcription fails on sm_120 (bf16 rounding tie exceeds the tolerance)Posiblemente ocupada @void-mckenzie la tomó hace 10 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
FlashML-org/FreeToken#649 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
FlashML-org/FreeToken#648 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
FlashML-org/FreeToken#646 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de FlashML-org/FreeToken
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
AstrBotDevs/AstrBot#10720 ·
Los mantenedores suelen responder en 1 día
-
fix(xiaomi): curated picker list still offers six ids that return 400 (plan-limited vs retired)Abiertocause/upstream comp/cli P2 provider/other tool/file type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NousResearch/hermes-agent#143900 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
WLAN-Pi/wlanpi-profiler#341 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día