Skip to content

Add conda developer environment for Mac ARM #941

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

Merged
merged 4 commits into from
Jul 29, 2024

Conversation

Ch0ronomato
Copy link
Contributor

Description

My work machine is an M2 mac with the apple silicon. Not sure if this is a machine y'all are planning on supporting, but these were the changes I needed to make to environment.yaml to get off the ground.

Related Issue

  • Closes #
  • Related to #

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
raed667 Raed
@ricardoV94 ricardoV94 requested a review from maresb July 17, 2024 20:20
@maresb
Copy link
Contributor

maresb commented Jul 17, 2024

Ah, hmm, indeed this is pretty awkward. The proposed changes will break things for those not on Apple Silicon.

Ideally we should be doing something like depend on libblas and allow conda's pinning mechanism to install the right thing. I've messed around with it before, but never managed to get good results. I should probably poke at it some more.

@maresb maresb marked this pull request as draft July 17, 2024 20:55
@Ch0ronomato
Copy link
Contributor Author

I couldn't get anything either to be totally honest. It doesn't seem like it's a lost battle, but it gets me deving on an m1 for now - though I fully intend for it to be a bit of wasted pr. I did see there was some conda like # [not osx] type hints that might be relevant; though adding a gen_environment.py that does this resolution for us might be an okay fix

Copy link
Member

@twiecki twiecki left a comment

Choose a reason for hiding this comment

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

This would bake in accelerate instead of MKL, which we probably also don't want.

We figured out how to do this in the conda-forge package. https://github.com/conda-forge/pytensor-suite-feedstock/blob/main/recipe/meta.yaml Not sure it works here?

Alternatively we could add a different environment.yml for ARM64.

@Ch0ronomato
Copy link
Contributor Author

@twiecki yea, an alternative env file makes sense as well

@maresb
Copy link
Contributor

maresb commented Jul 18, 2024

Multiple env files are indeed a straightforward and simple workaround.

Those # [python_expression] things are called preprocessing selectors and unfortunately only apply to the meta.yaml Conda recipe specification, not the environment.yaml spec.

@Ch0ronomato
Copy link
Contributor Author

Sounds great, I'll go ahead and edit this to be environment_arm.yml

@maresb
Copy link
Contributor

maresb commented Jul 18, 2024

I'd recommend calling it environment-osx-arm64.yaml. (In addition to the osx-arm64 platform there's also linux-aarch64 where arm64 and aarch64 are synonymous, and linux-aarch64 can be used for Docker containers on Apple Silicon.)

Ian Schweer added 2 commits July 21, 2024 16:06
@Ch0ronomato Ch0ronomato marked this pull request as ready for review July 21, 2024 23:08
@Ch0ronomato Ch0ronomato requested a review from twiecki July 21, 2024 23:08
Copy link
Contributor

@maresb maresb left a comment

Choose a reason for hiding this comment

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

This approach looks good for now. I think pixi would be able to handle this much more elegantly via features and multienvironments:

https://pixi.sh/latest/features/multi_environment/

But transitioning to pixi is a bit more involved, so let's get this merged for now.

Co-authored-by: Ben Mares <services-git-throwaway1@tensorial.com>
@Ch0ronomato
Copy link
Contributor Author

Can we get this merged?

Copy link
Contributor

@maresb maresb left a comment

Choose a reason for hiding this comment

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

Thanks @Ch0ronomato! LGTM

@maresb maresb merged commit d6254af into pymc-devs:main Jul 29, 2024
15 checks passed
@ricardoV94 ricardoV94 changed the title Update for m1 Add conda developer environment for Mac ARM Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants