Expand ONNX export test coverage beyond UNet and SegResNet

Abierto
#9,072 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
75/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python, pytorch

Línea de trabajo

Comienza con tests/networks/test_convert_to_onnx.py y sigue su patrón de exportación parametrizado existente de ONNX. Añade cobertura exclusiva para CPU para las diez arquitecturas de red indicadas, usando configuraciones pequeñas y entradas diminutas, con BasicUNetPlusPlus configurado con deep_supervision=False. Se considera terminado cuando cada modelo enumerado se exporta correctamente sin aumentar sustancialmente el tiempo de ejecución de CI.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

The current ONNX export test suite (tests/networks/test_convert_to_onnx.py) only covers 2 out of 40+ network architectures: UNet (2D) and SegResNet (3D). This means regressions in ONNX exportability for widely used architectures like DynUNet, UNETR, VNet, DenseNet, ResNet, etc. go completely undetected until a user hits them in production.

The convert_to_onnx() utility is a key part of MONAI's deployment story, and the gap between supported networks and tested networks is significant.

Describing the solution

Add parameterized ONNX export tests for additional architectures that are known to export cleanly. Starting with these 10 LOW-risk networks that have no ONNX-incompatible patterns (no .item(), no data-dependent control flow, single-tensor output):

  1. DynUNet — popular for nnU-Net style pipelines
  2. AttentionUnet — standard attention-gated U-Net
  3. BasicUNet — simple baseline U-Net
  4. BasicUNetPlusPlus — UNet++ (with deep_supervision=False)
  5. VNet — classic 3D segmentation
  6. HighResNet — standard 3D segmentation
  7. DenseNet — classification backbone
  8. ResNet — classification backbone
  9. SENet — squeeze-excitation network
  10. UNETR — transformer-based segmentation

All tests will use small model configurations and tiny input tensors to keep CI runtime low, following the existing parameterized pattern in the test file.

Describe alternatives

  • Testing all 40+ networks at once — impractical due to ONNX-incompatible patterns in some architectures (e.g., SwinUNETR uses .item() during init, AHNet has data-dependent control flow). Better to start with the safe subset and expand incrementally.

Additional context

The existing FIXME at line 29 of test_convert_to_onnx.py notes that CUDA produces different outputs vs ONNX — all tests run CPU-only, which is fine for verifying exportability.

Lenguaje dominante
Python
Estrellas
8.7k
Forks
1.6k
Merge medio
5 d 1 h
PR fusionados (30 d)
22

Guía de contribución

Abrir la guía de contribución

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 Project-MONAI/MONAI

Todos los issues de Project-MONAI/MONAI

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.