Giter VIP home page Giter VIP logo

Comments (7)

loganthomas avatar loganthomas commented on July 30, 2024

/assigntome

from xla.

loganthomas avatar loganthomas commented on July 30, 2024

Issue 1: Cannot install torch_xla[tpu]

  • When trying to install the optional tpu dependencies, I get an error:
$ pip install torch~=2.3.0 torch_xla[tpu]~=2.3.0 -f https://storage.googleapis.com/libtpu-releases/index.html
zsh: no matches found: torch_xla[tpu]~=2.3.0

Issue 2: Issue building

  • Both pip wheel and pip install commands yield errors
$ pip wheel plugins/cpu -v
Processing ./plugins/cpu
  Running command pip subprocess to install build dependencies
  Collecting setuptools
    Using cached setuptools-70.0.0-py3-none-any.whl.metadata (5.9 kB)
  Using cached setuptools-70.0.0-py3-none-any.whl (863 kB)
  Installing collected packages: setuptools
  Successfully installed setuptools-70.0.0
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  bazel build //plugins/cpu:pjrt_c_api_cpu_plugin.so --symlink_prefix=/Users/logan/Desktop/repos/xla/plugins/cpu/bazel- --remote_default_exec_properties=cache-silo-key=dev
  Traceback (most recent call last):
    File "/Users/logan/venvs/pytorch-dev/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Users/logan/venvs/pytorch-dev/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/logan/venvs/pytorch-dev/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/87/3sfr2hp948147snb3144n16w0000gn/T/pip-build-env-qq0brd10/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/87/3sfr2hp948147snb3144n16w0000gn/T/pip-build-env-qq0brd10/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
      self.run_setup()
    File "/private/var/folders/87/3sfr2hp948147snb3144n16w0000gn/T/pip-build-env-qq0brd10/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 10, in <module>
    File "/Users/logan/Desktop/repos/xla/plugins/cpu/../../build_util.py", line 67, in bazel_build
      subprocess.check_call(bazel_argv, stdout=sys.stdout, stderr=sys.stderr)
    File "/usr/local/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 408, in check_call
      retcode = call(*popenargs, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 389, in call
      with Popen(*popenargs, **kwargs) as p:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 1026, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/usr/local/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 1955, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'bazel'
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /Users/logan/venvs/pytorch-dev/bin/python3.12 /Users/logan/venvs/pytorch-dev/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py get_requires_for_build_wheel /var/folders/87/3sfr2hp948147snb3144n16w0000gn/T/tmp4ptkuoqt
  cwd: /Users/logan/Desktop/repos/xla/plugins/cpu
  Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip
$ pip install plugins/cpu -v
Using pip 24.0 from /Users/logan/venvs/pytorch-dev/lib/python3.12/site-packages/pip (python 3.12)
Processing ./plugins/cpu
  Running command pip subprocess to install build dependencies
  Collecting setuptools
    Using cached setuptools-70.0.0-py3-none-any.whl.metadata (5.9 kB)
  Using cached setuptools-70.0.0-py3-none-any.whl (863 kB)
  Installing collected packages: setuptools
  Successfully installed setuptools-70.0.0
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  bazel build //plugins/cpu:pjrt_c_api_cpu_plugin.so --symlink_prefix=/Users/logan/Desktop/repos/xla/plugins/cpu/bazel- --remote_default_exec_properties=cache-silo-key=dev
  Traceback (most recent call last):
    File "/Users/logan/venvs/pytorch-dev/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Users/logan/venvs/pytorch-dev/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/logan/venvs/pytorch-dev/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/87/3sfr2hp948147snb3144n16w0000gn/T/pip-build-env-l3twedtx/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/87/3sfr2hp948147snb3144n16w0000gn/T/pip-build-env-l3twedtx/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
      self.run_setup()
    File "/private/var/folders/87/3sfr2hp948147snb3144n16w0000gn/T/pip-build-env-l3twedtx/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 10, in <module>
    File "/Users/logan/Desktop/repos/xla/plugins/cpu/../../build_util.py", line 67, in bazel_build
      subprocess.check_call(bazel_argv, stdout=sys.stdout, stderr=sys.stderr)
    File "/usr/local/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 408, in check_call
      retcode = call(*popenargs, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 389, in call
      with Popen(*popenargs, **kwargs) as p:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 1026, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/usr/local/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 1955, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'bazel'
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /Users/logan/venvs/pytorch-dev/bin/python3.12 /Users/logan/venvs/pytorch-dev/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py get_requires_for_build_wheel /var/folders/87/3sfr2hp948147snb3144n16w0000gn/T/tmpkgrk3zoq
  cwd: /Users/logan/Desktop/repos/xla/plugins/cpu
  Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Machine Specs:

$ python -V
Python 3.12.3

$ pip list
Package           Version
----------------- -----------
asttokens         2.4.1
decorator         5.1.1
executing         2.0.1
filelock          3.14.0
fsspec            2024.6.0
ipython           8.25.0
jedi              0.19.1
Jinja2            3.1.4
MarkupSafe        2.1.5
matplotlib-inline 0.1.7
mpmath            1.3.0
networkx          3.3
numpy             1.26.4
pandas            2.2.2
parso             0.8.4
pexpect           4.9.0
pip               24.0
prompt_toolkit    3.0.46
ptyprocess        0.7.0
pure-eval         0.2.2
Pygments          2.18.0
python-dateutil   2.9.0.post0
pytz              2024.1
scipy             1.13.1
six               1.16.0
stack-data        0.6.3
sympy             1.12.1
torch             2.2.2
torch-xla         1.0
traitlets         5.14.3
typing_extensions 4.12.1
tzdata            2024.1
wcwidth           0.2.13

$ system_profiler SPSoftwareDataType SPHardwareDataType
Software:

    System Software Overview:

      System Version: macOS 14.4.1 (23E224)
      Kernel Version: Darwin 23.4.0
      Boot Volume: Macintosh HD
      ...

Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro15,1
      Processor Name: 6-Core Intel Core i7
      Processor Speed: 2.6 GHz
      Number of Processors: 1
      Total Number of Cores: 6
      L2 Cache (per Core): 256 KB
      L3 Cache: 9 MB
      Hyper-Threading Technology: Enabled
      Memory: 32 GB
      ...

from xla.

JackCaoG avatar JackCaoG commented on July 30, 2024

@will-cromar can you remind me if CPU plugin works? I can't remember.

from xla.

will-cromar avatar will-cromar commented on July 30, 2024

The CPU plugin is just for testing purposes. In practice, you can debug on CPU just by setting PJRT_DEVICE=CPU without installing anything extra.

from xla.

loganthomas avatar loganthomas commented on July 30, 2024
>>> import os
...
... # Log device type
... os.environ['TF_CPP_MIN_LOG_LEVEL'] = '0'
... os.environ['TF_CPP_VMODULE'] = 'pjrt_registry=5'
... os.environ['PJRT_DEVICE'] = 'CPU'
...
... from torch_xla.experimental import plugins
... import torch_xla_cpu_plugin
... import torch_xla.core.xla_model as xm
... import torch_xla.runtime as xr
...
... # Use dynamic plugin instead of built-in CPU support
... plugins.use_dynamic_plugins()
... plugins.register_plugin('CPU', torch_xla_cpu_plugin.CpuPlugin())
... xr.set_device_type('CPU')
...
... print(xm.xla_device())
Traceback (most recent call last):
  Cell In[1], line 8
    from torch_xla.experimental import plugins
  File ~/venvs/pytorch-dev/lib/python3.12/site-packages/torch_xla/__init__.py:1
    raise ImportError("WRONG PACKAGE. Please install the package from Neuron Repository - pip.repos.neuron.amazonaws.com")
ImportError: WRONG PACKAGE. Please install the package from Neuron Repository - pip.repos.neuron.amazonaws.com

from xla.

loganthomas avatar loganthomas commented on July 30, 2024

@JackCaoG @will-cromar

Do I need to install a different dependency? Am I missing something that prevents me from testing this correctly?

Or, is this what you were expecting?

from xla.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.