#28846·ivy

将 JAX 前端支持添加到 Ivy 翻译器

作者: YushaArif99创建于 2024年12月17日更新于 2025年5月5日
标签JAX FrontendToDoTranspiler
  1. Add Native Framework-Specific Implementations for Core Transformation Passes:
  • For example, implement the native_jax_recursive_transformer.py for traversing and transforming JAX native source code.
  • Use native_torch_recursive_transformer.py as a reference (example here)
  1. Define the Transformation Pipeline for JAX to JAX Frontend IR:
  • Create a new pipeline in source_to_frontend_translator_config.py to handle the stage source='jax', target='jax_frontend' (example here).
  1. Define the Transformation Pipeline for JAX Frontend IR to Ivy:
  • Add another pipeline in frontend_to_ivy_translator_config.py to handle the stage source='jax_frontend', target='ivy' (example here).
  1. Add Stateful Classes for Flax APIs:
  • Implement a stateful class for the flax.nnx.Module API that inherits from ivy.Module.
  • Reference the existing implementation for PyTorch's nn.Module (example here)
  • This allows for sequential lowering: