Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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)

Cerrado Apto para principiantes
#765 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python, pytorch
Área
backend, testing

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 monkeypatches backend.device_capability to (12, 0) and expects auto to pick triton. #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(). #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 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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de FlashML-org/FreeToken

Todos los issues de FlashML-org/FreeToken

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.