Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
bitsandbytes
Commits
2c605d03
Commit
2c605d03
authored
Dec 03, 2023
by
Titus von Koeller
Browse files
chore: update dev setup
parent
726f1470
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
12 deletions
+94
-12
.style.yapf
.style.yapf
+13
-0
environment.yml
environment.yml
+40
-12
pyproject.toml
pyproject.toml
+31
-0
pytest.ini
pytest.ini
+10
-0
tests/__init__.py
tests/__init__.py
+0
-0
No files found.
.style.yapf
0 → 100644
View file @
2c605d03
[style]
ALIGN_CLOSING_BRACKET_WITH_VISUAL_INDENT = True
ALLOW_MULTILINE_LAMBDAS = True
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = True
COLUMN_LIMIT = 88
COALESCE_BRACKETS = True
SPACE_BETWEEN_ENDING_COMMA_AND_CLOSING_BRACKET = True
SPACES_BEFORE_COMMENT = 2
SPLIT_BEFORE_BITWISE_OPERATOR = True
SPLIT_BEFORE_FIRST_ARGUMENT = True
SPLIT_BEFORE_LOGICAL_OPERATOR = True
SPLIT_BEFORE_NAMED_ASSIGNS = True
SPLIT_COMPLEX_COMPREHENSION = True
\ No newline at end of file
environment.yml
View file @
2c605d03
name
:
8-bit
name
:
bnb
channels
:
channels
:
-
conda-forge
-
pytorch
-
pytorch
-
nvidia
-
conda-forge
dependencies
:
dependencies
:
-
python=3.9
# Base
-
pytest
-
conda-forge::python=3.8
-
pytorch
-
pytorch::pytorch=>2.1
-
torchaudio
-
pytorch::pytorch-cuda=11.8
-
torchvision
-
nvidia::cuda=11.8
-
cudatoolkit=11.1
# Libraries
-
typer
-
conda-forge::accelerate
-
ca-certificates
-
conda-forge::einops
-
certifi
-
conda-forge::scipy
-
openssl
-
conda-forge::transformers
# Development
-
conda-forge::pytest
-
conda-forge::pytest-cases
# more readable and composable parametrized tests
-
conda-forge::ipython
# better interactive shell
-
conda-forge::debugpy
# debugger-support for VSCode
-
conda-forge::ruff
# linting
-
conda-forge::yapf
# code formatting
-
conda-forge::monkeytype
# infer type annotations
-
conda-forge::rich
# better, colored tracebacks, etc
-
conda-forge::pytest-sugar
# better pytest output
## ENV CREATION - steps to reproduce:
# mamba env remove -n bnb
# mamba create -y -n bnb python=3.8 # creating an empty env bypasses conda
# # and leads to much faster env resolution in the next step https://github.com/mamba-org/mamba/issues/633#issuecomment-812272143
# mamba env update -n bnb -f environment.yml
# mamba activate bnb
## PIP dependencies (install *after* ENV CREATION):
# pip install --no-cache-dir --no-deps lion_pytorch triton peft
## NOTE: conda peft is not up to date, so we install from pip
# cd pip install -e . ## installs bitsandbytes as editable development install from within repo root dir
## ENV UPDATE:
# # add new packages to environment.yml, then:
# mamba env update -n bnb -f environment.yml
\ No newline at end of file
pyproject.toml
View file @
2c605d03
...
@@ -4,3 +4,34 @@ requires = [
...
@@ -4,3 +4,34 @@ requires = [
"wheel"
"wheel"
]
]
build-backend
=
"setuptools.build_meta"
build-backend
=
"setuptools.build_meta"
[tool.ruff]
src
=
[
"bitsandbytes"
,
"tests"
,
"benchmarking"
]
fix
=
true
select
=
[
"A"
,
# prevent using keywords that clobber python builtins
"B"
,
# bugbear: security warnings
"E"
,
# pycodestyle
"F"
,
# pyflakes
"I"
,
# isort
"ISC"
,
# implicit string concatenation
"UP"
,
# alert you when better syntax is available in your python version
"RUF"
,
# the ruff developer's own rules
]
target-version
=
"py38"
ignore
=
[
"E712"
,
# Allow using if x == False, as it's not always equivalent to if x.
"E501"
,
# Supress line-too-long warnings: trust yapf's judgement on this one.
"F401"
,
]
ignore-init-module-imports
=
true
# allow to expose in __init__.py via imports
[tool.ruff.isort]
combine-as-imports
=
true
detect-same-package
=
true
force-sort-within-sections
=
true
known-first-party
=
["bitsandbytes"]
\ No newline at end of file
pytest.ini
0 → 100644
View file @
2c605d03
[pytest]
addopts
=
-rP
; --cov=bitsandbytes
; # contexts: record which test ran which line; can be seen in html coverage report
; --cov-context=test
; --cov-report html
log_cli
=
True
log_cli_level
=
INFO
log_file
=
logs/pytest.log
\ No newline at end of file
tests/__init__.py
0 → 100644
View file @
2c605d03
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment