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_UNET.py #53

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

MLX_UNET.py #53

wants to merge 9 commits into from

Conversation

bdeanhardt
Copy link
Contributor

@bdeanhardt bdeanhardt commented Dec 4, 2024

a first pass at the MLX implementation for UNET

@bdeanhardt bdeanhardt changed the title starting point for MLX_UNET.py MLX_UNET.py Dec 4, 2024
import torch
import numpy as np

def test_pytorch_mlp():
Copy link
Collaborator

Choose a reason for hiding this comment

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

example of how to test a pytorch vs mlx implementation, cc: @bdeanhardt @ethanernst11 @levinkhho

Also the config classes, which define the model's structure, are the same so you don't need to copy in any @dataclass configurations, you can import them from the pytorch files as done in the file above.

The benefit there is that the exact same config class can be used for either implementation, which keeps it transparent to the user

@luke-carlson
Copy link
Collaborator

Because the test case for MLP_MLX passes, you could start by just merging in that class implantation? If you'd like to merge others, we'd want to make similar test cases comparing them to the pytorch versions before merging

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.

2 participants