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

Add op ir #270

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open

Add op ir #270

wants to merge 24 commits into from

Conversation

weilinquan
Copy link
Contributor

You can also run llama by BuddyLlama.

Copy link
Member

@zhanghb97 zhanghb97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed Tests (13):
  BUDDY :: Python/test_addmm.py
  BUDDY :: Python/test_amax.py
  BUDDY :: Python/test_arith_sub.py
  BUDDY :: Python/test_convert_element_type.py
  BUDDY :: Python/test_embedding.py
  BUDDY :: Python/test_exp.py
  BUDDY :: Python/test_expand.py
  BUDDY :: Python/test_permute.py
  BUDDY :: Python/test_reshape.py
  BUDDY :: Python/test_select.py
  BUDDY :: Python/test_sum.py
  BUDDY :: Python/test_tanh.py
  BUDDY :: Python/test_var_mean.py

I encountered above failed when I run the ninja check-buddy. Please have a check.

@weilinquan
Copy link
Contributor Author

Failed Tests (13):
  BUDDY :: Python/test_addmm.py
  BUDDY :: Python/test_amax.py
  BUDDY :: Python/test_arith_sub.py
  BUDDY :: Python/test_convert_element_type.py
  BUDDY :: Python/test_embedding.py
  BUDDY :: Python/test_exp.py
  BUDDY :: Python/test_expand.py
  BUDDY :: Python/test_permute.py
  BUDDY :: Python/test_reshape.py
  BUDDY :: Python/test_select.py
  BUDDY :: Python/test_sum.py
  BUDDY :: Python/test_tanh.py
  BUDDY :: Python/test_var_mean.py

I encountered above failed when I run the ninja check-buddy. Please have a check.

Thank you for your comment. This because tosa's op set have not adapted for current graph IR. We can add tosa support later in this PR.

@zhanghb97
Copy link
Member

Failed to build LLaMA example:

