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

fix libcuda_dirs import for triton 3.0 #227

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

t-vi
Copy link

@t-vi t-vi commented Mar 8, 2024

Hi,

thank you for unsloth.
I happened to have triton 3.x dev installed, it seems the import location for libcuda_dirs changed.
With this change, one can import unsloth with newer triton.

Thank you again.

@danielhanchen
Copy link
Contributor

@t-vi Oh cool thanks! Did not notice the changes in Triton v3! Let me install the dev branch and check it out :)

triton_version = triton.__version__.split(".")
triton_major = int(triton_version[0])
if triton_major >= 3:
from triton.backends.nvidia.driver import libcuda_dirs
Copy link

Choose a reason for hiding this comment

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

This didn't work for me with pytorch-triton==3.0.0+901819d2b6:

    import unsloth
  File "/home/carmocca/git/unsloth/unsloth/__init__.py", line 64, in <module>
    from triton.backends.nvidia.driver import libcuda_dirs
ImportError: cannot import name 'libcuda_dirs' from 'triton.backends.nvidia.driver' (/home/carmocca/git/nightly-venv/lib/python3.10/site-packages/triton/backends/nvidia/driver.py)

Also, you would want to update L98 which also imports this once there' a working solution

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

3 participants