[Dev] Refactor the ops script implementation with SE #78
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant changes to the
bitblas/ops/impl/matmul_dequantize_impl.py
andtesting/python/operators/test_tir_script_emitter.py
files. The most important changes include the addition of a new classMatMulNTDequantizeEmitter
to refactor the code, modifications to thedecode_func
function, and changes to the test functioncompare_tir_scripts_and_emitter
to include new parameters and assertions.Additions and modifications:
bitblas/ops/impl/matmul_dequantize_impl.py
: Added a new classMatMulNTDequantizeEmitter
with various methods to refactor and simplify the code. This class includes methods for validating dimensions and bits, creating placeholders, propagating input and weight, decoding functions, computing matmul, converting dtype, and applying bias.bitblas/ops/impl/matmul_dequantize_impl.py
: Modified thedecode_func
function to include a new variablelast_output
and to change the order of the arguments in theargs
list. [1] [2] [3]Changes to testing:
testing/python/operators/test_tir_script_emitter.py
: Modified thecompare_tir_scripts_and_emitter
function to include new parameterspropagate_a
andpropagate_b
, and to add new assertions for the equality of reference and emit functions. [1] [2] [3]testing/python/operators/test_tir_script_emitter.py
: Added a new functiontest_check_eual_ref_scripts_with_emitter
to test the equality of reference and emit scripts for various configurations.