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

Can't build the book on MacOS when trying to add MLX implementation #2583

Open
PRESIDENT810 opened this issue Jan 18, 2024 · 0 comments
Open

Comments

@PRESIDENT810
Copy link

I'm trying to add Apple's MLX code implementation, but when I am trying to build the html book I run into this when running d2lbook build html:

Traceback (most recent call last):
  File "/Users/zhongkaining/Library/Python/3.9/bin/d2lbook", line 8, in <module>
    sys.exit(main())
  File "/Users/zhongkaining/Library/Python/3.9/lib/python/site-packages/d2lbook/main.py", line 25, in main
    commands[args.command[0]]()
  File "/Users/zhongkaining/Library/Python/3.9/lib/python/site-packages/d2lbook/build.py", line 43, in build
    getattr(builder, cmd)()
  File "/Users/zhongkaining/Library/Python/3.9/lib/python/site-packages/d2lbook/build.py", line 55, in warp
    func(self)
  File "/Users/zhongkaining/Library/Python/3.9/lib/python/site-packages/d2lbook/build.py", line 342, in html
    self.rst()
  File "/Users/zhongkaining/Library/Python/3.9/lib/python/site-packages/d2lbook/build.py", line 55, in warp
    func(self)
  File "/Users/zhongkaining/Library/Python/3.9/lib/python/site-packages/d2lbook/build.py", line 316, in rst
    self.eval()
  File "/Users/zhongkaining/Library/Python/3.9/lib/python/site-packages/d2lbook/build.py", line 55, in warp
    func(self)
  File "/Users/zhongkaining/Library/Python/3.9/lib/python/site-packages/d2lbook/build.py", line 160, in eval
    _process_and_eval_notebook(scheduler, src, tgt, run_cells,
  File "/Users/zhongkaining/Library/Python/3.9/lib/python/site-packages/d2lbook/build.py", line 515, in _process_and_eval_notebook
    scheduler.add(1, num_gpus, target=_job,
  File "/Users/zhongkaining/Library/Python/3.9/lib/python/site-packages/d2lbook/resource.py", line 102, in add
    assert num_cpus <= self._num_cpus and num_gpus <= self._num_gpus, \
AssertionError: Not enough resources (CPU 2, GPU 0 ) to run the task (CPU 1, GPU 1)

Looks like building this book requires a GPU, but on MacBook there is no Nvidia GPU. If I want to build on other OS, then I don't MLX will be available on those platforms since this is kinda specifically designed for MacOS.

I think this problem blocks people who attempts to contribute MLX code to this book.

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

No branches or pull requests

1 participant