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

[BUG Fix] Fix the NVCC Comple options for CUDA Version >= 12.5 #143

Merged
merged 191 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
d8884e6
Refactor BatchMatMulEmitter and BatchMatMulSelector for improved read…
LeiWang1999 Jul 5, 2024
fc84173
Refactor import statements for improved readability and maintainability
LeiWang1999 Jul 5, 2024
02f64de
Refactor import statements for improved readability and maintainability
LeiWang1999 Jul 5, 2024
397eee6
disable failure email for ci
LeiWang1999 Jul 5, 2024
20f6ad1
remove email notifications.
LeiWang1999 Jul 6, 2024
b93c394
move relax pass from testing to mlc_llm
LeiWang1999 Jul 6, 2024
ba6a6df
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into main
LeiWang1999 Jul 6, 2024
257693a
Refactor scripts with se check_eual_ref_scripts_with_emitter function
LeiWang1999 Jul 6, 2024
9bb7f49
Lint Fix
LeiWang1999 Jul 6, 2024
39e7614
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into main
LeiWang1999 Jul 6, 2024
93eb5a5
Refactor scripts with se check_eual_ref_scripts_with_emitter function
LeiWang1999 Jul 6, 2024
aa66a90
bug fix in test
LeiWang1999 Jul 6, 2024
ae14a53
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Jul 6, 2024
79b08e4
lint fix.
LeiWang1999 Jul 6, 2024
86fd036
test cuda i4 kernel
LeiWang1999 Jul 7, 2024
6b73a21
Refactor copyright notice in i4matmul.hpp
LeiWang1999 Jul 7, 2024
0ba90c1
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Jul 7, 2024
086d208
Refactor BitBLASLinear test module for improved readability and maint…
LeiWang1999 Jul 7, 2024
47a3abd
refactor test as version below python 3.9 cannot handle int32 overflow.
LeiWang1999 Jul 8, 2024
024b247
format lint for test
LeiWang1999 Jul 8, 2024
bfedeaa
Refactor test_int4b_fp16_convert.py for improved readability and main…
LeiWang1999 Jul 8, 2024
e672a23
remove unused design file
LeiWang1999 Jul 8, 2024
21e5430
move tile device from package to base
LeiWang1999 Jul 8, 2024
fd11940
dummy impl for codegen
LeiWang1999 Jul 8, 2024
9ccfa85
Refactor file structure for ladder_permutate module
LeiWang1999 Jul 8, 2024
7c7d73e
Refactor backend class and fix typos in comments
LeiWang1999 Jul 8, 2024
47d5fc5
Deep refactor Lib related code.
LeiWang1999 Jul 8, 2024
53dd0dd
remove ci pull.
LeiWang1999 Jul 10, 2024
d58ac43
LintFix
LeiWang1999 Jul 10, 2024
37cb07c
refactor builder for whl build
LeiWang1999 Jul 10, 2024
f5b9999
Refactor TIRWrapper.wrap() method to include an assertion for the opt…
LeiWang1999 Jul 11, 2024
fb78244
Refactor lib_generator to set library and source paths
LeiWang1999 Jul 11, 2024
706e227
lint fix
LeiWang1999 Jul 11, 2024
63f5515
BitNet vllm integration
LeiWang1999 Jul 16, 2024
de91c0d
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Jul 16, 2024
b9655fd
chore: update codespell to version 2.3.0
LeiWang1999 Jul 16, 2024
fff385f
Lintfix
LeiWang1999 Jul 16, 2024
72a98e7
Bump version to 0.0.1.dev13
LeiWang1999 Jul 18, 2024
5646ab5
lint fix
LeiWang1999 Jul 18, 2024
b965863
disable fast decoding [u]int4xint8 by default.
LeiWang1999 Jul 21, 2024
1198fc7
optimize from dict design in Hint
LeiWang1999 Jul 21, 2024
014213c
Implement SplitK
LeiWang1999 Jul 21, 2024
e0ca752
bitnet benchmark generation.
LeiWang1999 Jul 21, 2024
81b9cf0
Add benchmark script for BitNet integration
LeiWang1999 Jul 21, 2024
02edc0b
AtomicAdd Support
LeiWang1999 Jul 21, 2024
1a70c2d
LintFix
LeiWang1999 Jul 21, 2024
28d851c
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Jul 21, 2024
c447a95
ci fix when 3rdparty tvm is initialized.
LeiWang1999 Jul 21, 2024
79a001b
bug fix for setup
LeiWang1999 Jul 21, 2024
31813b2
fix a bug in block reduce
LeiWang1999 Jul 21, 2024
78b6a3d
typo fix
LeiWang1999 Jul 21, 2024
9c55218
BUG Fix for block reduce.
LeiWang1999 Jul 22, 2024
1aa8868
Lint fix
LeiWang1999 Jul 22, 2024
22f70bf
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Jul 22, 2024
5f082a5
Refactor block reduce schedule template
LeiWang1999 Jul 22, 2024
b4fb31e
transform branch from bitblas to bitblas_tl
LeiWang1999 Jul 22, 2024
35eaa00
Fix subproject commit reference in 3rdparty/tvm
LeiWang1999 Jul 22, 2024
254dd74
chore: update submodule branch from bitblas to bitblas_tl
LeiWang1999 Jul 22, 2024
31a44aa
force update config.cmake
LeiWang1999 Jul 22, 2024
427800e
Bug fix
LeiWang1999 Jul 22, 2024
96db111
Fix subproject commit reference in 3rdparty/cutlass
LeiWang1999 Jul 22, 2024
38b251a
chore: Add submodule for cutlass library
LeiWang1999 Jul 22, 2024
87d1c5a
update tl cutlass path
LeiWang1999 Jul 22, 2024
6200b1e
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Jul 22, 2024
0ffe0b5
Refactor BitBLASLinear test module for improved readability and maint…
LeiWang1999 Jul 22, 2024
8e08e77
format fix
LeiWang1999 Jul 22, 2024
df05a64
Copy CUTLASS to the package directory
LeiWang1999 Jul 22, 2024
4f529c5
Refactor setup.py to include additional TVM header files
LeiWang1999 Jul 22, 2024
d02bbc7
lint fix
LeiWang1999 Jul 23, 2024
cffe3fd
bug fix
LeiWang1999 Jul 23, 2024
a8bed74
Refactor BitBLASLinear test module for improved readability and maint…
LeiWang1999 Jul 23, 2024
d4eb5fd
Implement Matmul Benchmark Design
LeiWang1999 Jul 23, 2024
4c6c2c1
chore: Update BitBLAS Matmul benchmark script
LeiWang1999 Jul 23, 2024
0acaca1
lint fix
LeiWang1999 Jul 23, 2024
54d2227
Refactor BitBLASMatmulOpsBenchmark for improved readability and maint…
LeiWang1999 Jul 23, 2024
c2edefb
Refactor BitBLASMatmulOpsBenchmark to disable tuning during benchmark…
LeiWang1999 Jul 23, 2024
e0bc723
lint fix
LeiWang1999 Jul 23, 2024
a4e68d1
Benchmark bot test
LeiWang1999 Jul 23, 2024
df7e9aa
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Jul 23, 2024
1c03365
Refactor BitBLASMatmulOpsBenchmark to disable tuning during benchmark…
LeiWang1999 Jul 23, 2024
4f319fc
Refactor BitBLASMatmulOpsBenchmark to disable tuning during benchmark…
LeiWang1999 Jul 23, 2024
a8833d4
Refactor BitBLASMatmulOpsBenchmark to disable tuning during benchmark…
LeiWang1999 Jul 23, 2024
803f6c6
Refactor BitBLASMatmulOpsBenchmark to disable tuning during benchmark…
LeiWang1999 Jul 23, 2024
df4572b
Refactor BitBLASMatmulOpsBenchmark to disable tuning during benchmark…
LeiWang1999 Jul 23, 2024
45ded45
int8 test case
LeiWang1999 Jul 23, 2024
4229676
Refactor compare_benchmark.py to handle missing benchmark results gra…
LeiWang1999 Jul 23, 2024
b883290
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Jul 23, 2024
476ffee
ci fix
LeiWang1999 Jul 23, 2024
9bd34ff
disable ci for test benchmark
LeiWang1999 Jul 23, 2024
e86f4b2
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Jul 23, 2024
75f3dd9
Refactor BitBLASMatmulOpsBenchmark to disable tuning during benchmark…
LeiWang1999 Jul 23, 2024
79e04aa
remove cli installation
LeiWang1999 Jul 23, 2024
cdd3345
chore: Create virtual environment and install dependencies for benchmark
LeiWang1999 Jul 23, 2024
f099938
Merge branch 'main' into dev
LeiWang1999 Jul 23, 2024
f211ad4
chore: Update benchmark workflow to include comparison step
LeiWang1999 Jul 23, 2024
ddde02a
Lint fix
LeiWang1999 Jul 24, 2024
8045ce9
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Jul 24, 2024
21aee89
Merge branch 'dev' of https://github.com/LeiWang1999/MSBitBLAS into dev
LeiWang1999 Jul 24, 2024
ef1b158
upodate tvm cmmit
LeiWang1999 Jul 25, 2024
a8d8841
Imporve lower warp memory pass
LeiWang1999 Jul 30, 2024
686b929
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Jul 30, 2024
7736c38
Bug fix
LeiWang1999 Jul 30, 2024
199affc
Enhance to support warp schedule.
LeiWang1999 Jul 31, 2024
9d0c25d
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Jul 31, 2024
7c1f52e
Enhance LOP3 Instructions
LeiWang1999 Jul 31, 2024
d1b2bc7
Enhance LOP3 Instructions
LeiWang1999 Jul 31, 2024
2aac6d0
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Jul 31, 2024
802abde
add test for stage3 propagate
LeiWang1999 Jul 31, 2024
d339037
implement propagate func
LeiWang1999 Jul 31, 2024
0f6a033
Stage3 Ladder Permutate integration
LeiWang1999 Jul 31, 2024
00ec916
get_ladder_stage3_propagate
LeiWang1999 Jul 31, 2024
5316577
comments benchmark scirpts as the setting is too big
LeiWang1999 Jul 31, 2024
dd070f9
ci fix for benchmark
LeiWang1999 Jul 31, 2024
6fcc368
lint fix
LeiWang1999 Jul 31, 2024
705580b
chore: Update benchmark workflow to trigger on pull request comments
LeiWang1999 Jul 31, 2024
c5ba940
Add LDMatrix Transform 3
LeiWang1999 Aug 1, 2024
1566990
Support GPTQ Test
LeiWang1999 Aug 1, 2024
c6c70ef
Fuse BlockReduce Schedule
LeiWang1999 Aug 1, 2024
36128f3
Support mma propagate 3
LeiWang1999 Aug 1, 2024
23ff5f4
Support MMA Propagate Stage 3
LeiWang1999 Aug 1, 2024
de3bf08
Lint Fix
LeiWang1999 Aug 1, 2024
d9830ba
Merge block reduce for dequantze config.
LeiWang1999 Aug 1, 2024
e5a4485
fix codeql
LeiWang1999 Aug 2, 2024
a04282b
chore: Update submodule reference to latest commit
LeiWang1999 Aug 4, 2024
314d3e9
chore: Disable common subexpression elimination in TIR passes
LeiWang1999 Aug 4, 2024
f7d33bb
Lint Fix
LeiWang1999 Aug 4, 2024
db633ed
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Aug 4, 2024
201155a
4bit related lop3 updates.
LeiWang1999 Aug 4, 2024
2b73662
lint fix
LeiWang1999 Aug 4, 2024
1a6a0fd
gptq test fix
LeiWang1999 Aug 4, 2024
e84e3ef
Fix for test
LeiWang1999 Aug 4, 2024
f0fbb55
lint fix
LeiWang1999 Aug 4, 2024
bf30688
lint fix
LeiWang1999 Aug 4, 2024
9a360ba
typofix
LeiWang1999 Aug 4, 2024
ee94536
QuantCompress Test
LeiWang1999 Aug 5, 2024
930cd76
chore: Refactor quant_compress_impl.py for readability and maintainab…
LeiWang1999 Aug 5, 2024
8c24776
Enhance docs to update latest works.
LeiWang1999 Aug 5, 2024
c018e3c
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into dev
LeiWang1999 Aug 5, 2024
38f1713
Refactor weight executors in Matmul class for improved readability an…
LeiWang1999 Aug 5, 2024
4a578ce
Refactor weight executors in Matmul class for improved readability an…
LeiWang1999 Aug 5, 2024
4e7126b
Refactor weight executors in Matmul class for improved readability an…
LeiWang1999 Aug 5, 2024
de9fd2e
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into upda…
LeiWang1999 Aug 5, 2024
e405aa2
removed legacy operator
LeiWang1999 Aug 5, 2024
5709db1
Refactor weight executors in Matmul class for improved readability an…
LeiWang1999 Aug 5, 2024
2d90e7b
LintFix
LeiWang1999 Aug 5, 2024
c2d2cfa
Fix GPTQ Repack with the latest weight transform
LeiWang1999 Aug 5, 2024
ed6a0a1
lint fix
LeiWang1999 Aug 5, 2024
d23ab47
bug fix for rescale dequantize
LeiWang1999 Aug 5, 2024
af16059
test fix
LeiWang1999 Aug 5, 2024
ac316fd
typo fix
LeiWang1999 Aug 5, 2024
71c1d6e
lint fix
LeiWang1999 Aug 5, 2024
b2892af
Set default weight propagate kind into LDMatrixTransform
LeiWang1999 Aug 5, 2024
3135a01
lint fix
LeiWang1999 Aug 5, 2024
a30dae9
bug fix
LeiWang1999 Aug 5, 2024
b913d26
bug fix for test
LeiWang1999 Aug 6, 2024
d96fa3d
set default to stage3
LeiWang1999 Aug 6, 2024
e0f068c
revert change
LeiWang1999 Aug 6, 2024
907d434
lint fix
LeiWang1999 Aug 6, 2024
e7c805a
case fix
LeiWang1999 Aug 7, 2024
7a16e5a
bug fix
LeiWang1999 Aug 7, 2024
8c666ac
fix for legalize
LeiWang1999 Aug 7, 2024
ce79943
bug fix
LeiWang1999 Aug 7, 2024
e6c5eec
chore: Clear global operator cache before running tests
LeiWang1999 Aug 7, 2024
4e8ab23
revert optimize_stratety into SingleBatchDecodeOnly
LeiWang1999 Aug 9, 2024
8177e2f
typofix
LeiWang1999 Aug 9, 2024
113e485
update benchmark scripts
LeiWang1999 Aug 9, 2024
46b2d7d
chore: Refactor benchmark scripts and fix typos
LeiWang1999 Aug 9, 2024
9ecbb48
fix for testing
LeiWang1999 Aug 9, 2024
fb128ed
lint fix
LeiWang1999 Aug 9, 2024
9b5e106
fix import.
LeiWang1999 Aug 9, 2024
54b4044
typo
LeiWang1999 Aug 9, 2024
23f88b7
operator benchmark
LeiWang1999 Aug 9, 2024
bcffc49
optimize
LeiWang1999 Aug 9, 2024
8b5f083
always with shared.dyn
LeiWang1999 Aug 9, 2024
54b5d3f
optimize cache.
LeiWang1999 Aug 9, 2024
4289d7b
dsl fix
LeiWang1999 Aug 9, 2024
72a1863
Merge branch 'main' into update_transform
LeiWang1999 Aug 9, 2024
2327e14
tqdm
LeiWang1999 Aug 9, 2024
40a9b04
Merge branch 'update_transform' of https://github.com/LeiWang1999/MSB…
LeiWang1999 Aug 9, 2024
a16ee62
chore: Add serialize_results method to benchmark_matmul_strategies.py
LeiWang1999 Aug 9, 2024
63fc654
fix performance issue for dynamic async copy
LeiWang1999 Aug 10, 2024
d37d09f
chore: Refactor benchmark_matmul_strategies.py for improved performan…
LeiWang1999 Aug 10, 2024
d4d4603
bug fix
LeiWang1999 Aug 10, 2024
1816526
update readme
LeiWang1999 Aug 12, 2024
b81a3a8
disable block reduce for int8
LeiWang1999 Aug 13, 2024
9cde970
Merge branch 'main' of https://github.com/Microsoft/BitBLAS into upda…
LeiWang1999 Aug 13, 2024
1c89c60
bugfix for bitnet
LeiWang1999 Aug 13, 2024
cfda648
annotatte todo.
LeiWang1999 Aug 13, 2024
83b99c4
lint fix
LeiWang1999 Aug 13, 2024
0b6b4a3
regist fast_decode for int8xint4
LeiWang1999 Aug 13, 2024
e93d1de
Refactor CUDA code to use sm architecture instead of compute architec…
LeiWang1999 Aug 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdparty/tvm
3 changes: 2 additions & 1 deletion bitblas/builder/lib_generator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def compile_lib(self, timeout: float = None):
"--shared",
src.name,
"-lcuda",
f"-gencode=arch=compute_{compute_version},code=compute_{compute_version}",
"-gencode",
f"arch=compute_{compute_version},code=sm_{compute_version}",
"-o",
libpath,
]
Expand Down
2 changes: 2 additions & 0 deletions bitblas/gpu/intrin/lop3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,7 @@ def fast_decode_impl(
(1, "int8", "float16", 8, "local", "uint", True, True, "rescale"),
(4, "int8", "int8", 8, "local", "uint", False, False, "original"),
(4, "int8", "int8", 16, "local", "uint", False, False, "original"),
(4, "int8", "int8", 16, "local", "int", False, False, "original"),
(2, "int8", "int8", 16, "local", "uint", False, False, "original"),
(2, "int8", "int8", 16, "local", "int", False, False, "original"),
(1, "int8", "int8", 16, "local", "uint", False, False, "original"),
Expand Down Expand Up @@ -1523,6 +1524,7 @@ def fast_decode_impl(
(1, "int8", "float16", 8, "warp", "uint", True, True, "rescale"),
(4, "int8", "int8", 8, "warp", "uint", False, False, "original"),
(4, "int8", "int8", 16, "warp", "uint", False, False, "original"),
(4, "int8", "int8", 16, "warp", "int", False, False, "original"),
(2, "int8", "int8", 16, "warp", "uint", False, False, "original"),
(2, "int8", "int8", 16, "warp", "int", False, False, "original"),
(1, "int8", "int8", 16, "warp", "uint", False, False, "original"),
Expand Down
3 changes: 2 additions & 1 deletion bitblas/gpu/matmul_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ def check_last_trait(region: List[Range]):
# Currently, we only support block reduction depth 2 for small M
# When the func is a dequantize like ops, we should consider the M
require_block_reduce = False
if hasattr(func.attrs, "dequantize_info"):
# And we only support float16 for now
if hasattr(func.attrs, "dequantize_info") and in_dtype == "float16":
for arg in func.params:
inp_shape = func.buffer_map[arg].shape
M = inp_shape[0]
Expand Down
2 changes: 2 additions & 0 deletions bitblas/ops/general_matmul/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ class MatmulConfig(OperatorConfig):
None # propagate_b is a flag to control the ladder permutation
)

# TODO: This is a temporary solution to legalize the dynamic symbolic.
# Maybe we should remove this in the future.
# optimize strategy, default is SingleBatchDecodeOnly
optimize_stratety: Union[int, OptimizeStrategy] = OptimizeStrategy.SingleBatchDecodeOnly

Expand Down
3 changes: 2 additions & 1 deletion bitblas/wrapper/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def compile_lib(self, timeout: float = None):
"--shared",
src.name,
"-lcuda",
f"-gencode=arch=compute_{compute_version},code=compute_{compute_version}",
"-gencode",
f"arch=compute_{compute_version},code=sm_{compute_version}",
"-o",
libpath,
]
Expand Down
11 changes: 6 additions & 5 deletions integration/BitNet/eval_correctness.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,19 @@ def get_runtime(num_repeats=1):
def main():
model = BitnetForCausalLM.from_pretrained(
model_path,
use_flash_attention_2=True,
use_flash_attention_2=False,
torch_dtype=torch.float16,
).cuda().half()
with torch.no_grad():
model._post_process_weights()

