Skip to content

fix: add conditional compilation for MLX version compatibility#4

Open
filipsajdak wants to merge 1 commit intogrorge123:mainfrom
filipsajdak:fix/mlx-0.30-shape-api-compatibility
Open

fix: add conditional compilation for MLX version compatibility#4
filipsajdak wants to merge 1 commit intogrorge123:mainfrom
filipsajdak:fix/mlx-0.30-shape-api-compatibility

Conversation

@filipsajdak
Copy link

Add mlx_compat.h header with version detection and compatibility macros/wrappers to support both MLX <0.30 and >=0.30 APIs:

  • MLX_VERSION_AT_LEAST() macro for version checking
  • MlxShape/MlxStrides type aliases for shape types
  • MLX_QUANTIZE_* macros for quantize result access
  • mlx_compat::scaled_dot_product_attention() wrapper

This allows the library to compile with both older and newer MLX versions without source modifications.

Add mlx_compat.h header with version detection and compatibility
macros/wrappers to support both MLX <0.30 and >=0.30 APIs:

- MLX_VERSION_AT_LEAST() macro for version checking
- MlxShape/MlxStrides type aliases for shape types
- MLX_QUANTIZE_* macros for quantize result access
- mlx_compat::scaled_dot_product_attention() wrapper

This allows the library to compile with both older and newer MLX
versions without source modifications.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant