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

[Fix][Dev] Typo fix for our workflow and enhance lop3 decode to support scaling #125

Merged
merged 134 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 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
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 .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
# On pull requests and if the comment starts with `/run-benchmark`
if: github.event.issue.pull_request != null && startsWith(github.event.comment.body, '/run-benchmark')
runs-on: self-hosted
depends-on: [benchmark_base]
needs: [benchmark_base]

steps:
- name: Checkout PR branch code
Expand Down
6 changes: 5 additions & 1 deletion bitblas/base/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ def tvm_callback_cuda_postproc(code, _):
code = tensor_remove_make_int2(code)
return code

with tvm.transform.PassContext(config={"tir.use_async_copy": True, **config.pass_context}):
with tvm.transform.PassContext(config={
"tir.use_async_copy": True,
"tir.disable_cse_tir": True,
**config.pass_context
}):
rt_mod = tvm.build(mod, target=arch.target)

from tvm.contrib.tar import tar # pylint: disable=import-outside-toplevel
Expand Down
289 changes: 277 additions & 12 deletions bitblas/gpu/intrin/lop3.py

Large diffs are not rendered by default.

286 changes: 155 additions & 131 deletions bitblas/gpu/matmul_mma_dequantize.py

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions bitblas/ops/general_matmul/tirscript/matmul_dequantize_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
_tir_u8_to_f8_e4m3_to_f16,
_tir_packed_to_unsigned_convert_with_zeros,
)
from typing import Union


class MatMulNTDequantizeEmitter:
Expand Down Expand Up @@ -514,8 +515,11 @@ def matmul_nt_dequantize_b_propagate_b(
fast_decoding=False,
with_bias=False,
zeros_mode="original",
transform_kind: TransformKind = TransformKind.IntraWarpTransform,
transform_kind: Union[int, TransformKind] = TransformKind.NonTransform,
):
if isinstance(transform_kind, int):
transform_kind = TransformKind(transform_kind)

assert bit in [1, 2, 4, 8], "Unsupported bit: {}".format(bit)
if not isinstance(M, int):
M = tvm.te.var("m")
Expand Down Expand Up @@ -695,9 +699,14 @@ def matmul_nt_dequantize_b_propagate_a_propagate_b(
fast_decoding=False,
with_bias=False,
zeros_mode="original",
transform_kind_input: TransformKind = TransformKind.IntraWarpTransform,
transform_kind_weight: TransformKind = TransformKind.IntraWarpTransform,
transform_kind_input: Union[int, TransformKind] = TransformKind.NonTransform,
transform_kind_weight: Union[int, TransformKind] = TransformKind.NonTransform,
):
if isinstance(transform_kind_input, int):
transform_kind_input = TransformKind(transform_kind_input)
if isinstance(transform_kind_weight, int):
transform_kind_weight = TransformKind(transform_kind_weight)

assert bit in [1, 2, 4, 8], "Unsupported bit: {}".format(bit)
if not isinstance(M, int):
M = tvm.te.var("m")
Expand Down
4 changes: 2 additions & 2 deletions bitblas/ops/ladder_permutate/ladder_permutate_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ def select_implementation(
None,
)

ladder_stage3_map_inverse = ladder_stage3_map.inverse([l, r])

inp = te.placeholder((M, N // scaling_factor), name="inp", dtype=storage_dtype)
args = [inp]

Expand Down Expand Up @@ -97,6 +95,8 @@ def fcompute(*args):
if transform_kind >= 3:
arg = args[-1]

ladder_stage3_map_inverse = ladder_stage3_map.inverse([l, r])

def fcompute(*args):
warp_i, warp_j = args[-2:]
spatial_args = args[:-2]
Expand Down
1 change: 1 addition & 0 deletions bitblas/ops/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def tvm_callback_cuda_postproc(code, _):
# Use a specific TVM pass context for CUDA platforms
with tvm.transform.PassContext(config={
"tir.use_async_copy": True,
"tir.disable_cse_tir": True,
**self.pass_context
}):
rt_mod = tvm.build(self.optimized_func, target=target, name=self.name)
Expand Down
4 changes: 3 additions & 1 deletion testing/python/module/test_repack_from_gptq.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import torch

try:
import auto_gptq # noqa
import auto_gptq # noqa: F401
except ImportError as e:
raise ImportError("Please install auto-gptq by running `pip install auto-gptq`") from e

Expand All @@ -16,6 +16,8 @@


def assert_output_with_gptq(m, in_features, out_features, group_size):
if group_size == -1:
group_size = in_features
_, linear, s, _ = bitblas.quantization.gen_quant4(in_features, out_features, group_size)

zeros = torch.full((in_features // group_size, out_features), 7, dtype=torch.int32)
Expand Down
Loading
Loading