-
Notifications
You must be signed in to change notification settings - Fork 84
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
Make this pip installable #82
Open
winglian
wants to merge
14
commits into
johnsmith0031:main
Choose a base branch
from
winglian:setup_pip
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
24e7d96
make things installable, refactor things
winglian 03d09d7
be explicit about the package for install
winglian 2305c1f
fix conditional
winglian 427efec
fix circular import and add monkeypatch submodule in setup
winglian 39a6fa1
add missing import
winglian fa4c8c1
setup sub modules so imports are easier
winglian ceb9f14
fix imports on cuda/triton since they aren't in __init__
winglian fe6d135
fix checks
winglian d553bf3
move the cuda kernel into this repo from https://github.com/qwopqwop2…
winglian e3369af
fix gptq install
winglian dbdd793
use the correct cuda files from the correct branch https://github.com…
winglian aa2d300
first pass at fixing the dockerfile
winglian a620a4e
docker copy fix
winglian 1b4a376
forgot to pip install
winglian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import sys | ||
from setuptools import setup | ||
from torch.utils.cpp_extension import BuildExtension, CUDAExtension | ||
|
||
install_requires = [] | ||
with open("./requirements.txt", "r") as requirements_file: | ||
reqs = [r.strip() for r in requirements_file.readlines()] | ||
for r in reqs: | ||
install_requires.append(r) | ||
|
||
quant_cuda_module = CUDAExtension( | ||
'alpaca_lora_4bit.quant_cuda', | ||
sources=[ | ||
'src/alpaca_lora_4bit/quant_cuda/quant_cuda.cpp', | ||
'src/alpaca_lora_4bit/quant_cuda/quant_cuda_kernel.cu' | ||
]) | ||
|
||
setup( | ||
name='alpaca_lora_4bit', | ||
version='0.1', | ||
description='Alpaca LoRA 4-bit', | ||
package_dir={'alpaca_lora_4bit': 'src/alpaca_lora_4bit'}, | ||
packages=['alpaca_lora_4bit', 'alpaca_lora_4bit.monkeypatch', 'alpaca_lora_4bit.quant_cuda'], | ||
install_requires=install_requires, | ||
extras_require={ | ||
'triton': 'triton', | ||
}, | ||
ext_modules=[quant_cuda_module], | ||
cmdclass={'build_ext': BuildExtension}, | ||
) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from . import monkeypatch | ||
from . import amp_wrapper | ||
from . import arg_parser | ||
from . import autograd_4bit | ||
from . import custom_autotune | ||
from . import Finetune4bConfig | ||
from . import gradient_checkpointing | ||
from . import models | ||
from . import train_data | ||
# We don't import these automatically as it is dependent on whether we need cuda or triton | ||
# from . import matmul_utils_4bit | ||
# from . import triton_utils |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is quite right. I tried to build the image and run it to test it for you, but the symlinks below were not pointing to anything.
If they were
ln -s ../alpaca_lora_4bit/autograd_4bit.py ./autograd_4bit.py
(remove 'src/') then they would have linked. So I recommend, either change the copy or change the symlinking.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops,
COPY src .
didn't do what I thought 🤦There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dockerfile updated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't be able to test that for a bit. I broke my machine pretty badly.