tokenizer = BitnetTokenizer.from_pretrained(model_path, use_fast=False)
input_id = tokenizer("Hello")['input_ids']
input_id = torch.tensor(input_id).unsqueeze(0).cuda()
output = model(input_id)
print(output)

print("original model generated text:")
print(generate_text(model, tokenizer, "Hello", max_length=100))

model.quantize()
print("quantized model generated text:")
print(generate_text(model, tokenizer, "Hello", max_length=100))


Expand Down
2 changes: 1 addition & 1 deletion integration/BitNet/maint/create_bitblas_ckpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def main():
model = (
BitnetForCausalLM.from_pretrained(
model_name_or_path,
use_flash_attention_2=True,
use_flash_attention_2=False,
torch_dtype=torch.float16,
).cuda().half())
tokenizer = BitnetTokenizer.from_pretrained(model_name_or_path, use_fast=False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ fi
if [ -z "$SAVED_MODEL_DIR" ]; then
python ./maint/create_bitblas_ckpt.py --model_name_or_path $MODEL_DIR
else
if [ ! -d "$SAVED_MODEL_DIR" ]; then
mkdir -p $SAVED_MODEL_DIR
fi
python ./maint/create_bitblas_ckpt.py --model_name_or_path $MODEL_DIR --saved_model_path $SAVED_MODEL_DIR
fi

Expand Down
1 change: 1 addition & 0 deletions integration/BitNet/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
lm_eval==0.3.0
flash_attn
transformers==4.40
Loading