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

update setup.py to allow "wheel" construction on mac #1088

Merged
merged 2 commits into from
Jun 21, 2023
Merged

Conversation

andy-neuma
Copy link
Member

@andy-neuma andy-neuma commented Jun 21, 2023

SUMMARY:
allows "wheel" generation on macOS. reuses the ENV, NM_ALLOW_DARWIN.

TEST:
checks after the updating the condition.

❯ export NM_ALLOW_DARWIN=0
❯ python3 setup.py sdist bdist_wheel
Loaded version 1.6.0 from /Users/andy/sidelot/wand/deepsparse/src/deepsparse/generated_version.py
Traceback (most recent call last):
  File "/Users/andy/sidelot/wand/deepsparse/setup.py", line 223, in <module>
    _check_supported_system()
  File "/Users/andy/sidelot/wand/deepsparse/setup.py", line 188, in _check_supported_system
    raise OSError(
OSError: Native Mac is currently unsupported for DeepSparse. Please run on a Linux system or within a Linux container on Mac. More info can be found in our docs here: https://docs.neuralmagic.com/deepsparse/source/hardware.html

and enabling it

❯ export NM_ALLOW_DARWIN=1
❯ python3 setup.py sdist bdist_wheel
Loaded version 1.6.0 from /Users/andy/sidelot/wand/deepsparse/src/deepsparse/generated_version.py
Checking to see if /Users/andy/sidelot/wand/deepsparse/src/deepsparse/arch.bin exists.. True
running sdist
running egg_info
...
adding 'deepsparse_nightly-1.6.0.dist-info/top_level.txt'
adding 'deepsparse_nightly-1.6.0.dist-info/RECORD'
removing build/bdist.macosx-10.9-universal2/wheel

bnellnm
bnellnm previously approved these changes Jun 21, 2023
setup.py Outdated Show resolved Hide resolved
Copy link
Member

@bfineran bfineran left a comment

Choose a reason for hiding this comment

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

LGTM pending @dbarbuzzi's comment

Copy link
Member

@bfineran bfineran left a comment

Choose a reason for hiding this comment

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

looks good to me, we should probably just add a helper across our repos to evaluate truthy values from environment variables

@andy-neuma andy-neuma merged commit ac4062c into main Jun 21, 2023
7 checks passed
@andy-neuma andy-neuma deleted the mac-deepsparse branch June 21, 2023 21:26
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.

None yet

4 participants