repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
bitsandbytes-foundation/bitsandbytes | import os
from os.path import join
import shutil
import sys
import time
import uuid
from lion_pytorch import Lion
import pytest
import torch
import bitsandbytes as bnb
import bitsandbytes.functional as F
from bitsandbytes.utils import sync_gpu
from tests.helpers import describe_dtype, get_available_devices, id_format... | p_b) | assert_* | variable | tests/test_optim.py | test_ademamix_state_dict_no_nan | 654 | null | |
bitsandbytes-foundation/bitsandbytes | import copy
import os
import pathlib
import pickle
import platform
import subprocess
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
TRUE_FALSE,
describe_dtype,
get_av... | params4bit.quant_type | assert | complex_expr | tests/test_linear4bit.py | test_params4bit_torch_chunk_split | 241 | null | |
bitsandbytes-foundation/bitsandbytes | from math import prod
import pytest
import torch
import bitsandbytes
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import TRUE_FALSE, get_available_devices, id_formatter, is_supported_on_hpu
class TestNonContiguousInputs:
@pytest.mark.parametrize("device", get_available_devices())
... | out_c) | assert_* | variable | tests/test_ops.py | test_quantize_blockwise_non_contiguous | TestNonContiguousInputs | 274 | null |
bitsandbytes-foundation/bitsandbytes | from contextlib import nullcontext
import copy
import os
import pickle
import platform
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.modules import Linear8bitLt
from tests.helpers impo... | out_accelerator) | assert_* | variable | tests/test_linear8bitlt.py | test_linear8bitlt_device_movement | 340 | null | |
bitsandbytes-foundation/bitsandbytes | from contextlib import nullcontext
import copy
import os
import pickle
import platform
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.modules import Linear8bitLt
from tests.helpers impo... | torch.int8 | assert | complex_expr | tests/test_linear8bitlt.py | test_linear8bitlt_device_movement | 319 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import torch.nn as nn
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.parametrize import (
Bnb4bitParametrization,
replace_parameter_4bit,
replace_parameter_4bit_prequantized,
)
from tests.helpers import (
TR... | 2.0 | assert | numeric_literal | tests/test_parametrize.py | test_moe_realistic_forward | 234 | null | |
bitsandbytes-foundation/bitsandbytes | from math import prod
import pytest
import torch
import bitsandbytes
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import TRUE_FALSE, get_available_devices, id_formatter, is_supported_on_hpu
class TestLLMInt8Ops:
@pytest.mark.parametrize("threshold", [0.0, 6.0])
@pytest.mark.param... | None | assert | none_literal | tests/test_ops.py | test_int8_vectorwise_quant | TestLLMInt8Ops | 61 | null |
bitsandbytes-foundation/bitsandbytes | import os
from os.path import join
import shutil
import sys
import time
import uuid
from lion_pytorch import Lion
import pytest
import torch
import bitsandbytes as bnb
import bitsandbytes.functional as F
from bitsandbytes.utils import sync_gpu
from tests.helpers import describe_dtype, get_available_devices, id_format... | 0.0 | assert | numeric_literal | tests/test_optim.py | test_optimizer32bit | 260 | null | |
bitsandbytes-foundation/bitsandbytes | from contextlib import nullcontext
import copy
import os
import pickle
import platform
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.modules import Linear8bitLt
from tests.helpers impo... | ref_output.shape | assert | complex_expr | tests/test_linear8bitlt.py | test_linear8bitlt_torch_compile | 277 | null | |
bitsandbytes-foundation/bitsandbytes | from contextlib import nullcontext
import copy
import os
import pickle
import platform
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.modules import Linear8bitLt
from tests.helpers impo... | None | assert | none_literal | tests/test_linear8bitlt.py | test_linear_no_igemmlt | 59 | null | |
bitsandbytes-foundation/bitsandbytes | import math
import platform
import random
import time
import einops
from packaging import version
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
BOOLEAN_TUPLES,
TRUE_FALSE,
des... | None | assert | none_literal | tests/test_functional.py | test_dynamic_blockwise_quantization_large | Test8BitBlockwiseQuantizeFunctional | 177 | null |
bitsandbytes-foundation/bitsandbytes | from contextlib import nullcontext
import copy
import os
import pickle
import platform
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.modules import Linear8bitLt
from tests.helpers impo... | ref_output) | assert_* | variable | tests/test_linear8bitlt.py | test_linear8bitlt_torch_compile | 280 | null | |
bitsandbytes-foundation/bitsandbytes | import math
import platform
import random
import time
import einops
from packaging import version
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
BOOLEAN_TUPLES,
TRUE_FALSE,
des... | C4) | assert_* | variable | tests/test_functional.py | test_dequant_mm | TestLLMInt8Functional | 724 | null |
bitsandbytes-foundation/bitsandbytes | import os
from os.path import join
import shutil
import sys
import time
import uuid
from lion_pytorch import Lion
import pytest
import torch
import bitsandbytes as bnb
import bitsandbytes.functional as F
from bitsandbytes.utils import sync_gpu
from tests.helpers import describe_dtype, get_available_devices, id_format... | s2[k].dtype | assert | complex_expr | tests/test_optim.py | test_ademamix_state_dict_no_nan | 609 | null | |
bitsandbytes-foundation/bitsandbytes | from contextlib import nullcontext
import copy
import os
import pickle
import platform
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.modules import Linear8bitLt
from tests.helpers impo... | out_cpu) | assert_* | variable | tests/test_linear8bitlt.py | test_linear8bitlt_device_movement | 337 | null | |
bitsandbytes-foundation/bitsandbytes | import os
from os.path import join
import shutil
import sys
import time
import uuid
from lion_pytorch import Lion
import pytest
import torch
import bitsandbytes as bnb
import bitsandbytes.functional as F
from bitsandbytes.utils import sync_gpu
from tests.helpers import describe_dtype, get_available_devices, id_format... | torch.uint8 | assert | complex_expr | tests/test_optim.py | test_override_config_after_register | 342 | null | |
bitsandbytes-foundation/bitsandbytes | import os
from os.path import join
import shutil
import sys
import time
import uuid
from lion_pytorch import Lion
import pytest
import torch
import bitsandbytes as bnb
import bitsandbytes.functional as F
from bitsandbytes.utils import sync_gpu
from tests.helpers import describe_dtype, get_available_devices, id_format... | bnb_optimizer.state[p2][name2]) | assert_* | complex_expr | tests/test_optim.py | test_optimizer32bit | 243 | null | |
bitsandbytes-foundation/bitsandbytes | import os
from os.path import join
import shutil
import sys
import time
import uuid
from lion_pytorch import Lion
import pytest
import torch
import bitsandbytes as bnb
import bitsandbytes.functional as F
from bitsandbytes.utils import sync_gpu
from tests.helpers import describe_dtype, get_available_devices, id_format... | p2) | assert_* | variable | tests/test_optim.py | test_optimizer32bit | 258 | null | |
bitsandbytes-foundation/bitsandbytes | import math
import platform
import random
import time
import einops
from packaging import version
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
BOOLEAN_TUPLES,
TRUE_FALSE,
des... | A) | assert_* | variable | tests/test_functional.py | test_approx_igemm | TestIGEMMFunctional | 419 | null |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import torch.nn as nn
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.parametrize import (
Bnb4bitParametrization,
replace_parameter_4bit,
replace_parameter_4bit_prequantized,
)
from tests.helpers import (
TR... | 0.08 | assert | numeric_literal | tests/test_parametrize.py | test_parametrization_forward_method | 384 | null | |
bitsandbytes-foundation/bitsandbytes | import inspect
import pytest
import torch
from torch import nn
import bitsandbytes as bnb
from tests.helpers import get_available_devices, id_formatter, is_supported_on_hpu
def get_args():
args = MockArgs([])
args.quant_type = "vector"
args.use_8bit_training = "full"
args.clip_freq = 9999
return ... | None | assert | none_literal | tests/test_modules.py | test_linear8bitlt_inference | 67 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import bitsandbytes as bnb
from tests.helpers import (
BOOLEAN_TRIPLES,
TRUE_FALSE,
describe_dtype,
get_available_devices,
id_formatter,
is_supported_on_hpu,
)
TRANSPOSE_VALS = [(False, True), (False, False)]
@pytest.mark.parametrize("device", get_available_devices(... | gradBias2) | assert_* | variable | tests/test_autograd.py | test_matmul_4bit | 260 | null | |
bitsandbytes-foundation/bitsandbytes | import inspect
import pytest
import torch
from torch import nn
import bitsandbytes as bnb
from tests.helpers import get_available_devices, id_formatter, is_supported_on_hpu
def get_args():
args = MockArgs([])
args.quant_type = "vector"
args.use_8bit_training = "full"
args.clip_freq = 9999
return ... | bgrad2) | assert_* | variable | tests/test_modules.py | test_kbit_backprop | 340 | null | |
bitsandbytes-foundation/bitsandbytes | from contextlib import nullcontext
import copy
import os
import pickle
import platform
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.modules import Linear8bitLt
from tests.helpers impo... | x_ours.grad) | assert_* | complex_expr | tests/test_linear8bitlt.py | test_linear_no_igemmlt | 65 | null | |
bitsandbytes-foundation/bitsandbytes | import copy
import os
import pathlib
import pickle
import platform
import subprocess
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
TRUE_FALSE,
describe_dtype,
get_av... | grad_ref) | assert_* | variable | tests/test_linear4bit.py | test_linear4bit_torch_compile | 435 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
from bitsandbytes.cextension import HIP_ENVIRONMENT, get_cuda_bnb_library_path
from bitsandbytes.cuda_specs import CUDASpecs
def cuda120_spec() -> CUDASpecs:
return CUDASpecs(
cuda_version_string="120",
highest_compute_capability=(8, 6),
cuda_version_tuple=(12, 0),
)
def... | "libbitsandbytes_rocm70" | assert | string_literal | tests/test_cuda_setup_evaluator.py | test_get_rocm_bnb_library_path | 44 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import bitsandbytes as bnb
from tests.helpers import (
BOOLEAN_TRIPLES,
TRUE_FALSE,
describe_dtype,
get_available_devices,
id_formatter,
is_supported_on_hpu,
)
TRANSPOSE_VALS = [(False, True), (False, False)]
@pytest.mark.parametrize("device", get_available_devices(... | 0.115 | assert | numeric_literal | tests/test_autograd.py | test_matmul_4bit | 226 | null | |
bitsandbytes-foundation/bitsandbytes | import copy
import os
import pathlib
import pickle
import platform
import subprocess
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
TRUE_FALSE,
describe_dtype,
get_av... | True | assert | bool_literal | tests/test_linear4bit.py | test_params4bit_quant_state_attr_access | 501 | null | |
bitsandbytes-foundation/bitsandbytes | import inspect
import pytest
import torch
from torch import nn
import bitsandbytes as bnb
from tests.helpers import get_available_devices, id_formatter, is_supported_on_hpu
def get_args():
args = MockArgs([])
args.quant_type = "vector"
args.use_8bit_training = "full"
args.clip_freq = 9999
return ... | grad2) | assert_* | variable | tests/test_modules.py | test_kbit_backprop | 339 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import torch.nn as nn
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.parametrize import (
Bnb4bitParametrization,
replace_parameter_4bit,
replace_parameter_4bit_prequantized,
)
from tests.helpers import (
TR... | blocksize | assert | variable | tests/test_parametrize.py | test_quant_state_preservation | 280 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import torch.nn as nn
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.parametrize import (
Bnb4bitParametrization,
replace_parameter_4bit,
replace_parameter_4bit_prequantized,
)
from tests.helpers import (
TR... | dtype | assert | variable | tests/test_parametrize.py | test_replace_parameter_4bit | 62 | null | |
bitsandbytes-foundation/bitsandbytes | import math
import platform
import random
import time
import einops
from packaging import version
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
BOOLEAN_TUPLES,
TRUE_FALSE,
des... | b) | assert_* | variable | tests/test_functional.py | assert_all_approx_close | 34 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
from bitsandbytes.cextension import HIP_ENVIRONMENT, get_cuda_bnb_library_path
from bitsandbytes.cuda_specs import CUDASpecs
def cuda120_spec() -> CUDASpecs:
return CUDASpecs(
cuda_version_string="120",
highest_compute_capability=(8, 6),
cuda_version_tuple=(12, 0),
)
def... | RuntimeError, match=r"BNB_CUDA_VERSION.*detected for ROCm") | pytest.raises | complex_expr | tests/test_cuda_setup_evaluator.py | test_get_rocm_bnb_library_path_rejects_cuda_override | 61 | null | |
bitsandbytes-foundation/bitsandbytes | import math
import platform
import random
import time
import einops
from packaging import version
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
BOOLEAN_TUPLES,
TRUE_FALSE,
des... | C3) | assert_* | variable | tests/test_functional.py | test_gemv_eye_4bit | TestQuantize4BitFunctional | 1,213 | null |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import bitsandbytes as bnb
from tests.helpers import (
BOOLEAN_TRIPLES,
TRUE_FALSE,
describe_dtype,
get_available_devices,
id_formatter,
is_supported_on_hpu,
)
TRANSPOSE_VALS = [(False, True), (False, False)]
@pytest.mark.parametrize("device", get_available_devices(... | A.dtype | assert | complex_expr | tests/test_autograd.py | test_matmullt | 95 | null | |
bitsandbytes-foundation/bitsandbytes | import inspect
import pytest
import torch
from torch import nn
import bitsandbytes as bnb
from tests.helpers import get_available_devices, id_formatter, is_supported_on_hpu
def get_args():
args = MockArgs([])
args.quant_type = "vector"
args.use_8bit_training = "full"
args.clip_freq = 9999
return ... | torch.int8 | assert | complex_expr | tests/test_modules.py | test_linear8bitlt_inference | 60 | null | |
bitsandbytes-foundation/bitsandbytes | from contextlib import nullcontext
import copy
import os
import pickle
import platform
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.modules import Linear8bitLt
from tests.helpers impo... | deep_copy.weight | assert | complex_expr | tests/test_linear8bitlt.py | test_linear8bit_deepcopy_param | 205 | null | |
bitsandbytes-foundation/bitsandbytes | from contextlib import nullcontext
import copy
import os
import pickle
import platform
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.modules import Linear8bitLt
from tests.helpers impo... | shallow_copy.weight | assert | complex_expr | tests/test_linear8bitlt.py | test_linear8bit_copy_param | 198 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import torch.nn as nn
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.parametrize import (
Bnb4bitParametrization,
replace_parameter_4bit,
replace_parameter_4bit_prequantized,
)
from tests.helpers import (
TR... | state_dict | assert | variable | tests/test_parametrize.py | test_state_dict_functionality | 176 | null | |
bitsandbytes-foundation/bitsandbytes | import math
import platform
import random
import time
import einops
from packaging import version
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
BOOLEAN_TUPLES,
TRUE_FALSE,
des... | 0.28 | assert | numeric_literal | tests/test_functional.py | test_4bit_compressed_stats | TestQuantize4BitFunctional | 947 | null |
bitsandbytes-foundation/bitsandbytes | import os
from os.path import join
import shutil
import sys
import time
import uuid
from lion_pytorch import Lion
import pytest
import torch
import bitsandbytes as bnb
import bitsandbytes.functional as F
from bitsandbytes.utils import sync_gpu
from tests.helpers import describe_dtype, get_available_devices, id_format... | b) | assert_* | variable | tests/test_optim.py | assert_most_approx_close | 27 | null | |
bitsandbytes-foundation/bitsandbytes | from math import prod
import pytest
import torch
import bitsandbytes
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import TRUE_FALSE, get_available_devices, id_formatter, is_supported_on_hpu
class TestLLMInt8Ops:
@pytest.mark.parametrize("device", get_available_devices())
@pytest.... | dtype | assert | variable | tests/test_ops.py | test_int8_scaled_mm | TestLLMInt8Ops | 96 | null |
bitsandbytes-foundation/bitsandbytes | import math
import platform
import random
import time
import einops
from packaging import version
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
BOOLEAN_TUPLES,
TRUE_FALSE,
des... | C2) | assert_* | variable | tests/test_functional.py | test_gemv_eye_4bit | TestQuantize4BitFunctional | 1,215 | null |
bitsandbytes-foundation/bitsandbytes | from contextlib import nullcontext
import copy
import os
import pickle
import platform
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.modules import Linear8bitLt
from tests.helpers impo... | grad_ref) | assert_* | variable | tests/test_linear8bitlt.py | test_linear8bitlt_torch_compile | 302 | null | |
bitsandbytes-foundation/bitsandbytes | import copy
import os
import pathlib
import pickle
import platform
import subprocess
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
TRUE_FALSE,
describe_dtype,
get_av... | ref_output.dtype | assert | complex_expr | tests/test_linear4bit.py | test_linear4bit_torch_compile | 421 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import torch.nn as nn
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.parametrize import (
Bnb4bitParametrization,
replace_parameter_4bit,
replace_parameter_4bit_prequantized,
)
from tests.helpers import (
TR... | rel_bound | assert | variable | tests/test_parametrize.py | test_moe_parameter_shape | 125 | null | |
bitsandbytes-foundation/bitsandbytes | from math import prod
import pytest
import torch
import bitsandbytes
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import TRUE_FALSE, get_available_devices, id_formatter, is_supported_on_hpu
class TestLLMInt8Ops:
@pytest.mark.parametrize("threshold", [0.0, 6.0])
@pytest.mark.param... | 1 | assert | numeric_literal | tests/test_ops.py | test_int8_vectorwise_quant | TestLLMInt8Ops | 62 | null |
bitsandbytes-foundation/bitsandbytes | import os
from os.path import join
import shutil
import sys
import time
import uuid
from lion_pytorch import Lion
import pytest
import torch
import bitsandbytes as bnb
import bitsandbytes.functional as F
from bitsandbytes.utils import sync_gpu
from tests.helpers import describe_dtype, get_available_devices, id_format... | s1) | assert_* | variable | tests/test_optim.py | test_optimizer8bit | 488 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import bitsandbytes as bnb
from tests.helpers import (
BOOLEAN_TRIPLES,
TRUE_FALSE,
describe_dtype,
get_available_devices,
id_formatter,
is_supported_on_hpu,
)
TRANSPOSE_VALS = [(False, True), (False, False)]
@pytest.mark.parametrize("device", get_available_devices(... | 0.0 | assert | numeric_literal | tests/test_autograd.py | test_matmullt | 136 | null | |
bitsandbytes-foundation/bitsandbytes | from math import prod
import pytest
import torch
import bitsandbytes
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import TRUE_FALSE, get_available_devices, id_formatter, is_supported_on_hpu
class TestLLMInt8Ops:
@pytest.mark.parametrize("device", get_available_devices())
def test_... | (10, 30) | assert | collection | tests/test_ops.py | test_int8_linear_matmul | TestLLMInt8Ops | 25 | null |
bitsandbytes-foundation/bitsandbytes | from contextlib import nullcontext
import copy
import os
import pickle
import platform
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.modules import Linear8bitLt
from tests.helpers impo... | ref_output.device | assert | complex_expr | tests/test_linear8bitlt.py | test_linear8bitlt_torch_compile | 278 | null | |
bitsandbytes-foundation/bitsandbytes | import inspect
import pytest
import torch
from torch import nn
import bitsandbytes as bnb
from tests.helpers import get_available_devices, id_formatter, is_supported_on_hpu
def get_args():
args = MockArgs([])
args.quant_type = "vector"
args.use_8bit_training = "full"
args.clip_freq = 9999
return ... | b) | assert_* | variable | tests/test_modules.py | assert_all_approx_close | 52 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import torch.nn as nn
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.parametrize import (
Bnb4bitParametrization,
replace_parameter_4bit,
replace_parameter_4bit_prequantized,
)
from tests.helpers import (
TR... | device | assert | variable | tests/test_parametrize.py | test_replace_parameter_4bit | 63 | null | |
bitsandbytes-foundation/bitsandbytes | import math
import platform
import random
import time
import einops
from packaging import version
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
BOOLEAN_TUPLES,
TRUE_FALSE,
des... | B1) | assert_* | variable | tests/test_functional.py | test_integrated_int8_linear_matmul | TestLLMInt8Functional | 792 | null |
bitsandbytes-foundation/bitsandbytes | import copy
import os
import pathlib
import pickle
import platform
import subprocess
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
TRUE_FALSE,
describe_dtype,
get_av... | ref_output) | assert_* | variable | tests/test_linear4bit.py | test_linear4bit_torch_compile | 422 | null | |
bitsandbytes-foundation/bitsandbytes | import inspect
import pytest
import torch
from torch import nn
import bitsandbytes as bnb
from tests.helpers import get_available_devices, id_formatter, is_supported_on_hpu
def get_args():
args = MockArgs([])
args.quant_type = "vector"
args.use_8bit_training = "full"
args.clip_freq = 9999
return ... | 2 | assert | numeric_literal | tests/test_modules.py | test_4bit_linear_warnings | 481 | null | |
bitsandbytes-foundation/bitsandbytes | import copy
import os
import pathlib
import pickle
import platform
import subprocess
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
TRUE_FALSE,
describe_dtype,
get_av... | ref) | assert_* | variable | tests/test_linear4bit.py | test_quant_storage_shard_roundtrip | 284 | null | |
bitsandbytes-foundation/bitsandbytes | import math
import platform
import random
import time
import einops
from packaging import version
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
BOOLEAN_TUPLES,
TRUE_FALSE,
des... | C1) | assert_* | variable | tests/test_functional.py | test_gemv_eye_4bit | TestQuantize4BitFunctional | 1,214 | null |
bitsandbytes-foundation/bitsandbytes | from math import prod
import pytest
import torch
import bitsandbytes
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import TRUE_FALSE, get_available_devices, id_formatter, is_supported_on_hpu
class TestLLMInt8Ops:
@pytest.mark.parametrize("device", get_available_devices())
def test... | A.shape | assert | complex_expr | tests/test_ops.py | test_int8_mm_dequant | TestLLMInt8Ops | 78 | null |
bitsandbytes-foundation/bitsandbytes | import pytest
from bitsandbytes.cextension import HIP_ENVIRONMENT, get_cuda_bnb_library_path
from bitsandbytes.cuda_specs import CUDASpecs
def cuda120_spec() -> CUDASpecs:
return CUDASpecs(
cuda_version_string="120",
highest_compute_capability=(8, 6),
cuda_version_tuple=(12, 0),
)
@py... | caplog.text | assert | complex_expr | tests/test_cuda_setup_evaluator.py | test_get_cuda_bnb_library_path_override | 26 | null | |
bitsandbytes-foundation/bitsandbytes | from math import prod
import pytest
import torch
import bitsandbytes
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import TRUE_FALSE, get_available_devices, id_formatter, is_supported_on_hpu
class TestLLMInt8Ops:
@pytest.mark.parametrize("threshold", [0.0, 6.0])
@pytest.mark.param... | (10,) | assert | collection | tests/test_ops.py | test_int8_vectorwise_quant | TestLLMInt8Ops | 56 | null |
bitsandbytes-foundation/bitsandbytes | import copy
import os
import pathlib
import pickle
import platform
import subprocess
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
TRUE_FALSE,
describe_dtype,
get_av... | qB.dtype | assert | complex_expr | tests/test_linear4bit.py | test_quant_storage_shard_roundtrip | 280 | null | |
bitsandbytes-foundation/bitsandbytes | import os
from os.path import join
import shutil
import sys
import time
import uuid
from lion_pytorch import Lion
import pytest
import torch
import bitsandbytes as bnb
import bitsandbytes.functional as F
from bitsandbytes.utils import sync_gpu
from tests.helpers import describe_dtype, get_available_devices, id_format... | 20 | assert | numeric_literal | tests/test_optim.py | test_optimizer8bit | 430 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import bitsandbytes as bnb
from tests.helpers import (
BOOLEAN_TRIPLES,
TRUE_FALSE,
describe_dtype,
get_available_devices,
id_formatter,
is_supported_on_hpu,
)
TRANSPOSE_VALS = [(False, True), (False, False)]
@pytest.mark.parametrize("device", get_available_devices(... | gradA2) | assert_* | variable | tests/test_autograd.py | test_matmul_4bit | 257 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import torch.nn as nn
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.parametrize import (
Bnb4bitParametrization,
replace_parameter_4bit,
replace_parameter_4bit_prequantized,
)
from tests.helpers import (
TR... | abs_bound | assert | variable | tests/test_parametrize.py | test_moe_parameter_shape | 124 | null | |
bitsandbytes-foundation/bitsandbytes | import os
from os.path import join
import shutil
import sys
import time
import uuid
from lion_pytorch import Lion
import pytest
import torch
import bitsandbytes as bnb
import bitsandbytes.functional as F
from bitsandbytes.utils import sync_gpu
from tests.helpers import describe_dtype, get_available_devices, id_format... | s2[k]) | assert_* | complex_expr | tests/test_optim.py | test_ademamix_state_dict_no_nan | 610 | null | |
bitsandbytes-foundation/bitsandbytes | import pytest
import torch
import torch.nn as nn
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from bitsandbytes.nn.parametrize import (
Bnb4bitParametrization,
replace_parameter_4bit,
replace_parameter_4bit_prequantized,
)
from tests.helpers import (
TR... | 0.25 | assert | numeric_literal | tests/test_parametrize.py | test_parametrization_forward_method | 385 | null | |
bitsandbytes-foundation/bitsandbytes | import math
import platform
import random
import time
import einops
from packaging import version
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
BOOLEAN_TUPLES,
TRUE_FALSE,
des... | 0.3 | assert | numeric_literal | tests/test_functional.py | test_minmax_igemm | TestIGEMMFunctional | 583 | null |
bitsandbytes-foundation/bitsandbytes | import math
import platform
import random
import time
import einops
from packaging import version
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes import functional as F
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
BOOLEAN_TUPLES,
TRUE_FALSE,
des... | q2) | assert_* | variable | tests/test_functional.py | test_few_bit_quant | Test8BitBlockwiseQuantizeFunctional | 263 | null |
bitsandbytes-foundation/bitsandbytes | from math import prod
import pytest
import torch
import bitsandbytes
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import TRUE_FALSE, get_available_devices, id_formatter, is_supported_on_hpu
class Test4bitBlockwiseQuantOps:
@pytest.mark.parametrize("device", get_available_devices())
... | shape | assert | variable | tests/test_ops.py | test_dequantize_4bit | Test4bitBlockwiseQuantOps | 202 | null |
bitsandbytes-foundation/bitsandbytes | import copy
import os
import pathlib
import pickle
import platform
import subprocess
import sys
from tempfile import TemporaryDirectory
import pytest
import torch
import bitsandbytes as bnb
from bitsandbytes.cextension import ROCM_WARP_SIZE_64
from tests.helpers import (
TRUE_FALSE,
describe_dtype,
get_av... | ref_output.shape | assert | complex_expr | tests/test_linear4bit.py | test_linear4bit_torch_compile | 419 | null | |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.tokens import default_token_generator
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test... | user.username) | self.assertEqual | complex_expr | testproject/testapp/tests/test_reset_username_confirm.py | test_post_set_new_username | UsernameResetConfirmViewTest | 37 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.sites.shortcuts import get_current_site
from django.core import mail
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import revers... | status.HTTP_204_NO_CONTENT) | assert_* | complex_expr | testproject/testapp/tests/test_reset_username.py | test_post_should_send_email_to_user_with_username_reset_link | UsernameResetViewTest | 32 | null |
sunscrapers/djoser | import copy
import pickle
import re
from unittest import mock
from unittest.mock import patch
from django.conf import settings
from django.test.utils import override_settings
from djoser.email import BaseDjoserEmail
from djoser.conf import settings as djoser_settings
import pytest
class TestDjoserEmail:
@override... | default_context | assert | variable | testproject/testapp/tests/test_email.py | test_base_djoser_email_get_context_data_with_no_settings_uses_defaults | TestDjoserEmail | 22 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from djet import assertions
from rest_framework import serializers, status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from testapp.tests.common impo... | status.HTTP_200_OK) | assert_* | complex_expr | testproject/testapp/tests/test_user_me.py | test_get_return_user | UserViewSetMeTest | 32 | null |
sunscrapers/djoser | from django.contrib.sessions.middleware import SessionMiddleware
from djet import assertions, restframework
from rest_framework import status
from social_core.exceptions import AuthException
import djoser.social.views
from ..common import create_user, mock
class ProviderAuthViewTestCase(
view_class = djoser.soc... | status.HTTP_201_CREATED) | assert_* | complex_expr | testproject/testapp/tests/social/test_provider_auth.py | test_post_facebook_provider_success_returns_token | ProviderAuthViewTestCase | 51 | null |
sunscrapers/djoser | from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from testapp.tests.common import create_user, login_user
import djoser.permissions
import djoser.views
class UserViewSetListTest(BaseUserViewSetListTest):
def test_... | status.HTTP_404_NOT_FOUND) | assert_* | complex_expr | testproject/testapp/tests/test_user_detail.py | test_user_cannot_get_other_user_detail | UserViewSetListTest | 55 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth.tokens import default_token_generator
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from testapp.tests.common i... | ["token"]) | self.assertEqual | collection | testproject/testapp/tests/test_activation.py | test_post_respond_with_bad_request_when_wrong_token | ActivationViewTest | 80 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from .common import create_user, login_use... | self.user.is_active) | self.assertTrue | complex_expr | testproject/testapp/tests/test_user_view.py | test_email_change_with_send_activation_email_false | UserViewTest | 42 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth.tokens import default_token_generator
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from testapp.tests.common i... | status.HTTP_400_BAD_REQUEST) | assert_* | complex_expr | testproject/testapp/tests/test_activation.py | test_post_respond_with_bad_request_when_wrong_uid | ActivationViewTest | 47 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core import mail
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
f... | mail.outbox[0].body) | self.assertIn | complex_expr | testproject/testapp/tests/test_password_reset.py | test_post_should_send_email_to_user_with_password_reset_link | PasswordResetViewTest | 33 | null |
sunscrapers/djoser | import copy
import pickle
import re
from unittest import mock
from unittest.mock import patch
from django.conf import settings
from django.test.utils import override_settings
from djoser.email import BaseDjoserEmail
from djoser.conf import settings as djoser_settings
import pytest
class TestDjoserEmail:
@overrid... | "https" | assert | string_literal | testproject/testapp/tests/test_email.py | test_base_djoser_email_get_context_data_overrides_defaults_correctly | TestDjoserEmail | 39 | null |
sunscrapers/djoser | from django.contrib.auth import get_user_model
from django.test import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from testapp.tests.common import create_user
from django.conf import settings
fro... | status.HTTP_200_OK) | assert_* | complex_expr | testproject/testapp/tests/test_webauthn/test_login_request.py | test_post_with_username_registered_with_webauthn_should_return_login_assertion | TestLoginRequestView | 39 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from djet import assertions
from rest_framework import serializers, status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from testapp.tests.common impo... | status.HTTP_204_NO_CONTENT) | assert_* | complex_expr | testproject/testapp/tests/test_user_me.py | test_delete_user_if_logged_in | UserViewSetMeDeleteTest | 115 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from testapp.models import CustomUser
from ... | data["new_username"]) | self.assertNotEqual | complex_expr | testproject/testapp/tests/test_set_username.py | test_post_not_set_new_username_if_invalid | SetUsernameViewTest | 81 | null |
sunscrapers/djoser | from django.test import TestCase
from rest_framework_simplejwt.serializers import TokenVerifySerializer
from djoser.social.token.jwt import TokenStrategy
from ..common import create_user
class JWTStrategyTestCase(TestCase):
def test_obtain_provides_valid_token_for_given_user(self):
user = create_user()
... | user) | self.assertEqual | variable | testproject/testapp/tests/social/test_token_jwt.py | test_obtain_provides_valid_token_for_given_user | JWTStrategyTestCase | 13 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.tokens import default_token_generator
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test... | 0) | assert_* | numeric_literal | testproject/testapp/tests/test_reset_username_confirm.py | test_post_set_new_username | UsernameResetConfirmViewTest | 38 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from testapp.models import CustomUser
from ... | user.is_active) | self.assertTrue | complex_expr | testproject/testapp/tests/test_set_username.py | test_post_not_set_new_username_if_same | SetUsernameViewTest | 105 | null |
sunscrapers/djoser | from django.conf import settings
from django.test.testcases import SimpleTestCase
from django.test.utils import override_settings
from django.utils.module_loading import import_string
class SettingsTestCase(SimpleTestCase):
@override_settings(DJOSER=dict())
def test_settings_should_be_default_if_djoser_not_in_... | overridden_value) | self.assertEqual | variable | testproject/testapp/tests/test_settings.py | test_settings_should_be_default_if_djoser_not_in_django_settings | SettingsTestCase | 16 | null |
sunscrapers/djoser | import pytest
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
import djoser.views
from djoser.co... | RunCheck) | pytest.raises | variable | testproject/testapp/tests/test_user_delete.py | test_permission_class | UserMeDeleteViewTest | 57 | null |
sunscrapers/djoser | from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from testapp.tests.common import create_user, login_user
import djoser.permissions
import djoser.views
class UserViewSetListTest(BaseUserViewSetListTest):
def test_u... | status.HTTP_401_UNAUTHORIZED) | assert_* | complex_expr | testproject/testapp/tests/test_user_detail.py | test_unauthenticated_user_cannot_get_user_detail | UserViewSetListTest | 43 | null |
sunscrapers/djoser | from django.contrib.sessions.middleware import SessionMiddleware
from djet import assertions, restframework
from rest_framework import status
from social_core.exceptions import AuthException
import djoser.social.views
from ..common import create_user, mock
class ProviderAuthViewTestCase(
view_class = djoser.soc... | status.HTTP_200_OK) | assert_* | complex_expr | testproject/testapp/tests/social/test_provider_auth.py | test_get_facebook_provider_provides_valid_authorization_url | ProviderAuthViewTestCase | 33 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from djet import assertions
from rest_framework import serializers, status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from testapp.tests.common impo... | self.user.is_active) | self.assertTrue | complex_expr | testproject/testapp/tests/test_user_me.py | test_put_email_change_with_send_activation_email_false | UserViewSetMeTest | 46 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth.tokens import default_token_generator
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from testapp.tests.common i... | 0) | assert_* | numeric_literal | testproject/testapp/tests/test_password_reset_confirm.py | test_post_set_new_password | PasswordResetConfirmViewTest | 34 | null |
sunscrapers/djoser | from copy import deepcopy
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from .utils imp... | status.HTTP_201_CREATED) | assert_* | complex_expr | testproject/testapp/tests/test_webauthn/test_signup.py | test_post_with_valid_registration_response_should_create_user | TestSignupView | 67 | null |
sunscrapers/djoser | from copy import deepcopy
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from .utils imp... | user.is_active) | self.assertFalse | complex_expr | testproject/testapp/tests/test_webauthn/test_signup.py | test_register_user_when_email_confirmation_is_required | TestSignupView | 84 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from djet import assertions
from importlib.metadata import version
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from... | status.HTTP_201_CREATED) | assert_* | complex_expr | testproject/testapp/tests/test_user_create.py | test_post_create_user_without_login | UserCreateViewTest | 30 | null |
sunscrapers/djoser | from django.contrib.sessions.middleware import SessionMiddleware
from djet import assertions, restframework
from rest_framework import status
from social_core.exceptions import AuthException
import djoser.social.views
from ..common import create_user, mock
class ProviderAuthViewTestCase(
view_class = djoser.soc... | status.HTTP_400_BAD_REQUEST) | assert_* | complex_expr | testproject/testapp/tests/social/test_provider_auth.py | test_get_facebook_provider_fails_if_no_redirect_uri | ProviderAuthViewTestCase | 21 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from .common import create_user, login_use... | status.HTTP_200_OK) | assert_* | complex_expr | testproject/testapp/tests/test_user_view.py | test_get_return_user | UserViewTest | 26 | null |
sunscrapers/djoser | from django.conf import settings
from django.contrib.auth import user_logged_out
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from testapp.tests.common import create_us... | status.HTTP_401_UNAUTHORIZED) | assert_* | complex_expr | testproject/testapp/tests/test_token_destroy.py | test_post_should_deny_logging_out_when_user_not_logged_in | TokenDestroyViewTest | 34 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.