-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dev] Move Relax Pass from testing to integration (#77)
* Refactor BatchMatMulEmitter and BatchMatMulSelector for improved readability and maintainability * Refactor import statements for improved readability and maintainability * Refactor import statements for improved readability and maintainability * disable failure email for ci * remove email notifications. * move relax pass from testing to mlc_llm
- Loading branch information
1 parent
60caba6
commit bf41fc4
Showing
4 changed files
with
266 additions
and
9 deletions.
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
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,68 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
from bitblas.ops.impl.matmul_dequantize_impl import ( | ||
MatMulNTDequantizeEmitter, | ||
matmul_nt_dequantize_b, | ||
matmul_nt_dequantize_b_propagate_b, | ||
matmul_nt_dequantize_b_propagate_a_propagate_b, | ||
) | ||
from bitblas import tvm | ||
import logging | ||
from bitblas import set_log_level | ||
|
||
set_log_level(logging.DEBUG) | ||
|
||
def compare_tir_scripts_and_emitter( | ||
M, | ||
N, | ||
K, | ||
in_dtype, | ||
out_dtype, | ||
accum_dtype, | ||
bit, | ||
storage_dtype, | ||
source_format, | ||
with_scaling, | ||
with_zeros, | ||
group_size, | ||
fast_decoding, | ||
with_bias, | ||
zeros_mode, | ||
): | ||
tir_script_func = matmul_nt_dequantize_b( | ||
M, | ||
N, | ||
K, | ||
in_dtype, | ||
out_dtype, | ||
accum_dtype, | ||
bit, | ||
storage_dtype, | ||
source_format, | ||
with_scaling, | ||
with_zeros, | ||
group_size, | ||
fast_decoding, | ||
with_bias, | ||
zeros_mode, | ||
) | ||
|
||
emitter_func = MatMulNTDequantizeEmitter( | ||
M, | ||
N, | ||
K, | ||
in_dtype, | ||
out_dtype, | ||
accum_dtype, | ||
bit, | ||
storage_dtype, | ||
source_format, | ||
with_scaling, | ||
with_zeros, | ||
group_size, | ||
fast_decoding, | ||
with_bias, | ||
zeros_mode, | ||
).emit() | ||
|
||
tvm.ir.assert_structural_equal(tir_script_func, emitter_func) |