Skip to content

[MediaTek] mtk_neuron compile error: 3D permutation not support #9733

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

Open
ruitard opened this issue Mar 28, 2025 · 1 comment
Open

[MediaTek] mtk_neuron compile error: 3D permutation not support #9733

ruitard opened this issue Mar 28, 2025 · 1 comment
Assignees
Labels
module: mediatek Delegate to MediaTek backend partner: mediatek Issues related to the Mediatek delegate

Comments

@ruitard
Copy link

ruitard commented Mar 28, 2025

🐛 Describe the bug

I want to adapt the OLMoE model on the MTK platform, refer olmoe

I got the RuntimeError:

Traceback (most recent call last):
  File "/home/zhangrui5/projects/example/model.py", line 129, in <module>
    delegated_program = edge_program.to_backend(partitioner)
  File "/home/zhangrui5/.conda/envs/mtk/lib/python3.10/site-packages/executorch/exir/program/_program.py", line 93, in wrapper
    return func(self, *args, **kwargs)
  File "/home/zhangrui5/.conda/envs/mtk/lib/python3.10/site-packages/executorch/exir/program/_program.py", line 1332, in to_backend
    new_edge_programs[name] = to_backend(program, partitioner)
  File "/home/zhangrui5/.conda/envs/mtk/lib/python3.10/functools.py", line 889, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/home/zhangrui5/.conda/envs/mtk/lib/python3.10/site-packages/executorch/exir/backend/backend_api.py", line 396, in _
    tagged_graph_module = _partition_and_lower(
  File "/home/zhangrui5/.conda/envs/mtk/lib/python3.10/site-packages/executorch/exir/backend/backend_api.py", line 319, in _partition_and_lower
    partitioned_module = _partition_and_lower_one_graph_module(
  File "/home/zhangrui5/.conda/envs/mtk/lib/python3.10/site-packages/executorch/exir/backend/backend_api.py", line 249, in _partition_and_lower_one_graph_module
    lowered_submodule = to_backend(
  File "/home/zhangrui5/.conda/envs/mtk/lib/python3.10/functools.py", line 889, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/home/zhangrui5/.conda/envs/mtk/lib/python3.10/site-packages/executorch/exir/backend/backend_api.py", line 113, in _
    preprocess_result: PreprocessResult = cls.preprocess(
  File "/home/zhangrui5/.conda/envs/mtk/lib/python3.10/site-packages/executorch/backends/mediatek/preprocess.py", line 88, in preprocess
    model_bytes = mtk_neuron.compile(mlir_str, " ".join(compile_options))
  File "/home/zhangrui5/.conda/envs/mtk/lib/python3.10/site-packages/mtk_neuron/mtk_neuron.py", line 127, in compile
    raise RuntimeError(f'Compile error:\n{status["log"]}')
RuntimeError: Compile error:
NIR[0]: TransposeLayer
 ├ MDLA: Cannot support Int16 input
 ├ MDLA: Cannot support Int16 output
 ├ EDPA: false Transpose is not supported
 ├ EDPA: permSupport == perm 3D permutation not support
NIR[2]: ReshapeLayer
 ├ MDLA: Cannot support Int16 input
 ├ MDLA: Cannot support Int16 output
 ├ EDPA: unsupported operation
NIR[5]: ReshapeLayer
 ├ MDLA: Cannot support Int16 input
 ├ MDLA: Cannot support Int16 output
 ├ EDPA: unsupported operation
NIR[8]: ReshapeLayer
 ├ MDLA: Cannot support Int16 input
 ├ MDLA: Cannot support Int16 output
 ├ EDPA: unsupported operation
NIR[11]: ReshapeLayer
 ├ MDLA: Cannot support Int16 input
 ├ MDLA: Cannot support Int16 output
 ├ EDPA: unsupported operation

It might be caused by https://github.com/huggingface/transformers/blob/main/src/transformers/models/olmoe/modeling_olmoe.py#L632

Versions

Could you please provide some suggestions? @neuropilot-captain

cc @cccclai @neuropilot-captain @cbilgin

@JacobSzwejbka JacobSzwejbka added the module: mediatek Delegate to MediaTek backend label Mar 28, 2025
@JacobSzwejbka
Copy link
Contributor

@cccclai

@cccclai cccclai added the partner: mediatek Issues related to the Mediatek delegate label Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: mediatek Delegate to MediaTek backend partner: mediatek Issues related to the Mediatek delegate
Projects
None yet
Development

No branches or pull requests

4 participants