[1/5] Generating llama.mlir and arg0.data...
FAILED: ../examples/BuddyLlama/llama.mlir ../examples/BuddyLlama/arg0.data /home/zhb/buddy-mlir/examples/BuddyLlama/llama.mlir /home/zhb/buddy-mlir/examples/BuddyLlama/arg0.data 
cd /home/zhb/buddy-mlir/build/examples/BuddyLlama && /home/zhb/miniforge3/envs/test/bin/python3 /home/zhb/buddy-mlir/examples/BuddyLlama/import-llama2.py
You are using the default legacy behaviour of the <class 'transformers.models.llama.tokenization_llama.LlamaTokenizer'>. If you see this, DO NOT PANIC! This is expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it means, and thouroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565
Loading checkpoint shards: 100%|██████████| 2/2 [00:31<00:00, 15.60s/it]
Traceback (most recent call last):
  File "/home/zhb/buddy-mlir/examples/BuddyLlama/import-llama2.py", line 54, in <module>
    graphs = dynamo_compiler.importer(model, data)
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/frontend.py", line 223, in importer
    model_opt(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 328, in _fn
    return fn(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 490, in catch_errors
    return callback(frame, cache_entry, hooks, frame_state)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 641, in _convert_frame
    result = inner_convert(frame, cache_size, hooks, frame_state)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 133, in _fn
    return fn(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 389, in _convert_frame_assert
    return _compile(
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 569, in _compile
    guarded_code = compile_inner(code, one_graph, hooks, transform)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 189, in time_wrapper
    r = func(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 491, in compile_inner
    out_code = transform_code_object(code, transform)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/bytecode_transformation.py", line 1028, in transform_code_object
    transformations(instructions, code_options)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 458, in transform
    tracer.run()
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 2069, in run
    super().run()
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 719, in run
    and self.step()
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 683, in step
    getattr(self, inst.opname)(inst)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 2157, in RETURN_VALUE
    self.output.compile_subgraph(
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 857, in compile_subgraph
    self.compile_and_call_fx_graph(tx, pass2.graph_output_vars(), root)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 957, in compile_and_call_fx_graph
    compiled_fn = self.call_user_compiler(gm)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 189, in time_wrapper
    r = func(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 1024, in call_user_compiler
    raise BackendCompilerFailed(self.compiler_fn, e).with_traceback(
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 1009, in call_user_compiler
    compiled_fn = compiler_fn(gm, self.example_inputs())
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/repro/after_dynamo.py", line 117, in debug_wrapper
    compiled_gm = compiler_fn(gm, example_inputs)
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/frontend.py", line 188, in _compile_fx
    return aot_module_simplified(
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 3891, in aot_module_simplified
    compiled_fn = create_aot_dispatcher_function(
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 189, in time_wrapper
    r = func(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 3429, in create_aot_dispatcher_function
    compiled_fn = compiler_fn(flat_fn, fake_flat_args, aot_config, fw_metadata=fw_metadata)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 2212, in aot_wrapper_dedupe
    return compiler_fn(flat_fn, leaf_flat_args, aot_config, fw_metadata=fw_metadata)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 2392, in aot_wrapper_synthetic_base
    return compiler_fn(flat_fn, flat_args, aot_config, fw_metadata=fw_metadata)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 1573, in aot_dispatch_base
    compiled_fw = compiler(fw_module, flat_args)
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/frontend.py", line 181, in _compiler
    return graph.dynamo_run()
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/graph/graph.py", line 230, in dynamo_run
    self.compile()
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/graph/graph.py", line 223, in compile
    self.lower_to_top_level_ir()
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/graph/graph.py", line 140, in lower_to_top_level_ir
    self._imported_module = fx_importer.import_graph()
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/graph/graph.py", line 392, in import_graph
    def generated_func(*args):
  File "/home/zhb/buddy-mlir/llvm/build/tools/mlir/python_packages/mlir_core/mlir/dialects/func.py", line 195, in decorator
    return_values = f(*func_args, **func_kwargs)
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/graph/graph.py", line 416, in generated_func
    self._import_op(node)
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/graph/graph.py", line 472, in _import_op
    self._ops_registry[op_name](node, self._symbol_table)
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/ops/tosa.py", line 873, in transpose_op
    assert len(node.args) == 3, "Input tensor must be 3D"
torch._dynamo.exc.BackendCompilerFailed: backend='_compile_fx' raised:
AssertionError: Input tensor must be 3D

Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information


You can suppress this exception and fall back to eager by setting:
    import torch._dynamo
    torch._dynamo.config.suppress_errors = True

ninja: build stopped: subcommand failed.

@weilinquan
Copy link
Contributor Author

Failed to build LLaMA example:

[1/5] Generating llama.mlir and arg0.data...
FAILED: ../examples/BuddyLlama/llama.mlir ../examples/BuddyLlama/arg0.data /home/zhb/buddy-mlir/examples/BuddyLlama/llama.mlir /home/zhb/buddy-mlir/examples/BuddyLlama/arg0.data 
cd /home/zhb/buddy-mlir/build/examples/BuddyLlama && /home/zhb/miniforge3/envs/test/bin/python3 /home/zhb/buddy-mlir/examples/BuddyLlama/import-llama2.py
You are using the default legacy behaviour of the <class 'transformers.models.llama.tokenization_llama.LlamaTokenizer'>. If you see this, DO NOT PANIC! This is expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it means, and thouroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565
Loading checkpoint shards: 100%|██████████| 2/2 [00:31<00:00, 15.60s/it]
Traceback (most recent call last):
  File "/home/zhb/buddy-mlir/examples/BuddyLlama/import-llama2.py", line 54, in <module>
    graphs = dynamo_compiler.importer(model, data)
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/frontend.py", line 223, in importer
    model_opt(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 328, in _fn
    return fn(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 490, in catch_errors
    return callback(frame, cache_entry, hooks, frame_state)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 641, in _convert_frame
    result = inner_convert(frame, cache_size, hooks, frame_state)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 133, in _fn
    return fn(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 389, in _convert_frame_assert
    return _compile(
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 569, in _compile
    guarded_code = compile_inner(code, one_graph, hooks, transform)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 189, in time_wrapper
    r = func(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 491, in compile_inner
    out_code = transform_code_object(code, transform)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/bytecode_transformation.py", line 1028, in transform_code_object
    transformations(instructions, code_options)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 458, in transform
    tracer.run()
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 2069, in run
    super().run()
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 719, in run
    and self.step()
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 683, in step
    getattr(self, inst.opname)(inst)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 2157, in RETURN_VALUE
    self.output.compile_subgraph(
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 857, in compile_subgraph
    self.compile_and_call_fx_graph(tx, pass2.graph_output_vars(), root)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 957, in compile_and_call_fx_graph
    compiled_fn = self.call_user_compiler(gm)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 189, in time_wrapper
    r = func(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 1024, in call_user_compiler
    raise BackendCompilerFailed(self.compiler_fn, e).with_traceback(
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 1009, in call_user_compiler
    compiled_fn = compiler_fn(gm, self.example_inputs())
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/repro/after_dynamo.py", line 117, in debug_wrapper
    compiled_gm = compiler_fn(gm, example_inputs)
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/frontend.py", line 188, in _compile_fx
    return aot_module_simplified(
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 3891, in aot_module_simplified
    compiled_fn = create_aot_dispatcher_function(
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 189, in time_wrapper
    r = func(*args, **kwargs)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 3429, in create_aot_dispatcher_function
    compiled_fn = compiler_fn(flat_fn, fake_flat_args, aot_config, fw_metadata=fw_metadata)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 2212, in aot_wrapper_dedupe
    return compiler_fn(flat_fn, leaf_flat_args, aot_config, fw_metadata=fw_metadata)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 2392, in aot_wrapper_synthetic_base
    return compiler_fn(flat_fn, flat_args, aot_config, fw_metadata=fw_metadata)
  File "/home/zhb/miniforge3/envs/test/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 1573, in aot_dispatch_base
    compiled_fw = compiler(fw_module, flat_args)
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/frontend.py", line 181, in _compiler
    return graph.dynamo_run()
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/graph/graph.py", line 230, in dynamo_run
    self.compile()
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/graph/graph.py", line 223, in compile
    self.lower_to_top_level_ir()
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/graph/graph.py", line 140, in lower_to_top_level_ir
    self._imported_module = fx_importer.import_graph()
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/graph/graph.py", line 392, in import_graph
    def generated_func(*args):
  File "/home/zhb/buddy-mlir/llvm/build/tools/mlir/python_packages/mlir_core/mlir/dialects/func.py", line 195, in decorator
    return_values = f(*func_args, **func_kwargs)
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/graph/graph.py", line 416, in generated_func
    self._import_op(node)
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/graph/graph.py", line 472, in _import_op
    self._ops_registry[op_name](node, self._symbol_table)
  File "/home/zhb/buddy-mlir/build/python_packages/buddy/compiler/ops/tosa.py", line 873, in transpose_op
    assert len(node.args) == 3, "Input tensor must be 3D"
torch._dynamo.exc.BackendCompilerFailed: backend='_compile_fx' raised:
AssertionError: Input tensor must be 3D

Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information


You can suppress this exception and fall back to eager by setting:
    import torch._dynamo
    torch._dynamo.config.suppress_errors = True

ninja: build stopped: subcommand failed.

@zhanghb97 I have fix this error. Please review it again. Thank you !

@zhanghb97
Copy link
Member

ninja check-buddy failed:

******************** TEST 'BUDDY :: Python/test_transpose.py' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /home/zhb/miniforge3/envs/test/bin/python3 /home/zhb/buddy-mlir/tests/Python/test_transpose.py 2>&1 | /home/zhb/buddy-mlir/llvm/build/bin/FileCheck /home/zhb/buddy-mlir/tests/Python/test_transpose.py
+ /home/zhb/buddy-mlir/llvm/build/bin/FileCheck /home/zhb/buddy-mlir/tests/Python/test_transpose.py
+ /home/zhb/miniforge3/envs/test/bin/python3 /home/zhb/buddy-mlir/tests/Python/test_transpose.py
/home/zhb/buddy-mlir/tests/Python/test_transpose.py:33:10: error: CHECK: expected string not found in input
# CHECK: %{{.*}} = tensor.empty()
         ^
<stdin>:2:20: note: scanning from here
 func.func @forward(%arg0: tensor<13x13x13xf32>) -> tensor<13x13x13xf32> {
                   ^
<stdin>:3:69: note: possible intended match here
 %0 = "tosa.const"() <{value = dense<[0, 2, 1]> : tensor<3xi32>}> : () -> tensor<3xi32>
                                                                    ^

Input file: <stdin>
Check file: /home/zhb/buddy-mlir/tests/Python/test_transpose.py

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: module { 
            2:  func.func @forward(%arg0: tensor<13x13x13xf32>) -> tensor<13x13x13xf32> { 
check:33'0                        X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            3:  %0 = "tosa.const"() <{value = dense<[0, 2, 1]> : tensor<3xi32>}> : () -> tensor<3xi32> 
check:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:33'1                                                                         ?                    possible intended match
            4:  %1 = tosa.transpose %arg0, %0 : (tensor<13x13x13xf32>, tensor<3xi32>) -> tensor<13x13x13xf32> 
check:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            5:  return %1 : tensor<13x13x13xf32> 
check:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            6:  } 
check:33'0     ~~~
            7: } 
check:33'0     ~~
            8:  
check:33'0     ~
>>>>>>

--

********************
********************
Failed Tests (1):
  BUDDY :: Python/test_transpose.py

@weilinquan
Copy link
Contributor Author

weilinquan commented Jan 4, 2024

ninja check-buddy failed:

******************** TEST 'BUDDY :: Python/test_transpose.py' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /home/zhb/miniforge3/envs/test/bin/python3 /home/zhb/buddy-mlir/tests/Python/test_transpose.py 2>&1 | /home/zhb/buddy-mlir/llvm/build/bin/FileCheck /home/zhb/buddy-mlir/tests/Python/test_transpose.py
+ /home/zhb/buddy-mlir/llvm/build/bin/FileCheck /home/zhb/buddy-mlir/tests/Python/test_transpose.py
+ /home/zhb/miniforge3/envs/test/bin/python3 /home/zhb/buddy-mlir/tests/Python/test_transpose.py
/home/zhb/buddy-mlir/tests/Python/test_transpose.py:33:10: error: CHECK: expected string not found in input
# CHECK: %{{.*}} = tensor.empty()
         ^
<stdin>:2:20: note: scanning from here
 func.func @forward(%arg0: tensor<13x13x13xf32>) -> tensor<13x13x13xf32> {
                   ^
<stdin>:3:69: note: possible intended match here
 %0 = "tosa.const"() <{value = dense<[0, 2, 1]> : tensor<3xi32>}> : () -> tensor<3xi32>
                                                                    ^

Input file: <stdin>
Check file: /home/zhb/buddy-mlir/tests/Python/test_transpose.py

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: module { 
            2:  func.func @forward(%arg0: tensor<13x13x13xf32>) -> tensor<13x13x13xf32> { 
check:33'0                        X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            3:  %0 = "tosa.const"() <{value = dense<[0, 2, 1]> : tensor<3xi32>}> : () -> tensor<3xi32> 
check:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:33'1                                                                         ?                    possible intended match
            4:  %1 = tosa.transpose %arg0, %0 : (tensor<13x13x13xf32>, tensor<3xi32>) -> tensor<13x13x13xf32> 
check:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            5:  return %1 : tensor<13x13x13xf32> 
check:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            6:  } 
check:33'0     ~~~
            7: } 
check:33'0     ~~
            8:  
check:33'0     ~
>>>>>>

--

********************
********************
Failed Tests (1):
  BUDDY :: Python/test_transpose.py

@zhanghb97 Sorry about that. I have fix it and run ninja check-buddy on my machine. I found it will output this.
******************** TEST 'BUDDY-EXAMPLES :: BuddyBert/bert.mlir' FAILED ********************
Test has no 'RUN:' line



Unresolved Tests (1):
BUDDY-EXAMPLES :: BuddyBert/bert.mlir

Testing Time: 0.47s

Total Discovered Tests: 88
Passed : 87 (98.86%)
Unresolved: 1 (1.14%)
FAILED: examples/CMakeFiles/check-examples /root/buddy-mlir/build/examples/CMakeFiles/check-examples
cd /root/buddy-mlir/build/examples && /root/anaconda3/bin/python /root/buddy-mlir/llvm/build/./bin/llvm-lit -sv /root/buddy-mlir/build/examples
It seems BuddyBert has not added to lit. Here should not have other errors.

@zhanghb97
Copy link
Member

@weilinquan No worries. Fixed the bert test: fc2948a

@weilinquan
Copy link
Contributor Author

@weilinquan No worries. Fixed the bert test: fc2948a

@zhanghb97 Thank you for your comment ! I have add it and now ninja check-buddy is ok on my machine.

@zhanghb97
Copy link
Member

@weilinquan @xTayEx Thank you! Now, it works well. I am still reviewing the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants