Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mlx - passing most layers tests #20862

Merged
merged 4 commits into from
Feb 8, 2025

Conversation

acsweet
Copy link

@acsweet acsweet commented Feb 5, 2025

This addresses #19571

Most tests in keras/src/layers are passing. This included updated and implemented ops functions (especially in random, image, and numpy)

  • is the change in layers/preprocessing/image_preprocessing/random_crop.py RandomCrop.get_random_transformation() okay?
    • mlx can't slice arrays with mlx.arrays (incl scalar values)
  • mlx.random.py beta() might need adjusting how it checks if shape is broadcastable with alpha and beta

Couple mlx notes, these be will fixed in their next patch release:

  • mlx.core.einsum was failing with ellipsis
  • gradient updates were failing with some reverse indexing, e.g. using ::-1 (this affected transpose convolutions), it's currently being handled with a reversed index array and mlx.core.take

(Sorry this got a bit large! I wanted to merge back to the mlx branch before continuing)

@codecov-commenter
Copy link

codecov-commenter commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 0.92379% with 429 lines in your changes missing coverage. Please review.

Please upload report for BASE (mlx@b9f7141). Learn more about missing BASE report.

Files with missing lines Patch % Lines
keras/src/backend/mlx/image.py 0.00% 234 Missing ⚠️
keras/src/backend/mlx/random.py 0.00% 104 Missing ⚠️
keras/src/backend/mlx/numpy.py 0.00% 52 Missing ⚠️
keras/src/backend/mlx/nn.py 0.00% 18 Missing ⚠️
keras/src/backend/mlx/linalg.py 0.00% 9 Missing ⚠️
keras/src/backend/mlx/math.py 0.00% 5 Missing ⚠️
keras/src/backend/mlx/core.py 0.00% 3 Missing ⚠️
...s/preprocessing/image_preprocessing/random_crop.py 57.14% 2 Missing and 1 partial ⚠️
keras/src/utils/tf_utils.py 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##             mlx   #20862   +/-   ##
======================================
  Coverage       ?   72.28%           
======================================
  Files          ?      572           
  Lines          ?    55368           
  Branches       ?     8529           
======================================
  Hits           ?    40020           
  Misses         ?    13409           
  Partials       ?     1939           
Flag Coverage Δ
keras 72.19% <0.92%> (?)
keras-jax 60.72% <0.92%> (?)
keras-numpy 55.74% <0.92%> (?)
keras-openvino 28.19% <0.23%> (?)
keras-tensorflow 61.22% <0.92%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution!

@google-ml-butler google-ml-butler bot added kokoro:force-run ready to pull Ready to be merged into the codebase labels Feb 8, 2025
@fchollet fchollet merged commit 7237ec7 into keras-team:mlx Feb 8, 2025
6 of 11 checks passed
@google-ml-butler google-ml-butler bot removed the ready to pull Ready to be merged into the codebase label Feb 8, 2025
@acsweet acsweet deleted the mlx-math-numpy-and-more branch February 10, 2025 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants