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

PatchDPOTrainer bug #1611

Open
sihaogu32 opened this issue Feb 4, 2025 · 3 comments
Open

PatchDPOTrainer bug #1611

sihaogu32 opened this issue Feb 4, 2025 · 3 comments

Comments

@sihaogu32
Copy link

Dear Author,

I am currently working with the code provided at [https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Zephyr_(7B)-DPO.ipynb#scrollTo=E8-BWi7MzkRz]. My operating environment is a Linux server equipped with an NVIDIA 4090 GPU.

Upon executing the following lines:

# One must patch the DPO Trainer first!
from unsloth import PatchDPOTrainer

PatchDPOTrainer()

I encountered the following error:

/tmp/tmp9d28jrm_/main.c:5:10: fatal error: Python.h: No such file or directory
    5 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
Cell In[8], line 2
      1 # One must patch the DPO Trainer first!
----> 2 from unsloth import PatchDPOTrainer
      4 PatchDPOTrainer()

........
File /usr/lib64/python3.12/subprocess.py:413, in check_call(*popenargs, **kwargs)
    411     if cmd is None:
    412         cmd = popenargs[0]
--> 413     raise CalledProcessError(retcode, cmd)
    414 return 0

CalledProcessError: Command '['/usr/bin/gcc', '/tmp/tmp9d28jrm_/main.c', '-O3', '-shared', '-fPIC', '-Wno-psabi', '-o', '/tmp/tmp9d28jrm_/cuda_utils.cpython-312-x86_64-linux-gnu.so', '-lcuda', '-L/home/sihaugo/.venv/lib/python3.12/site-packages/triton/backends/nvidia/lib', '-L/lib64', '-I/home/sihaugo/.venv/lib/python3.12/site-packages/triton/backends/nvidia/include', '-I/tmp/tmp9d28jrm_', '-I/usr/include/python3.12']' returned non-zero exit status 1.

I have confirmed that python3-dev is installed on my system. However, this did not resolve the issue. I would appreciate any guidance or solutions you could provide to address this problem. Thank you.

Best regards,

sihaogu

@erlonted
Copy link

erlonted commented Feb 5, 2025

I can solve this problem running : sudo apt-get install python3-dev

@danielhanchen
Copy link
Contributor

Hope this was resolved? Sorry on the issue!

@sihaogu32
Copy link
Author

sihaogu32 commented Feb 10, 2025 via email

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

3 participants