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

Error while installing tt-flash : "Maturin failed" #20

Closed
saichandax opened this issue Dec 26, 2024 · 8 comments
Closed

Error while installing tt-flash : "Maturin failed" #20

saichandax opened this issue Dec 26, 2024 · 8 comments

Comments

@saichandax
Copy link

saichandax commented Dec 26, 2024

I am trying to setup an n300 card locally.
I encountered the following error while installing tt-flash.

(.venv) TT:~$ git clone https://github.com/tenstorrent/tt-flash.git
Cloning into 'tt-flash'...
remote: Enumerating objects: 322, done.
remote: Counting objects: 100% (78/78), done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 322 (delta 65), reused 48 (delta 48), pack-reused 244 (from 1)
Receiving objects: 100% (322/322), 105.60 KiB | 2.58 MiB/s, done.
Resolving deltas: 100% (193/193), done.
(.venv) TT:~$ cd tt-flash
(.venv) TT:~/tt-flash$ pip install .
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cpu
Processing /home/tt-flash
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pyluwen@ git+https://github.com/tenstorrent/[email protected]#subdirectory=crates/pyluwen (from tt-flash==3.1.0)
  Cloning https://github.com/tenstorrent/luwen.git (to revision v0.4.6) to /tmp/pip-install-rclcb706/pyluwen_a2550f41c4f74e1b87db80e3b7d2539a
  Running command git clone --filter=blob:none --quiet https://github.com/tenstorrent/luwen.git /tmp/pip-install-rclcb706/pyluwen_a2550f41c4f74e1b87db80e3b7d2539a
  Running command git checkout -q 5cf4cc6545b7d9d92f167417faf39822ed88dbf7
  Resolved https://github.com/tenstorrent/luwen.git to commit 5cf4cc6545b7d9d92f167417faf39822ed88dbf7
  Running command git submodule update --init --recursive -q
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
          Updating crates.io index
           Locking 191 packages to latest compatible versions
            Adding bitfield-struct v0.6.2 (available: v0.10.0)
            Adding memmap2 v0.7.1 (available: v0.9.5)
            Adding nix v0.26.4 (available: v0.29.0)
            Adding pyo3 v0.19.2 (available: v0.23.3)
            Adding thiserror v1.0.69 (available: v2.0.9)
      💥 maturin failed
        Caused by: `project.version` field is required in pyproject.toml unless it is present in the `project.dynamic` list
      Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/tmp/pip-modern-metadata-1oimamkk', '--interpreter', '/home/.venv/bin/python3']' returned non-zero exit status 1.
      Checking for Rust toolchain....
      Running `maturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-1oimamkk --interpreter /home/.venv/bin/python3`
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
(.venv) TT:~/tt-flash$ 

Device: n300
OS: ubuntu-20.04

Please let me know if I missed something.

@goshlanguage
Copy link

goshlanguage commented Dec 27, 2024

I can replicate this on Ubuntu-22, I suspect it's the maturin dependency and how it's defined. I can reproduce with the following:

git clone https://github.com/tenstorrent/tt-flash
cd tt-flash

git checkout v3.1.0

sudo apt install python3.10-venv

python3 -m venv venv
source venv/bin/activate

pip install .

I can also reproduce using pip install git+https://github.com/tenstorrent/tt-flash.git as referenced in the README.md

It seems if I run the command its failing on, it is expecting a Cargo.toml file to exist in src:

maturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-jf87wjhq --interpreter /home/rhartje/tt-flash/venv/bin/python3
💥 maturin failed
  Caused by: Can't find /home/rhartje/tt-flash/Cargo.toml (in /home/rhartje/tt-flash)

@saichandax saichandax changed the title Error during installing tt-flash at "Preparing Metadata" Error while installing tt-flash : "Maturin failed" Dec 30, 2024
@windwardly
Copy link

Looks like the fix is started in luwen

While waiting for how Tenstorrent wants to fix it, you can change this in pyproject.toml to drop the version and just use tip:

'
"pyluwen @ git+https://github.com/tenstorrent/[email protected]#subdirectory=crates/pyluwen",

to

"pyluwen @ git+https://github.com/tenstorrent/luwen.git#subdirectory=crates/pyluwen",
`

While including other changes, it seems to work.

@milank94
Copy link

milank94 commented Jan 3, 2025

Issue has been resolved as of: tenstorrent/luwen#12

Please try to install again.

@windwardly
Copy link

My sense is that the fix was related to further work in maturin with 2417 and 2418, which shifted the error to be a warning except in maturin develop.

The luwen that's linked into tt-flash (and tt-smi, tt-topology and maybe others) is at a fixed version in pyproject.toml, so looks like the new change to luwen is not brought in:

"pyluwen @ git+https://github.com/tenstorrent/[email protected]#subdirectory=crates/pyluwen"

That's just details however -- the bottom line matches: tt-flash works again!

@warthog9
Copy link
Member

warthog9 commented Jan 6, 2025

tt-smi was pushed as a tag but apparently missed the main branch, I missed flash apparently and topology had been fixed but the push was messed up slightly - sorted now. Sorry about that, I'm going to blame the holiday

@windwardly
Copy link

All looks fine. Yes, me too blaming the holidays, moving quickly between different branches on repos, I likely missed the tt-smi update.

Thank you.

@warthog9
Copy link
Member

warthog9 commented Jan 6, 2025

@saichandax can you confirm this is closeable at this point?

@saichandax
Copy link
Author

We can close this. Thanks for the fix. 👍

@milank94 milank94 closed this as completed Jan 7, 2025
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

5 participants